Merge pull request from weihuoya/android-minor-fx

Android: some minor changes
This commit is contained in:
Anthony 2019-02-03 12:48:39 -08:00 committed by GitHub
commit b72b128076
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 23 additions and 30 deletions
Source/Android/app/src
androidTest/java/org/dolphinemu/dolphinemu
main

View File

@ -1,13 +0,0 @@
package org.dolphinemu.dolphinemu;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}

View File

@ -262,6 +262,9 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
SingleChoiceSetting scSetting = (SingleChoiceSetting) mClickedItem;
int value = getValueForSingleChoiceSelection(scSetting, which);
if (scSetting.getSelectedValue() != value)
mView.onSettingChanged();
MenuTag menuTag = scSetting.getMenuTag();
if (menuTag != null)
{
@ -313,6 +316,9 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
{
StringSingleChoiceSetting scSetting = (StringSingleChoiceSetting) mClickedItem;
String value = scSetting.getValueAt(which);
if (!scSetting.getSelectedValue().equals(value))
mView.onSettingChanged();
StringSetting setting = scSetting.setSelectedValue(value);
if (setting != null)
{
@ -324,6 +330,9 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
else if (mClickedItem instanceof SliderSetting)
{
SliderSetting sliderSetting = (SliderSetting) mClickedItem;
if (sliderSetting.getSelectedValue() != mSeekbarProgress)
mView.onSettingChanged();
if (sliderSetting.isPercentSetting() || sliderSetting.getSetting() instanceof FloatSetting)
{
float value;
@ -355,7 +364,6 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
closeDialog();
}
mView.onSettingChanged();
mClickedItem = null;
mSeekbarProgress = -1;
}

View File

@ -458,7 +458,7 @@ public final class SettingsFragmentPresenter
R.string.internal_resolution, R.string.internal_resolution_description,
R.array.internalResolutionEntries, R.array.internalResolutionValues, 1, resolution));
sl.add(new SingleChoiceSetting(SettingsFile.KEY_FSAA, Settings.SECTION_GFX_SETTINGS,
R.string.FSAA, R.string.FSAA_description, R.array.FSAAEntries, R.array.FSAAValues, 0,
R.string.FSAA, R.string.FSAA_description, R.array.FSAAEntries, R.array.FSAAValues, 1,
fsaa));
sl.add(new SingleChoiceSetting(SettingsFile.KEY_ANISOTROPY, Settings.SECTION_GFX_ENHANCEMENTS,
R.string.anisotropic_filtering, R.string.anisotropic_filtering_description,
@ -539,7 +539,7 @@ public final class SettingsFragmentPresenter
if (shaderFiles != null)
{
String[] result = new String[shaderFiles.length + 1];
result[0] = "Off";
result[0] = mView.getActivity().getString(R.string.off);
for (int i = 0; i < shaderFiles.length; i++)
{
String name = shaderFiles[i].getName();

View File

@ -1,6 +1,7 @@
package org.dolphinemu.dolphinemu.features.settings.utils;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import org.dolphinemu.dolphinemu.NativeLibrary;
import org.dolphinemu.dolphinemu.features.settings.model.BooleanSetting;
@ -720,9 +721,11 @@ public final class SettingsFile
for (String key : sortedKeySet)
{
Setting setting = settings.get(key);
String settingString = settingAsString(setting);
writer.println(settingString);
String valueAsString = setting.getValueAsString();
if (!TextUtils.isEmpty(valueAsString))
{
writer.println(setting.getKey() + " = " + valueAsString);
}
}
}
@ -731,11 +734,6 @@ public final class SettingsFile
return "[" + section.getName() + "]";
}
private static String settingAsString(Setting setting)
{
return setting.getKey() + " = " + setting.getValueAsString();
}
private static String customWiimoteExtSettingAsString(Setting setting)
{
return setting.getKey().substring(0, setting.getKey().length() - 1) + " = " +

View File

@ -6,10 +6,7 @@
<android.support.v7.widget.RecyclerView
android:id="@+id/list_settings"
android:background="@android:color/white"
android:elevation="@dimen/elevation_high"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginEnd="@dimen/activity_horizontal_margin"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</org.dolphinemu.dolphinemu.features.settings.ui.SettingsFrameLayout>
</org.dolphinemu.dolphinemu.features.settings.ui.SettingsFrameLayout>

View File

@ -143,14 +143,16 @@
<!-- FSAA Preference -->
<string-array name="FSAAEntries" translatable="false">
<item>1x</item>
<item>Off</item>
<item>2x</item>
<item>4x</item>
<item>8x</item>
</string-array>
<integer-array name="FSAAValues" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>4</item>
<item>8</item>
</integer-array>
<!-- Anisotropic Filtering Preference -->

View File

@ -251,6 +251,7 @@
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="ok">OK</string>
<string name="off">Off</string>
<string name="cancel">Cancel</string>
<string name="clear">Clear</string>
<string name="disabled">Disabled</string>