aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-09-27 19:06:32 -0700
committerScott Jackson <daneren2005@gmail.com>2014-09-27 19:06:32 -0700
commit63b6233888e384a62017825d1e907386b5d2e89b (patch)
tree9bc931667d81f9634510a6f6b2299cb8645bc89c /src/github/daneren2005
parentd77b2b14ebf6532b7b0e42e9d2219ea1dacbdb18 (diff)
downloaddsub-63b6233888e384a62017825d1e907386b5d2e89b.tar.gz
dsub-63b6233888e384a62017825d1e907386b5d2e89b.tar.bz2
dsub-63b6233888e384a62017825d1e907386b5d2e89b.zip
#241 Convert several preferences to SeekBarPreference
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/activity/SettingsActivity.java9
-rw-r--r--src/github/daneren2005/dsub/view/SeekBarPreference.java4
2 files changed, 3 insertions, 10 deletions
diff --git a/src/github/daneren2005/dsub/activity/SettingsActivity.java b/src/github/daneren2005/dsub/activity/SettingsActivity.java
index 5ca30f62..c1618b7d 100644
--- a/src/github/daneren2005/dsub/activity/SettingsActivity.java
+++ b/src/github/daneren2005/dsub/activity/SettingsActivity.java
@@ -69,16 +69,13 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
private ListPreference maxVideoBitrateWifi;
private ListPreference maxVideoBitrateMobile;
private ListPreference networkTimeout;
- private EditTextPreference cacheSize;
private EditTextPreference cacheLocation;
private ListPreference preloadCountWifi;
private ListPreference preloadCountMobile;
- private EditTextPreference randomSize;
private ListPreference tempLoss;
private ListPreference pauseDisconnect;
private Preference addServerPreference;
private PreferenceCategory serversCategory;
- private EditTextPreference chatRefreshRate;
private ListPreference videoPlayer;
private ListPreference syncInterval;
private CheckBoxPreference syncEnabled;
@@ -113,16 +110,13 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
maxVideoBitrateWifi = (ListPreference) findPreference(Constants.PREFERENCES_KEY_MAX_VIDEO_BITRATE_WIFI);
maxVideoBitrateMobile = (ListPreference) findPreference(Constants.PREFERENCES_KEY_MAX_VIDEO_BITRATE_MOBILE);
networkTimeout = (ListPreference) findPreference(Constants.PREFERENCES_KEY_NETWORK_TIMEOUT);
- cacheSize = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_CACHE_SIZE);
cacheLocation = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_CACHE_LOCATION);
preloadCountWifi = (ListPreference) findPreference(Constants.PREFERENCES_KEY_PRELOAD_COUNT_WIFI);
preloadCountMobile = (ListPreference) findPreference(Constants.PREFERENCES_KEY_PRELOAD_COUNT_MOBILE);
- randomSize = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_RANDOM_SIZE);
tempLoss = (ListPreference) findPreference(Constants.PREFERENCES_KEY_TEMP_LOSS);
pauseDisconnect = (ListPreference) findPreference(Constants.PREFERENCES_KEY_PAUSE_DISCONNECT);
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);
syncInterval = (ListPreference) findPreference(Constants.PREFERENCES_KEY_SYNC_INTERVAL);
syncEnabled = (CheckBoxPreference) findPreference(Constants.PREFERENCES_KEY_SYNC_ENABLED);
@@ -310,14 +304,11 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
maxVideoBitrateWifi.setSummary(maxVideoBitrateWifi.getEntry());
maxVideoBitrateMobile.setSummary(maxVideoBitrateMobile.getEntry());
networkTimeout.setSummary(networkTimeout.getEntry());
- cacheSize.setSummary(cacheSize.getText());
cacheLocation.setSummary(cacheLocation.getText());
preloadCountWifi.setSummary(preloadCountWifi.getEntry());
preloadCountMobile.setSummary(preloadCountMobile.getEntry());
- randomSize.setSummary(randomSize.getText());
tempLoss.setSummary(tempLoss.getEntry());
pauseDisconnect.setSummary(pauseDisconnect.getEntry());
- chatRefreshRate.setSummary(chatRefreshRate.getText());
videoPlayer.setSummary(videoPlayer.getEntry());
syncInterval.setSummary(syncInterval.getEntry());
if(syncEnabled.isChecked()) {
diff --git a/src/github/daneren2005/dsub/view/SeekBarPreference.java b/src/github/daneren2005/dsub/view/SeekBarPreference.java
index 84aed452..dedea908 100644
--- a/src/github/daneren2005/dsub/view/SeekBarPreference.java
+++ b/src/github/daneren2005/dsub/view/SeekBarPreference.java
@@ -26,6 +26,7 @@ import android.content.Context;
import android.content.res.TypedArray;
import android.preference.DialogPreference;
import android.util.AttributeSet;
+import android.util.Log;
import android.view.View;
import android.widget.SeekBar;
import android.widget.TextView;
@@ -37,6 +38,7 @@ import github.daneren2005.dsub.util.Constants;
* SeekBar preference to set the shake force threshold.
*/
public class SeekBarPreference extends DialogPreference implements SeekBar.OnSeekBarChangeListener {
+ private static final String TAG = SeekBarPreference.class.getSimpleName();
/**
* The current value.
*/
@@ -67,7 +69,7 @@ public class SeekBarPreference extends DialogPreference implements SeekBar.OnSee
mStepSize = a.getFloat(R.styleable.SeekBarPreference_stepSize, 1f);
mDisplay = a.getString(R.styleable.SeekBarPreference_display);
if(mDisplay == null) {
- mDisplay = "%+.1f";
+ mDisplay = "%.0f";
}
}