Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Rewrite settings UI. #3547

Merged
merged 6 commits into from Jan 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Source/Android/app/src/arm_64/res/values/arrays.xml
Expand Up @@ -9,10 +9,10 @@
<item>@string/cached_interpreter</item>
<item>@string/jit_arm64_recompiler</item>
</string-array>
<string-array name="int_emu_cores" translatable="false">
<integer-array name="int_emu_cores" translatable="false">
<item>0</item>
<item>5</item>
<item>4</item>
</string-array>
</integer-array>

</resources>
6 changes: 2 additions & 4 deletions Source/Android/app/src/main/AndroidManifest.xml
Expand Up @@ -56,9 +56,9 @@
android:label="@string/add_directory_title"/>

<activity
android:name=".activities.SettingsActivity"
android:name=".ui.settings.SettingsActivity"
android:theme="@style/DolphinSettingsGamecube"
android:label="@string/grid_menu_settings"/>
android:label="@string/grid_menu_core_settings"/>

<activity
android:name=".activities.EmulationActivity"
Expand All @@ -71,8 +71,6 @@

<service android:name=".services.AssetCopyService"/>

<service android:name=".services.SettingsSaveService"/>

<provider
android:name=".model.GameProvider"
android:authorities="${applicationId}.provider"
Expand Down

This file was deleted.

This file was deleted.

@@ -0,0 +1,28 @@
package org.dolphinemu.dolphinemu.model.settings;

public final class BooleanSetting extends Setting
{
private boolean mValue;

public BooleanSetting(String key, String section, boolean value)
{
super(key, section);
mValue = value;
}

public boolean getValue()
{
return mValue;
}

public void setValue(boolean value)
{
mValue = value;
}

@Override
public String getValueAsString()
{
return mValue ? "True" : "False";
}
}
@@ -0,0 +1,28 @@
package org.dolphinemu.dolphinemu.model.settings;

public final class FloatSetting extends Setting
{
private float mValue;

public FloatSetting(String key, String section, float value)
{
super(key, section);
mValue = value;
}

public float getValue()
{
return mValue;
}

public void setValue(float value)
{
mValue = value;
}

@Override
public String getValueAsString()
{
return Float.toString(mValue);
}
}
@@ -0,0 +1,28 @@
package org.dolphinemu.dolphinemu.model.settings;

public final class IntSetting extends Setting
{
private int mValue;

public IntSetting(String key, String section, int value)
{
super(key, section);
mValue = value;
}

public int getValue()
{
return mValue;
}

public void setValue(int value)
{
mValue = value;
}

@Override
public String getValueAsString()
{
return Integer.toString(mValue);
}
}
@@ -0,0 +1,48 @@
package org.dolphinemu.dolphinemu.model.settings;

/**
* Abstraction for a setting item as read from / written to Dolphin's configuration ini files.
* These files generally consist of a key/value pair, though the type of value is ambiguous and
* must be inferred at read-time. The type of value determines which child of this class is used
* to represent the Setting.
*/
public abstract class Setting

This comment was marked as off-topic.

{
private String mKey;
private String mSection;

/**
* Base constructor.
*
* @param key Everything to the left of the = in a line from the ini file.
* @param section The corresponding recent section header; e.g. [Core] or [Enhancements] without the brackets.
*/
public Setting(String key, String section)
{
mKey = key;
mSection = section;
}

/**
*
* @return The identifier used to write this setting to the ini file.
*/
public String getKey()
{
return mKey;
}

/**
*
* @return The name of the header under which this Setting should be written in the ini file.
*/
public String getSection()
{
return mSection;
}

/**
* @return A representation of this Setting's backing value converted to a String (e.g. for serialization).
*/
public abstract String getValueAsString();
}