FM: Fix settings UI bugs
Setting any user-defined parameter caused the band to switch
from user-defined to Indonesia. Fixed.
Also removed some bogus localization while I was there.
Issue-Id: CYNGNOS-778
Change-Id: I256f04eab39b820b33676bf598322d480d6dfa44
diff --git a/fmapp2/src/com/caf/fmradio/Settings.java b/fmapp2/src/com/caf/fmradio/Settings.java
index 78a63f7..4a7c304 100644
--- a/fmapp2/src/com/caf/fmradio/Settings.java
+++ b/fmapp2/src/com/caf/fmradio/Settings.java
@@ -145,6 +145,7 @@
mUserBandMinPref.getEditText().setInputType(InputType.TYPE_CLASS_NUMBER |
InputType.TYPE_NUMBER_FLAG_DECIMAL);
mUserBandMinPref.setDialogTitle(R.string.usr_def_band_min);
+ mUserBandMinPref.getEditText().setSelectAllOnFocus(true);
mUserBandMaxPref = new EditTextPreference(this);
mUserBandMaxPref.setKey(USER_DEFINED_BAND_MAX_KEY);
@@ -152,6 +153,7 @@
mUserBandMaxPref.setDialogTitle(R.string.usr_def_band_max);
mUserBandMaxPref.getEditText().setInputType(InputType.TYPE_CLASS_NUMBER |
InputType.TYPE_NUMBER_FLAG_DECIMAL);
+ mUserBandMaxPref.getEditText().setSelectAllOnFocus(true);
setBandSummary(index);
@@ -345,14 +347,10 @@
&& (noOfChannels > 0) && (band_width >= 100)) {
FmSharedPreferences.setLowerLimit((int)freq);
sendSettingsChangedIntent(FM_BAND_CHANGED);
- setBandSummary(summaryBandItems.length - 1);
+ setBandSummary(FmSharedPreferences.REGIONAL_BAND_USER_DEFINED);
clearStationList();
}else {
- if ((Locale.getDefault().toString().equals("zh_HK")))
- Toast.makeText(this,"請輸入有效的頻道範圍76.0-108.0",
- Toast.LENGTH_SHORT).show();
- else
- Toast.makeText(this, getString(R.string.user_defind_band_msg),
+ Toast.makeText(this, getString(R.string.user_defind_band_msg),
Toast.LENGTH_SHORT).show();
}
}else if(key.equals(USER_DEFINED_BAND_MAX_KEY)) {
@@ -373,14 +371,10 @@
&& (noOfChannels > 0) && (band_width >= 100)) {
FmSharedPreferences.setUpperLimit((int)freq);
sendSettingsChangedIntent(FM_BAND_CHANGED);
- setBandSummary(summaryBandItems.length - 1);
+ setBandSummary(FmSharedPreferences.REGIONAL_BAND_USER_DEFINED);
clearStationList();
}else {
- if ((Locale.getDefault().toString().equals("zh_HK")))
- Toast.makeText(this,"請輸入有效的頻道範圍76.0-108.0",
- Toast.LENGTH_SHORT).show();
- else
- Toast.makeText(this, getString(R.string.user_defind_band_msg),
+ Toast.makeText(this, getString(R.string.user_defind_band_msg),
Toast.LENGTH_SHORT).show();
}
}else {