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);
|
||||
}
|
||||
|
||||
public static Context getAppContext()
|
||||
{
|
||||
public static Context getAppContext() {
|
||||
return application.getApplicationContext();
|
||||
}
|
||||
}
|
||||
|
@ -428,7 +428,8 @@ public final class NativeLibrary {
|
||||
synchronized (cameraPermissionLock) {
|
||||
try {
|
||||
cameraPermissionLock.wait();
|
||||
} catch (InterruptedException ignored) {}
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
}
|
||||
return cameraPermissionGranted;
|
||||
}
|
||||
|
@ -75,7 +75,9 @@ public final class MiiSelector {
|
||||
? emulationActivity.getString(R.string.mii_selector)
|
||||
: config.title)
|
||||
.setSingleChoiceItems(list.toArray(new String[]{}), initialIndex,
|
||||
(dialog, which) -> { data.index = which; })
|
||||
(dialog, which) -> {
|
||||
data.index = which;
|
||||
})
|
||||
.setPositiveButton(android.R.string.ok, (dialog, which) -> {
|
||||
data.return_code = 0;
|
||||
synchronized (finishLock) {
|
||||
|
@ -60,7 +60,8 @@ public final class SoftwareKeyboard {
|
||||
public int max_text_length;
|
||||
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
|
||||
@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
|
||||
@ -258,5 +259,6 @@ public final class SoftwareKeyboard {
|
||||
}
|
||||
|
||||
private static native ValidationError ValidateFilters(String text);
|
||||
|
||||
private static native ValidationError ValidateInput(String text);
|
||||
}
|
||||
|
@ -19,10 +19,12 @@ import androidx.annotation.Nullable;
|
||||
public final class StillImageCameraHelper {
|
||||
public static final int REQUEST_CAMERA_FILE_PICKER = 1;
|
||||
private static final Object filePickerLock = new Object();
|
||||
private static @Nullable String filePickerPath;
|
||||
private static @Nullable
|
||||
String filePickerPath;
|
||||
|
||||
// Opens file picker for camera.
|
||||
public static @Nullable String OpenFilePicker() {
|
||||
public static @Nullable
|
||||
String OpenFilePicker() {
|
||||
final EmulationActivity emulationActivity = NativeLibrary.sEmulationActivity.get();
|
||||
|
||||
// At this point, we are assuming that we already have permissions as they are
|
||||
|
@ -3,65 +3,52 @@ 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.StringSetting;
|
||||
|
||||
public class StringSingleChoiceSetting extends SettingsItem
|
||||
{
|
||||
public class StringSingleChoiceSetting extends SettingsItem {
|
||||
private String mDefaultValue;
|
||||
|
||||
private String[] mChoicesId;
|
||||
private String[] mValuesId;
|
||||
|
||||
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);
|
||||
mValuesId = valuesId;
|
||||
mChoicesId = choicesId;
|
||||
mDefaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public String[] getChoicesId()
|
||||
{
|
||||
public String[] getChoicesId() {
|
||||
return mChoicesId;
|
||||
}
|
||||
|
||||
public String[] getValuesId()
|
||||
{
|
||||
public String[] getValuesId() {
|
||||
return mValuesId;
|
||||
}
|
||||
|
||||
public String getValueAt(int index)
|
||||
{
|
||||
public String getValueAt(int index) {
|
||||
if (mValuesId == null)
|
||||
return null;
|
||||
|
||||
if (index >= 0 && index < mValuesId.length)
|
||||
{
|
||||
if (index >= 0 && index < mValuesId.length) {
|
||||
return mValuesId[index];
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getSelectedValue()
|
||||
{
|
||||
if (getSetting() != null)
|
||||
{
|
||||
public String getSelectedValue() {
|
||||
if (getSetting() != null) {
|
||||
StringSetting setting = (StringSetting) getSetting();
|
||||
return setting.getValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return mDefaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
public int getSelectValueIndex()
|
||||
{
|
||||
public int getSelectValueIndex() {
|
||||
String selectedValue = getSelectedValue();
|
||||
for (int i = 0; i < mValuesId.length; i++)
|
||||
{
|
||||
if (mValuesId[i].equals(selectedValue))
|
||||
{
|
||||
for (int i = 0; i < mValuesId.length; i++) {
|
||||
if (mValuesId[i].equals(selectedValue)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@ -76,16 +63,12 @@ public class StringSingleChoiceSetting extends SettingsItem
|
||||
* @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)
|
||||
{
|
||||
public StringSetting setSelectedValue(String selection) {
|
||||
if (getSetting() == null) {
|
||||
StringSetting setting = new StringSetting(getKey(), getSection(), selection);
|
||||
setSetting(setting);
|
||||
return setting;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
StringSetting setting = (StringSetting) getSetting();
|
||||
setting.setValue(selection);
|
||||
return null;
|
||||
@ -93,8 +76,7 @@ public class StringSingleChoiceSetting extends SettingsItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType()
|
||||
{
|
||||
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.utils.DirectoryStateReceiver;
|
||||
|
||||
/**
|
||||
* Abstraction for the Activity that manages SettingsFragments.
|
||||
*/
|
||||
|
@ -15,6 +15,7 @@ import androidx.annotation.Nullable;
|
||||
|
||||
public class PicassoUtils {
|
||||
private static boolean mPicassoInitialized = false;
|
||||
|
||||
public static void init() {
|
||||
if (mPicassoInitialized) {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user