diff options
-rw-r--r-- | android/jni/com/mapswithme/util/Config.cpp | 14 | ||||
-rw-r--r-- | android/res/values/donottranslate.xml | 1 | ||||
-rw-r--r-- | android/res/xml-v21/prefs_map.xml | 12 | ||||
-rw-r--r-- | android/res/xml/prefs_map.xml | 12 | ||||
-rw-r--r-- | android/src/com/mapswithme/maps/settings/MapPrefsFragment.java | 16 | ||||
-rw-r--r-- | android/src/com/mapswithme/util/Config.java | 12 |
6 files changed, 61 insertions, 6 deletions
diff --git a/android/jni/com/mapswithme/util/Config.cpp b/android/jni/com/mapswithme/util/Config.cpp index 3c40e73cd0..3adef42f87 100644 --- a/android/jni/com/mapswithme/util/Config.cpp +++ b/android/jni/com/mapswithme/util/Config.cpp @@ -102,4 +102,18 @@ extern "C" frm()->SaveLargeFontsSize(value); frm()->SetLargeFontsSize(value); } + + JNIEXPORT jboolean JNICALL + Java_com_mapswithme_util_Config_nativeGetTransliteration(JNIEnv * env, jclass thiz) + { + return frm()->LoadTransliteration(); + } + + JNIEXPORT void JNICALL + Java_com_mapswithme_util_Config_nativeSetTransliteration(JNIEnv * env, jclass thiz, + jboolean value) + { + frm()->SaveTransliteration(value); + frm()->AllowTransliteration(value); + } } // extern "C" diff --git a/android/res/values/donottranslate.xml b/android/res/values/donottranslate.xml index b0ad36d9d6..c5e5659d09 100644 --- a/android/res/values/donottranslate.xml +++ b/android/res/values/donottranslate.xml @@ -52,6 +52,7 @@ <string name="pref_large_fonts_size" translatable="false">LargeFontSize</string> <string name="pref_use_mobile_data" translatable="false">UseMobileData</string> <string name="pref_traffic_simplified_colors" translatable="false">TrafficSimplifiedColors</string> + <string name="pref_transliteration" translatable="false">Transliteration</string> <string name="notification_ticker_ltr" translatable="false">%1$s: %2$s</string> <string name="notification_ticker_rtl" translatable="false">%2$s :%1$s</string> diff --git a/android/res/xml-v21/prefs_map.xml b/android/res/xml-v21/prefs_map.xml index 1affa5f8a2..b5239ab1ec 100644 --- a/android/res/xml-v21/prefs_map.xml +++ b/android/res/xml-v21/prefs_map.xml @@ -46,16 +46,22 @@ android:order="6"/> <SwitchPreference + android:key="@string/pref_transliteration" + android:title="@string/whatsnew_transliteration_title" + android:defaultValue="false" + android:order="7"/> + + <SwitchPreference android:key="@string/pref_3d_buildings" android:title="@string/pref_map_3d_buildings_title" android:switchTextOn="" android:switchTextOff="" - android:order="7"/> + android:order="8"/> <ListPreference android:key="@string/pref_track_record" android:title="@string/pref_track_record_title" android:entries="@array/track_length" android:entryValues="@array/track_length_values" - android:order="8"/> -</PreferenceScreen>
\ No newline at end of file + android:order="9"/> +</PreferenceScreen> diff --git a/android/res/xml/prefs_map.xml b/android/res/xml/prefs_map.xml index ae014c6a23..55226489d9 100644 --- a/android/res/xml/prefs_map.xml +++ b/android/res/xml/prefs_map.xml @@ -40,14 +40,20 @@ android:order="6"/> <CheckBoxPreference + android:key="@string/pref_transliteration" + android:title="@string/whatsnew_transliteration_title" + android:defaultValue="false" + android:order="7"/> + + <CheckBoxPreference android:key="@string/pref_3d_buildings" android:title="@string/pref_map_3d_buildings_title" - android:order="7"/> + android:order="8"/> <ListPreference android:key="@string/pref_track_record" android:title="@string/pref_track_record_title" android:entries="@array/track_length" android:entryValues="@array/track_length_values" - android:order="8"/> -</PreferenceScreen>
\ No newline at end of file + android:order="9"/> +</PreferenceScreen> diff --git a/android/src/com/mapswithme/maps/settings/MapPrefsFragment.java b/android/src/com/mapswithme/maps/settings/MapPrefsFragment.java index 20fdea77cc..5d0ad57713 100644 --- a/android/src/com/mapswithme/maps/settings/MapPrefsFragment.java +++ b/android/src/com/mapswithme/maps/settings/MapPrefsFragment.java @@ -168,6 +168,22 @@ public class MapPrefsFragment extends BaseXmlSettingsFragment } }); + pref = findPreference(getString(R.string.pref_transliteration)); + ((TwoStatePreference)pref).setChecked(Config.isTransliteration()); + pref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() + { + @Override + public boolean onPreferenceChange(Preference preference, Object newValue) + { + boolean oldVal = Config.isTransliteration(); + boolean newVal = (Boolean) newValue; + if (oldVal != newVal) + Config.setTransliteration(newVal); + + return true; + } + }); + final Framework.Params3dMode _3d = new Framework.Params3dMode(); Framework.nativeGet3dMode(_3d); diff --git a/android/src/com/mapswithme/util/Config.java b/android/src/com/mapswithme/util/Config.java index 8a79cf60b9..0e8210e3da 100644 --- a/android/src/com/mapswithme/util/Config.java +++ b/android/src/com/mapswithme/util/Config.java @@ -413,6 +413,16 @@ public final class Config return getBool(KEY_MISC_USE_MOBILE_DATA_ROAMING, false); } + public static boolean isTransliteration() + { + return nativeGetTransliteration(); + } + + public static void setTransliteration(boolean value) + { + nativeSetTransliteration(value); + } + private static native boolean nativeGetBoolean(String name, boolean defaultValue); private static native void nativeSetBoolean(String name, boolean value); @@ -426,4 +436,6 @@ public final class Config private static native void nativeSetString(String name, String value); private static native boolean nativeGetLargeFontsSize(); private static native void nativeSetLargeFontsSize(boolean value); + private static native boolean nativeGetTransliteration(); + private static native void nativeSetTransliteration(boolean value); } |