From 696167909182bc64f0d6107d422a01075b31e8a6 Mon Sep 17 00:00:00 2001 From: Christian Ascheberg Date: Sun, 23 Aug 2015 19:45:23 +0200 Subject: [PATCH 1/2] move unlimited zoom pref to settings --- .../subactivities/DeveloperActivity.java | 13 ------------- .../subactivities/PreferencesScreen.java | 12 ++++++++++-- .../res/layout/fragment_developer_options.xml | 18 +----------------- .../main/res/layout/stumbler_preferences.xml | 2 -- 4 files changed, 11 insertions(+), 34 deletions(-) diff --git a/android/src/main/java/org/mozilla/mozstumbler/client/subactivities/DeveloperActivity.java b/android/src/main/java/org/mozilla/mozstumbler/client/subactivities/DeveloperActivity.java index 5902ce233..744a62325 100644 --- a/android/src/main/java/org/mozilla/mozstumbler/client/subactivities/DeveloperActivity.java +++ b/android/src/main/java/org/mozilla/mozstumbler/client/subactivities/DeveloperActivity.java @@ -123,7 +123,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa setupSimulationPreference(); setupLocationChangeSpinners(); setupMinPauseTime(); - setupLimitZoom(); setupPassiveMode(); return mRootView; } @@ -165,18 +164,6 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) { } - private void setupLimitZoom() { - boolean isLimited = ClientPrefs.getInstance(mRootView.getContext()).isMapZoomLimited(); - CheckBox button = (CheckBox) mRootView.findViewById(R.id.toggleLimitedMapZoom); - button.setChecked(isLimited); - button.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) { - ClientPrefs.getInstance(mRootView.getContext()).setIsMapZoomLimited(isChecked); - } - }); - } - private void setupPassiveMode() { boolean isPassive = ClientPrefs.getInstance(mRootView.getContext()).isScanningPassive(); CheckBox button = (CheckBox) mRootView.findViewById(R.id.togglePassiveScanning); diff --git a/android/src/main/java/org/mozilla/mozstumbler/client/subactivities/PreferencesScreen.java b/android/src/main/java/org/mozilla/mozstumbler/client/subactivities/PreferencesScreen.java index ebe78bb5a..685dbbcc2 100644 --- a/android/src/main/java/org/mozilla/mozstumbler/client/subactivities/PreferencesScreen.java +++ b/android/src/main/java/org/mozilla/mozstumbler/client/subactivities/PreferencesScreen.java @@ -8,7 +8,6 @@ import android.content.Context; import android.content.DialogInterface; import android.content.Intent; -import android.content.IntentFilter; import android.os.Build; import android.os.Bundle; import android.preference.CheckBoxPreference; @@ -18,7 +17,6 @@ import android.preference.Preference.OnPreferenceChangeListener; import android.preference.PreferenceActivity; import android.preference.PreferenceGroup; -import android.support.v4.content.LocalBroadcastManager; import android.text.TextUtils; import android.webkit.CookieManager; import android.webkit.CookieSyncManager; @@ -55,6 +53,7 @@ public class PreferencesScreen extends PreferenceActivity implements IFxACallbac private CheckBoxPreference mKeepScreenOn; private CheckBoxPreference mEnableShowMLSLocations; private CheckBoxPreference mCrashReportsOn; + private CheckBoxPreference mLimitMapZoom; private ListPreference mMapTileDetail; private Preference mFxaLoginPreference; @@ -91,6 +90,8 @@ protected void onCreate(Bundle savedInstanceState) { mMapTileDetail.setValueIndex(valueIndex); updateMapDetailTitle(valueIndex); + mLimitMapZoom = (CheckBoxPreference) getPreferenceManager().findPreference(ClientPrefs.IS_MAP_ZOOM_LIMITED); + setPreferenceListener(); setButtonListeners(); verifyBearerToken(); @@ -297,6 +298,13 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { return true; } }); + mLimitMapZoom.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { + @Override + public boolean onPreferenceChange(Preference preference, Object newValue) { + getPrefs().setIsMapZoomLimited(newValue.equals(true)); + return true; + } + }); } private boolean hasNetworkForFxA() { diff --git a/android/src/main/res/layout/fragment_developer_options.xml b/android/src/main/res/layout/fragment_developer_options.xml index dcc67f395..f45372382 100644 --- a/android/src/main/res/layout/fragment_developer_options.xml +++ b/android/src/main/res/layout/fragment_developer_options.xml @@ -37,27 +37,11 @@ android:layout_marginTop="10dp" android:background="#55ffffff" /> - - - - - From 6545298c3d9a3df6fc1afc60b19249945f9aa119 Mon Sep 17 00:00:00 2001 From: Christian Ascheberg Date: Fri, 28 Aug 2015 14:40:12 +0200 Subject: [PATCH 2/2] update unlimited zoom feature strings --- .../org/mozilla/mozstumbler/client/ClientPrefs.java | 10 +++++----- .../mozstumbler/client/mapview/MapFragment.java | 2 +- .../client/subactivities/PreferencesScreen.java | 8 ++++---- android/src/main/res/layout/stumbler_preferences.xml | 8 ++++---- android/src/main/res/values-de/strings.xml | 4 ++-- android/src/main/res/values-es/strings.xml | 4 ++-- android/src/main/res/values-pl/strings.xml | 4 ++-- android/src/main/res/values-tr/strings.xml | 4 ++-- android/src/main/res/values-zh-rTW/strings.xml | 4 ++-- android/src/main/res/values/strings.xml | 4 ++-- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/android/src/main/java/org/mozilla/mozstumbler/client/ClientPrefs.java b/android/src/main/java/org/mozilla/mozstumbler/client/ClientPrefs.java index 8f09e5819..89682b637 100644 --- a/android/src/main/java/org/mozilla/mozstumbler/client/ClientPrefs.java +++ b/android/src/main/java/org/mozilla/mozstumbler/client/ClientPrefs.java @@ -20,7 +20,7 @@ public class ClientPrefs extends Prefs { public static final String CRASH_REPORTING = "crash_reporting"; public static final int MIN_BATTERY_DEFAULT = 15; public static final String LAST_VERSION = "last_version"; - public static final String IS_MAP_ZOOM_LIMITED = "limited_zoom"; + public static final String IS_MAP_ZOOM_UNLIMITED = "unlimited_zoom"; public static final String IS_SCANNING_PASSIVE = "passive_scanning"; private static final String LOG_TAG = LoggerUtil.makeLogTag(ClientPrefs.class); private static final String LAT_PREF = "lat"; @@ -179,12 +179,12 @@ public void setMinBatteryPercent(int percent) { public enum MapTileResolutionOptions {Default, HighRes, LowRes, NoMap} - public boolean isMapZoomLimited() { - return getBoolPrefWithDefault(IS_MAP_ZOOM_LIMITED, true); + public boolean isMapZoomUnlimited() { + return getBoolPrefWithDefault(IS_MAP_ZOOM_UNLIMITED, false); } - public void setIsMapZoomLimited(boolean isOn) { - setBoolPref(IS_MAP_ZOOM_LIMITED, isOn); + public void setIsMapZoomUnlimited(boolean isOn) { + setBoolPref(IS_MAP_ZOOM_UNLIMITED, isOn); } public boolean isScanningPassive() { diff --git a/android/src/main/java/org/mozilla/mozstumbler/client/mapview/MapFragment.java b/android/src/main/java/org/mozilla/mozstumbler/client/mapview/MapFragment.java index 2323b0499..91838b143 100644 --- a/android/src/main/java/org/mozilla/mozstumbler/client/mapview/MapFragment.java +++ b/android/src/main/java/org/mozilla/mozstumbler/client/mapview/MapFragment.java @@ -411,7 +411,7 @@ void setHighBandwidthMap(boolean hasNetwork, boolean isHighBandwidth) { updateMapResolutionTextView(tileType, isHighBandwidth); int minZoom = AbstractMapOverlay.getDisplaySizeBasedMinZoomLevel(); - if (!prefs.isMapZoomLimited()) { + if (prefs.isMapZoomUnlimited()) { minZoom = isHighBandwidth ? LOWEST_UNLIMITED_ZOOM : LowResMapOverlay.LOW_ZOOM_LEVEL; } mMap.setMinZoomLevel(minZoom); diff --git a/android/src/main/java/org/mozilla/mozstumbler/client/subactivities/PreferencesScreen.java b/android/src/main/java/org/mozilla/mozstumbler/client/subactivities/PreferencesScreen.java index 685dbbcc2..8af9066a1 100644 --- a/android/src/main/java/org/mozilla/mozstumbler/client/subactivities/PreferencesScreen.java +++ b/android/src/main/java/org/mozilla/mozstumbler/client/subactivities/PreferencesScreen.java @@ -53,7 +53,7 @@ public class PreferencesScreen extends PreferenceActivity implements IFxACallbac private CheckBoxPreference mKeepScreenOn; private CheckBoxPreference mEnableShowMLSLocations; private CheckBoxPreference mCrashReportsOn; - private CheckBoxPreference mLimitMapZoom; + private CheckBoxPreference mUnlimitedMapZoom; private ListPreference mMapTileDetail; private Preference mFxaLoginPreference; @@ -90,7 +90,7 @@ protected void onCreate(Bundle savedInstanceState) { mMapTileDetail.setValueIndex(valueIndex); updateMapDetailTitle(valueIndex); - mLimitMapZoom = (CheckBoxPreference) getPreferenceManager().findPreference(ClientPrefs.IS_MAP_ZOOM_LIMITED); + mUnlimitedMapZoom = (CheckBoxPreference) getPreferenceManager().findPreference(ClientPrefs.IS_MAP_ZOOM_UNLIMITED); setPreferenceListener(); setButtonListeners(); @@ -298,10 +298,10 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { return true; } }); - mLimitMapZoom.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { + mUnlimitedMapZoom.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { - getPrefs().setIsMapZoomLimited(newValue.equals(true)); + getPrefs().setIsMapZoomUnlimited(newValue.equals(true)); return true; } }); diff --git a/android/src/main/res/layout/stumbler_preferences.xml b/android/src/main/res/layout/stumbler_preferences.xml index 9c8a68520..d53dc0f68 100644 --- a/android/src/main/res/layout/stumbler_preferences.xml +++ b/android/src/main/res/layout/stumbler_preferences.xml @@ -28,10 +28,10 @@ android:summary="@string/map_tile_resolution_options_summary" android:title="@string/map_tile_resolution_options_label" /> + android:defaultValue="false" + android:key="unlimited_zoom" + android:summary="@string/unlimited_map_zoom_summary" + android:title="@string/unlimited_map_zoom" /> diff --git a/android/src/main/res/values-de/strings.xml b/android/src/main/res/values-de/strings.xml index d58b793f5..561a0fd0f 100644 --- a/android/src/main/res/values-de/strings.xml +++ b/android/src/main/res/values-de/strings.xml @@ -171,7 +171,8 @@ Der Sensor zur Erkennung signifikanter Bewegungen bietet die besten Energiesparmöglichkeiten, aber er funktioniert nicht auf allen Geräten. Benutzen Sie diesen Sensortyp nicht, wenn das Scannen trotz Bewegung pausiert bleibt. OK - Karte Herauszoomen limitieren + Karte unbegrenzt herauszoomen + Begrenzter Zoom kann helfen, den Datenverbrauch der Kartenansicht zu verringern. Unbegrenztes Zoomen betrifft nur die Karte mit hoher Auflösung. Sensor für signifikante Bewegungen testen Bleiben Sie stehen, laufen Sie dann 1 Minute lang.\n\nWarte auf Bewegung … Bewegung erkannt.\nDer Sensor funktioniert korrekt. @@ -179,6 +180,5 @@ Signifikante Bewegung Beschleunigungssensor Sensor benutzen: - Reduziert den Datenverbrauch der Kartenansicht. diff --git a/android/src/main/res/values-es/strings.xml b/android/src/main/res/values-es/strings.xml index 2c55bc145..431fbccae 100644 --- a/android/src/main/res/values-es/strings.xml +++ b/android/src/main/res/values-es/strings.xml @@ -179,7 +179,7 @@ El sensor de movimiento significativo ofrece el mejor ahorro de energía, pero puede no funcionar en todos los dispositivos. OK - Límite al reducir el zoom en el mapa + Prueba del sensor de movimiento significativo Permanecer quieto, y luego caminar durante 1 minuto.\n\nDetectando movimiento… Movimiento detectado.\nEl sensor funciona con normalidad. @@ -187,5 +187,5 @@ Movimiento significativo Acelerómetro Usar sensor: - Reduce los datos de red que utiliza la vista del mapa. + diff --git a/android/src/main/res/values-pl/strings.xml b/android/src/main/res/values-pl/strings.xml index 511742157..a2ce545d3 100644 --- a/android/src/main/res/values-pl/strings.xml +++ b/android/src/main/res/values-pl/strings.xml @@ -202,7 +202,7 @@ Znaczący czujnik ruchu umożliwia najlepsze oszczędzanie zasilania, ale może nie działać na wszystkich urządzeniach. OK - Ograniczenie oddalania mapy + Test skanowania pasywnego Test znaczącego czujnika ruchu Proszę stać w miejscu, po czym chodzić przez jedną minutę.\n\nWykrywanie ruchu: … @@ -211,7 +211,7 @@ Znaczący ruch Przyspieszeniomierz Użycie czujnika: - Zmniejsza zużycie danych przez widok mapy. + Dołączenie do rankingu za pomocą konta Firefoksa Obecnie zalogowano diff --git a/android/src/main/res/values-tr/strings.xml b/android/src/main/res/values-tr/strings.xml index c0397c2b7..ec365e25e 100644 --- a/android/src/main/res/values-tr/strings.xml +++ b/android/src/main/res/values-tr/strings.xml @@ -179,7 +179,7 @@ Önemli hareket algılayıcısı en iyi güç tasarrufunu sağlar, ancak tüm cihazlarda çalışmayabilir. Tamam - Haritadan uzaklaşmayı sınırla + Önemli Hareket Algılayıcıyı Sına Sabit durun, ardından 1 dk boyunca yürüyün.\n\nHareket algılanıyor … Hareket algılandı.\nAlgılayıcı düzgün çalışıyor. @@ -187,5 +187,5 @@ Önemli hareket İvme ölçer Algılayıcı kullan: - Harita görünümünde kullanılacak ağ verisini azaltır. + diff --git a/android/src/main/res/values-zh-rTW/strings.xml b/android/src/main/res/values-zh-rTW/strings.xml index 6733ef4e4..126912c4c 100644 --- a/android/src/main/res/values-zh-rTW/strings.xml +++ b/android/src/main/res/values-zh-rTW/strings.xml @@ -180,7 +180,7 @@ 顯著運動感測器的省電效果最好,但不是在每台裝置上都能用。 確定 - 限制縮小地圖 + 測試顯著運動感測器 先站直,然後持續走路一分鐘。\n\n偵測移動中… 偵測到移動。\n感測器功能正常。 @@ -188,5 +188,5 @@ 顯著運動感測器 加速度感測器 使用感測器: - 減少地圖所使用的網路數據量。 + diff --git a/android/src/main/res/values/strings.xml b/android/src/main/res/values/strings.xml index 748ae324e..bf8a8d65d 100644 --- a/android/src/main/res/values/strings.xml +++ b/android/src/main/res/values/strings.xml @@ -198,7 +198,8 @@ The significant motion sensor offers the best power saving, but may not work on all devices. OK - Limit zooming out on map + Unlimited map zoom + Limiting zoom can help to reduce the network data used by the map view. Unlimited zoom only applies to high detail map mode. Test Passive Scanning High Power Mode Test Significant Motion Sensor @@ -208,7 +209,6 @@ Significant motion Accelerometer Use sensor: - Reduces the network data used by the map view. Use Firefox Accounts to join the leaderboard You are currently logged in