FM: add Indonesia
Use a new id so that old values aren't changed
Looked into reordering the list but the index is used
in a few places - going to skip on that change for now
Change-Id: Ib70634d28588ce23a37fcc7b760019c07af3412f
Move Indonesia entries to arrays
* Since we can fully manage this array in crowdin, let's keep all entries in the array
* It's less confusing for the translators since they see all the entries grouped in 1 file
Change-Id: I78c91550b49391ab4f3c109d334d8ba68d11bed7
diff --git a/fmapp2/res/values/arrays.xml b/fmapp2/res/values/arrays.xml
index 24eb383..9b31e7e 100644
--- a/fmapp2/res/values/arrays.xml
+++ b/fmapp2/res/values/arrays.xml
@@ -236,6 +236,7 @@
<item>United Kingdom</item>
<item>United States</item>
<item>User defined band</item>
+ <item>Indonesia</item>
</string-array>
<string-array name="regional_band_values" translatable="false">
@@ -276,6 +277,7 @@
<item>34</item>
<item>35</item>
<item>36</item>
+ <item>37</item>
</string-array>
<string-array name="regional_band_summary">
@@ -316,6 +318,7 @@
<item>United Kingdom (87.5MHz to 108.0MHz in 100 KHz steps)</item>
<item>United States (88.1MHz to 107.9MHz in 200 KHz steps)</item>
<item>User defined band</item>
+ <item>Indonesia (87.5MHz to 108.0MHz in 100 KHz steps)</item>
</string-array>
<string-array name="channel_spacing_val" translatable="false">
diff --git a/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java b/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java
index fac6a2f..c47abe0 100644
--- a/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java
+++ b/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java
@@ -81,6 +81,7 @@
public static final int REGIONAL_BAND_UNITEDKINGDOM = 34;
public static final int REGIONAL_BAND_UNITED_STATES = 35;
public static final int REGIONAL_BAND_USER_DEFINED = 36;
+ public static final int REGIONAL_BAND_INDONESIA = 37;
public static final int RECORD_DUR_INDEX_0_VAL = 5;
public static final int RECORD_DUR_INDEX_1_VAL = 15;
@@ -1093,6 +1094,14 @@
mFrequencyBand_Stepsize = 200;
break;
}
+ case REGIONAL_BAND_INDONESIA:
+ {
+ /*INDONESIA : 87500 TO 108000 IN 100 KHZ STEPS*/
+ mFMConfiguration.setLowerLimit(87500);
+ mFMConfiguration.setUpperLimit(108000);
+ mFrequencyBand_Stepsize = 100;
+ break;
+ }
case REGIONAL_BAND_USER_DEFINED:
{
mFMConfiguration.setRadioBand(FmReceiver.FM_USER_DEFINED_BAND);
diff --git a/fmapp2/src/com/caf/fmradio/Settings.java b/fmapp2/src/com/caf/fmradio/Settings.java
index 47ad5b7..78a63f7 100644
--- a/fmapp2/src/com/caf/fmradio/Settings.java
+++ b/fmapp2/src/com/caf/fmradio/Settings.java
@@ -277,7 +277,7 @@
if((index < 0) || (index >= summaryBandItems.length)) {
index = 0;
mBandPreference.setValueIndex(0);
- }else if((index + 1) == summaryBandItems.length) {
+ }else if(index == FmSharedPreferences.REGIONAL_BAND_USER_DEFINED) {
mChannelSpacingPref.setEnabled(true);
}else {
mChannelSpacingPref.setEnabled(false);
@@ -536,7 +536,7 @@
}
}
private void setBandSummary(int index) {
- if((index + 1) == summaryBandItems.length) {
+ if(index == FmSharedPreferences.REGIONAL_BAND_USER_DEFINED) {
min_freq = FmSharedPreferences.getLowerLimit();
max_freq = FmSharedPreferences.getUpperLimit();
chan_spacing = FmSharedPreferences.getChSpacing();