android: Format code
Finally makes us have consistent code format in the codebase.
This commit is contained in:
parent
2b1a06b45d
commit
280d298471
@ -49,8 +49,7 @@ public class CitraApplication extends Application {
|
|||||||
databaseHelper = new GameDatabase(this);
|
databaseHelper = new GameDatabase(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Context getAppContext()
|
public static Context getAppContext() {
|
||||||
{
|
|
||||||
return application.getApplicationContext();
|
return application.getApplicationContext();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -428,7 +428,8 @@ public final class NativeLibrary {
|
|||||||
synchronized (cameraPermissionLock) {
|
synchronized (cameraPermissionLock) {
|
||||||
try {
|
try {
|
||||||
cameraPermissionLock.wait();
|
cameraPermissionLock.wait();
|
||||||
} catch (InterruptedException ignored) {}
|
} catch (InterruptedException ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return cameraPermissionGranted;
|
return cameraPermissionGranted;
|
||||||
}
|
}
|
||||||
|
@ -243,19 +243,19 @@ public final class EmulationActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||||
switch (requestCode) {
|
switch (requestCode) {
|
||||||
case NativeLibrary.REQUEST_CODE_NATIVE_CAMERA:
|
case NativeLibrary.REQUEST_CODE_NATIVE_CAMERA:
|
||||||
if (grantResults[0] != PackageManager.PERMISSION_GRANTED) {
|
if (grantResults[0] != PackageManager.PERMISSION_GRANTED) {
|
||||||
new AlertDialog.Builder(this)
|
new AlertDialog.Builder(this)
|
||||||
.setTitle(R.string.camera)
|
.setTitle(R.string.camera)
|
||||||
.setMessage(R.string.camera_permission_needed)
|
.setMessage(R.string.camera_permission_needed)
|
||||||
.setPositiveButton(android.R.string.ok, null)
|
.setPositiveButton(android.R.string.ok, null)
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
NativeLibrary.CameraPermissionResult(grantResults[0] == PackageManager.PERMISSION_GRANTED);
|
NativeLibrary.CameraPermissionResult(grantResults[0] == PackageManager.PERMISSION_GRANTED);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,8 @@ public final class MiiSelector {
|
|||||||
final Activity emulationActivity = Objects.requireNonNull(getActivity());
|
final Activity emulationActivity = Objects.requireNonNull(getActivity());
|
||||||
|
|
||||||
MiiSelectorConfig config =
|
MiiSelectorConfig config =
|
||||||
Objects.requireNonNull((MiiSelectorConfig)Objects.requireNonNull(getArguments())
|
Objects.requireNonNull((MiiSelectorConfig) Objects.requireNonNull(getArguments())
|
||||||
.getSerializable("config"));
|
.getSerializable("config"));
|
||||||
|
|
||||||
// Note: we intentionally leave out the Standard Mii in the native code so that
|
// Note: we intentionally leave out the Standard Mii in the native code so that
|
||||||
// the string can get translated
|
// the string can get translated
|
||||||
@ -66,22 +66,24 @@ public final class MiiSelector {
|
|||||||
list.addAll(Arrays.asList(config.mii_names));
|
list.addAll(Arrays.asList(config.mii_names));
|
||||||
|
|
||||||
final int initialIndex = config.initially_selected_mii_index < list.size()
|
final int initialIndex = config.initially_selected_mii_index < list.size()
|
||||||
? (int)config.initially_selected_mii_index
|
? (int) config.initially_selected_mii_index
|
||||||
: 0;
|
: 0;
|
||||||
data.index = initialIndex;
|
data.index = initialIndex;
|
||||||
AlertDialog.Builder builder =
|
AlertDialog.Builder builder =
|
||||||
new AlertDialog.Builder(emulationActivity)
|
new AlertDialog.Builder(emulationActivity)
|
||||||
.setTitle(config.title.isEmpty()
|
.setTitle(config.title.isEmpty()
|
||||||
? emulationActivity.getString(R.string.mii_selector)
|
? emulationActivity.getString(R.string.mii_selector)
|
||||||
: config.title)
|
: config.title)
|
||||||
.setSingleChoiceItems(list.toArray(new String[] {}), initialIndex,
|
.setSingleChoiceItems(list.toArray(new String[]{}), initialIndex,
|
||||||
(dialog, which) -> { data.index = which; })
|
(dialog, which) -> {
|
||||||
.setPositiveButton(android.R.string.ok, (dialog, which) -> {
|
data.index = which;
|
||||||
data.return_code = 0;
|
})
|
||||||
synchronized (finishLock) {
|
.setPositiveButton(android.R.string.ok, (dialog, which) -> {
|
||||||
finishLock.notifyAll();
|
data.return_code = 0;
|
||||||
}
|
synchronized (finishLock) {
|
||||||
});
|
finishLock.notifyAll();
|
||||||
|
}
|
||||||
|
});
|
||||||
if (config.enable_cancel_button) {
|
if (config.enable_cancel_button) {
|
||||||
builder.setNegativeButton(android.R.string.cancel, (dialog, which) -> {
|
builder.setNegativeButton(android.R.string.cancel, (dialog, which) -> {
|
||||||
data.return_code = 1;
|
data.return_code = 1;
|
||||||
|
@ -60,7 +60,8 @@ public final class SoftwareKeyboard {
|
|||||||
public int max_text_length;
|
public int max_text_length;
|
||||||
public boolean multiline_mode; /// True if the keyboard accepts multiple lines of input
|
public boolean multiline_mode; /// True if the keyboard accepts multiple lines of input
|
||||||
public String hint_text; /// Displayed in the field as a hint before
|
public String hint_text; /// Displayed in the field as a hint before
|
||||||
@Nullable public String[] button_text; /// Contains the button text that the caller provides
|
@Nullable
|
||||||
|
public String[] button_text; /// Contains the button text that the caller provides
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Corresponds to Frontend::KeyboardData
|
/// Corresponds to Frontend::KeyboardData
|
||||||
@ -79,8 +80,8 @@ public final class SoftwareKeyboard {
|
|||||||
public CharSequence filter(CharSequence source, int start, int end, Spanned dest,
|
public CharSequence filter(CharSequence source, int start, int end, Spanned dest,
|
||||||
int dstart, int dend) {
|
int dstart, int dend) {
|
||||||
String text = new StringBuilder(dest)
|
String text = new StringBuilder(dest)
|
||||||
.replace(dstart, dend, source.subSequence(start, end).toString())
|
.replace(dstart, dend, source.subSequence(start, end).toString())
|
||||||
.toString();
|
.toString();
|
||||||
if (ValidateFilters(text) == ValidationError.None) {
|
if (ValidateFilters(text) == ValidationError.None) {
|
||||||
return null; // Accept replacement
|
return null; // Accept replacement
|
||||||
}
|
}
|
||||||
@ -104,52 +105,52 @@ public final class SoftwareKeyboard {
|
|||||||
assert emulationActivity != null;
|
assert emulationActivity != null;
|
||||||
|
|
||||||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
|
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
|
||||||
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
params.leftMargin = params.rightMargin =
|
params.leftMargin = params.rightMargin =
|
||||||
CitraApplication.getAppContext().getResources().getDimensionPixelSize(
|
CitraApplication.getAppContext().getResources().getDimensionPixelSize(
|
||||||
R.dimen.dialog_margin);
|
R.dimen.dialog_margin);
|
||||||
|
|
||||||
KeyboardConfig config = Objects.requireNonNull(
|
KeyboardConfig config = Objects.requireNonNull(
|
||||||
(KeyboardConfig)Objects.requireNonNull(getArguments()).getSerializable("config"));
|
(KeyboardConfig) Objects.requireNonNull(getArguments()).getSerializable("config"));
|
||||||
|
|
||||||
// Set up the input
|
// Set up the input
|
||||||
EditText editText = new EditText(CitraApplication.getAppContext());
|
EditText editText = new EditText(CitraApplication.getAppContext());
|
||||||
editText.setHint(config.hint_text);
|
editText.setHint(config.hint_text);
|
||||||
editText.setSingleLine(!config.multiline_mode);
|
editText.setSingleLine(!config.multiline_mode);
|
||||||
editText.setLayoutParams(params);
|
editText.setLayoutParams(params);
|
||||||
editText.setFilters(new InputFilter[] {
|
editText.setFilters(new InputFilter[]{
|
||||||
new Filter(), new InputFilter.LengthFilter(config.max_text_length)});
|
new Filter(), new InputFilter.LengthFilter(config.max_text_length)});
|
||||||
|
|
||||||
FrameLayout container = new FrameLayout(emulationActivity);
|
FrameLayout container = new FrameLayout(emulationActivity);
|
||||||
container.addView(editText);
|
container.addView(editText);
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(emulationActivity)
|
AlertDialog.Builder builder = new AlertDialog.Builder(emulationActivity)
|
||||||
.setTitle(R.string.software_keyboard)
|
.setTitle(R.string.software_keyboard)
|
||||||
.setView(container);
|
.setView(container);
|
||||||
setCancelable(false);
|
setCancelable(false);
|
||||||
|
|
||||||
switch (config.button_config) {
|
switch (config.button_config) {
|
||||||
case ButtonConfig.Triple: {
|
case ButtonConfig.Triple: {
|
||||||
final String text = config.button_text == null
|
final String text = config.button_text == null
|
||||||
? emulationActivity.getString(R.string.i_forgot)
|
? emulationActivity.getString(R.string.i_forgot)
|
||||||
: config.button_text[1];
|
: config.button_text[1];
|
||||||
builder.setNeutralButton(text, null);
|
builder.setNeutralButton(text, null);
|
||||||
}
|
}
|
||||||
// fallthrough
|
// fallthrough
|
||||||
case ButtonConfig.Dual: {
|
case ButtonConfig.Dual: {
|
||||||
final String text = config.button_text == null
|
final String text = config.button_text == null
|
||||||
? emulationActivity.getString(android.R.string.cancel)
|
? emulationActivity.getString(android.R.string.cancel)
|
||||||
: config.button_text[0];
|
: config.button_text[0];
|
||||||
builder.setNegativeButton(text, null);
|
builder.setNegativeButton(text, null);
|
||||||
}
|
}
|
||||||
// fallthrough
|
// fallthrough
|
||||||
case ButtonConfig.Single: {
|
case ButtonConfig.Single: {
|
||||||
final String text = config.button_text == null
|
final String text = config.button_text == null
|
||||||
? emulationActivity.getString(android.R.string.ok)
|
? emulationActivity.getString(android.R.string.ok)
|
||||||
: config.button_text[config.button_config];
|
: config.button_text[config.button_config];
|
||||||
builder.setPositiveButton(text, null);
|
builder.setPositiveButton(text, null);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final AlertDialog dialog = builder.create();
|
final AlertDialog dialog = builder.create();
|
||||||
@ -210,27 +211,27 @@ public final class SoftwareKeyboard {
|
|||||||
final EmulationActivity emulationActivity = NativeLibrary.sEmulationActivity.get();
|
final EmulationActivity emulationActivity = NativeLibrary.sEmulationActivity.get();
|
||||||
String message = "";
|
String message = "";
|
||||||
switch (error) {
|
switch (error) {
|
||||||
case FixedLengthRequired:
|
case FixedLengthRequired:
|
||||||
message =
|
message =
|
||||||
emulationActivity.getString(R.string.fixed_length_required, config.max_text_length);
|
emulationActivity.getString(R.string.fixed_length_required, config.max_text_length);
|
||||||
break;
|
break;
|
||||||
case MaxLengthExceeded:
|
case MaxLengthExceeded:
|
||||||
message =
|
message =
|
||||||
emulationActivity.getString(R.string.max_length_exceeded, config.max_text_length);
|
emulationActivity.getString(R.string.max_length_exceeded, config.max_text_length);
|
||||||
break;
|
break;
|
||||||
case BlankInputNotAllowed:
|
case BlankInputNotAllowed:
|
||||||
message = emulationActivity.getString(R.string.blank_input_not_allowed);
|
message = emulationActivity.getString(R.string.blank_input_not_allowed);
|
||||||
break;
|
break;
|
||||||
case EmptyInputNotAllowed:
|
case EmptyInputNotAllowed:
|
||||||
message = emulationActivity.getString(R.string.empty_input_not_allowed);
|
message = emulationActivity.getString(R.string.empty_input_not_allowed);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
new AlertDialog.Builder(emulationActivity)
|
new AlertDialog.Builder(emulationActivity)
|
||||||
.setTitle(R.string.software_keyboard)
|
.setTitle(R.string.software_keyboard)
|
||||||
.setMessage(message)
|
.setMessage(message)
|
||||||
.setPositiveButton(android.R.string.ok, null)
|
.setPositiveButton(android.R.string.ok, null)
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static KeyboardData Execute(KeyboardConfig config) {
|
public static KeyboardData Execute(KeyboardConfig config) {
|
||||||
@ -253,10 +254,11 @@ public final class SoftwareKeyboard {
|
|||||||
|
|
||||||
public static void ShowError(String error) {
|
public static void ShowError(String error) {
|
||||||
NativeLibrary.displayAlertMsg(
|
NativeLibrary.displayAlertMsg(
|
||||||
CitraApplication.getAppContext().getResources().getString(R.string.software_keyboard),
|
CitraApplication.getAppContext().getResources().getString(R.string.software_keyboard),
|
||||||
error, false);
|
error, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static native ValidationError ValidateFilters(String text);
|
private static native ValidationError ValidateFilters(String text);
|
||||||
|
|
||||||
private static native ValidationError ValidateInput(String text);
|
private static native ValidationError ValidateInput(String text);
|
||||||
}
|
}
|
||||||
|
@ -19,10 +19,12 @@ import androidx.annotation.Nullable;
|
|||||||
public final class StillImageCameraHelper {
|
public final class StillImageCameraHelper {
|
||||||
public static final int REQUEST_CAMERA_FILE_PICKER = 1;
|
public static final int REQUEST_CAMERA_FILE_PICKER = 1;
|
||||||
private static final Object filePickerLock = new Object();
|
private static final Object filePickerLock = new Object();
|
||||||
private static @Nullable String filePickerPath;
|
private static @Nullable
|
||||||
|
String filePickerPath;
|
||||||
|
|
||||||
// Opens file picker for camera.
|
// Opens file picker for camera.
|
||||||
public static @Nullable String OpenFilePicker() {
|
public static @Nullable
|
||||||
|
String OpenFilePicker() {
|
||||||
final EmulationActivity emulationActivity = NativeLibrary.sEmulationActivity.get();
|
final EmulationActivity emulationActivity = NativeLibrary.sEmulationActivity.get();
|
||||||
|
|
||||||
// At this point, we are assuming that we already have permissions as they are
|
// At this point, we are assuming that we already have permissions as they are
|
||||||
@ -31,9 +33,9 @@ public final class StillImageCameraHelper {
|
|||||||
Intent intent = new Intent(Intent.ACTION_PICK);
|
Intent intent = new Intent(Intent.ACTION_PICK);
|
||||||
intent.setDataAndType(MediaStore.Images.Media.INTERNAL_CONTENT_URI, "image/*");
|
intent.setDataAndType(MediaStore.Images.Media.INTERNAL_CONTENT_URI, "image/*");
|
||||||
emulationActivity.startActivityForResult(
|
emulationActivity.startActivityForResult(
|
||||||
Intent.createChooser(intent,
|
Intent.createChooser(intent,
|
||||||
emulationActivity.getString(R.string.camera_select_image)),
|
emulationActivity.getString(R.string.camera_select_image)),
|
||||||
REQUEST_CAMERA_FILE_PICKER);
|
REQUEST_CAMERA_FILE_PICKER);
|
||||||
});
|
});
|
||||||
|
|
||||||
synchronized (filePickerLock) {
|
synchronized (filePickerLock) {
|
||||||
|
@ -3,98 +3,80 @@ package org.citra.citra_emu.features.settings.model.view;
|
|||||||
import org.citra.citra_emu.features.settings.model.Setting;
|
import org.citra.citra_emu.features.settings.model.Setting;
|
||||||
import org.citra.citra_emu.features.settings.model.StringSetting;
|
import org.citra.citra_emu.features.settings.model.StringSetting;
|
||||||
|
|
||||||
public class StringSingleChoiceSetting extends SettingsItem
|
public class StringSingleChoiceSetting extends SettingsItem {
|
||||||
{
|
private String mDefaultValue;
|
||||||
private String mDefaultValue;
|
|
||||||
|
|
||||||
private String[] mChoicesId;
|
private String[] mChoicesId;
|
||||||
private String[] mValuesId;
|
private String[] mValuesId;
|
||||||
|
|
||||||
public StringSingleChoiceSetting(String key, String section, int titleId, int descriptionId,
|
public StringSingleChoiceSetting(String key, String section, int titleId, int descriptionId,
|
||||||
String[] choicesId, String[] valuesId, String defaultValue, Setting setting)
|
String[] choicesId, String[] valuesId, String defaultValue, Setting setting) {
|
||||||
{
|
super(key, section, setting, titleId, descriptionId);
|
||||||
super(key, section, setting, titleId, descriptionId);
|
mValuesId = valuesId;
|
||||||
mValuesId = valuesId;
|
mChoicesId = choicesId;
|
||||||
mChoicesId = choicesId;
|
mDefaultValue = defaultValue;
|
||||||
mDefaultValue = defaultValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String[] getChoicesId()
|
|
||||||
{
|
|
||||||
return mChoicesId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String[] getValuesId()
|
|
||||||
{
|
|
||||||
return mValuesId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValueAt(int index)
|
|
||||||
{
|
|
||||||
if (mValuesId == null)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
if (index >= 0 && index < mValuesId.length)
|
|
||||||
{
|
|
||||||
return mValuesId[index];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
public String[] getChoicesId() {
|
||||||
}
|
return mChoicesId;
|
||||||
|
|
||||||
public String getSelectedValue()
|
|
||||||
{
|
|
||||||
if (getSetting() != null)
|
|
||||||
{
|
|
||||||
StringSetting setting = (StringSetting) getSetting();
|
|
||||||
return setting.getValue();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return mDefaultValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSelectValueIndex()
|
|
||||||
{
|
|
||||||
String selectedValue = getSelectedValue();
|
|
||||||
for (int i = 0; i < mValuesId.length; i++)
|
|
||||||
{
|
|
||||||
if (mValuesId[i].equals(selectedValue))
|
|
||||||
{
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
public String[] getValuesId() {
|
||||||
}
|
return mValuesId;
|
||||||
|
|
||||||
/**
|
|
||||||
* Write a value to the backing int. If that int was previously null,
|
|
||||||
* initializes a new one and returns it, so it can be added to the Hashmap.
|
|
||||||
*
|
|
||||||
* @param selection New value of the int.
|
|
||||||
* @return null if overwritten successfully otherwise; a newly created IntSetting.
|
|
||||||
*/
|
|
||||||
public StringSetting setSelectedValue(String selection)
|
|
||||||
{
|
|
||||||
if (getSetting() == null)
|
|
||||||
{
|
|
||||||
StringSetting setting = new StringSetting(getKey(), getSection(), selection);
|
|
||||||
setSetting(setting);
|
|
||||||
return setting;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
StringSetting setting = (StringSetting) getSetting();
|
|
||||||
setting.setValue(selection);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public String getValueAt(int index) {
|
||||||
public int getType()
|
if (mValuesId == null)
|
||||||
{
|
return null;
|
||||||
return TYPE_STRING_SINGLE_CHOICE;
|
|
||||||
}
|
if (index >= 0 && index < mValuesId.length) {
|
||||||
|
return mValuesId[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSelectedValue() {
|
||||||
|
if (getSetting() != null) {
|
||||||
|
StringSetting setting = (StringSetting) getSetting();
|
||||||
|
return setting.getValue();
|
||||||
|
} else {
|
||||||
|
return mDefaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSelectValueIndex() {
|
||||||
|
String selectedValue = getSelectedValue();
|
||||||
|
for (int i = 0; i < mValuesId.length; i++) {
|
||||||
|
if (mValuesId[i].equals(selectedValue)) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write a value to the backing int. If that int was previously null,
|
||||||
|
* initializes a new one and returns it, so it can be added to the Hashmap.
|
||||||
|
*
|
||||||
|
* @param selection New value of the int.
|
||||||
|
* @return null if overwritten successfully otherwise; a newly created IntSetting.
|
||||||
|
*/
|
||||||
|
public StringSetting setSelectedValue(String selection) {
|
||||||
|
if (getSetting() == null) {
|
||||||
|
StringSetting setting = new StringSetting(getKey(), getSection(), selection);
|
||||||
|
setSetting(setting);
|
||||||
|
return setting;
|
||||||
|
} else {
|
||||||
|
StringSetting setting = (StringSetting) getSetting();
|
||||||
|
setting.setValue(selection);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getType() {
|
||||||
|
return TYPE_STRING_SINGLE_CHOICE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import android.content.IntentFilter;
|
|||||||
|
|
||||||
import org.citra.citra_emu.features.settings.model.Settings;
|
import org.citra.citra_emu.features.settings.model.Settings;
|
||||||
import org.citra.citra_emu.utils.DirectoryStateReceiver;
|
import org.citra.citra_emu.utils.DirectoryStateReceiver;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstraction for the Activity that manages SettingsFragments.
|
* Abstraction for the Activity that manages SettingsFragments.
|
||||||
*/
|
*/
|
||||||
|
@ -30,7 +30,7 @@ public class PicassoRoundedCornersTransformation implements Transformation {
|
|||||||
paint.setAntiAlias(true);
|
paint.setAntiAlias(true);
|
||||||
paint.setShader(shader);
|
paint.setShader(shader);
|
||||||
|
|
||||||
canvas.drawRoundRect(new RectF(rect), 10,10, paint);
|
canvas.drawRoundRect(new RectF(rect), 10, 10, paint);
|
||||||
|
|
||||||
squaredBitmap.recycle();
|
squaredBitmap.recycle();
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ import androidx.annotation.Nullable;
|
|||||||
|
|
||||||
public class PicassoUtils {
|
public class PicassoUtils {
|
||||||
private static boolean mPicassoInitialized = false;
|
private static boolean mPicassoInitialized = false;
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
if (mPicassoInitialized) {
|
if (mPicassoInitialized) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user