diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-10-09 22:07:01 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-10-09 22:07:01 -0700 |
commit | 3d02b3afc08a95c91045c28f9038da1b1560919e (patch) | |
tree | 0dcdc121070dba93fdb6177865013db8ce4b163a /src/github | |
parent | f776d7aca0e1a2ddd01c3c5d7c727157d379f8cf (diff) | |
download | dsub-3d02b3afc08a95c91045c28f9038da1b1560919e.tar.gz dsub-3d02b3afc08a95c91045c28f9038da1b1560919e.tar.bz2 dsub-3d02b3afc08a95c91045c28f9038da1b1560919e.zip |
Closes #125 Break preferences into groups
Diffstat (limited to 'src/github')
-rw-r--r-- | src/github/daneren2005/dsub/activity/SettingsActivity.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/github/daneren2005/dsub/activity/SettingsActivity.java b/src/github/daneren2005/dsub/activity/SettingsActivity.java index 06a99ce6..12ee7694 100644 --- a/src/github/daneren2005/dsub/activity/SettingsActivity.java +++ b/src/github/daneren2005/dsub/activity/SettingsActivity.java @@ -98,8 +98,8 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer tempLoss = (ListPreference) findPreference(Constants.PREFERENCES_KEY_TEMP_LOSS); pauseDisconnect = (ListPreference) findPreference(Constants.PREFERENCES_KEY_PAUSE_DISCONNECT); bufferLength = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_BUFFER_LENGTH); - addServerPreference = (Preference) findPreference(Constants.PREFERENCES_KEY_SERVER_ADD); serversCategory = (PreferenceCategory) findPreference(Constants.PREFERENCES_KEY_SERVER_KEY); + addServerPreference = (Preference) findPreference(Constants.PREFERENCES_KEY_SERVER_ADD); chatRefreshRate = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_CHAT_REFRESH); videoPlayer = (ListPreference) findPreference(Constants.PREFERENCES_KEY_VIDEO_PLAYER); @@ -143,7 +143,7 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer return false; } }); - + addServerPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { @@ -151,9 +151,7 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer String instance = String.valueOf(serverCount); Preference addServerPreference = findPreference(Constants.PREFERENCES_KEY_SERVER_ADD); - serversCategory.removePreference(addServerPreference); serversCategory.addPreference(addServer(serverCount)); - serversCategory.addPreference(addServerPreference); SharedPreferences.Editor editor = settings.edit(); editor.putInt(Constants.PREFERENCES_KEY_SERVER_COUNT, serverCount); @@ -165,13 +163,12 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer } }); - serversCategory.removePreference(addServerPreference); + serversCategory.setOrderingAsAdded(false); for (int i = 1; i <= serverCount; i++) { String instance = String.valueOf(i); serversCategory.addPreference(addServer(i)); serverSettings.put(instance, new ServerSettings(instance)); } - serversCategory.addPreference(addServerPreference); SharedPreferences prefs = Util.getPreferences(this); prefs.registerOnSharedPreferenceChangeListener(this); @@ -359,6 +356,8 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer screen.addPreference(serverTestConnectionPreference); screen.addPreference(serverOpenBrowser); + screen.setOrder(instance); + return screen; } |