From 66ba7ff2f62015b1618efaea878450b799615492 Mon Sep 17 00:00:00 2001
From: androiddevkotlin <64539346+androiddevkotlin@users.noreply.github.com>
Date: Sun, 18 Apr 2021 21:12:43 +0300
Subject: [PATCH] Spillover from Voice Prompts
Replace string "Languages" > "Language"
"Language" icon ic_action_map_language
It seems 2 dividers below the "Options" header, remove one.
It seems we lost the warning banner below the "Speed cameras" switch.
New headers is blinking after taping on a switch.
Min. item height = 48dp
Remove "Navigation instructions" option
---
OsmAnd/res/xml/voice_announces.xml | 35 +++++++++++--------
.../fragments/BaseSettingsFragment.java | 6 ++++
.../fragments/ScreenAlertsFragment.java | 6 ----
.../fragments/VoiceAnnouncesFragment.java | 12 +++----
4 files changed, 32 insertions(+), 27 deletions(-)
diff --git a/OsmAnd/res/xml/voice_announces.xml b/OsmAnd/res/xml/voice_announces.xml
index d95e34a23f..aac1a6d6f6 100644
--- a/OsmAnd/res/xml/voice_announces.xml
+++ b/OsmAnd/res/xml/voice_announces.xml
@@ -15,23 +15,19 @@
android:key="voice_provider"
android:layout="@layout/preference_with_descr"
android:persistent="false"
- android:title="@string/shared_string_languages"
+ android:title="@string/shared_string_language"
tools:icon="@drawable/ic_action_volume_up" />
-
-
@@ -61,17 +58,26 @@
android:layout="@layout/preference_switch"
android:title="@string/speak_cameras" />
+
+
@@ -91,11 +97,12 @@
android:title="@string/speak_poi" />
@@ -110,15 +117,12 @@
android:title="@string/speed_limit_exceed" />
-
-
@@ -133,11 +137,12 @@
android:title="@string/announcement_time_title" />
diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/BaseSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/BaseSettingsFragment.java
index 05c4c7e323..6eeea74426 100644
--- a/OsmAnd/src/net/osmand/plus/settings/fragments/BaseSettingsFragment.java
+++ b/OsmAnd/src/net/osmand/plus/settings/fragments/BaseSettingsFragment.java
@@ -924,6 +924,12 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
}
}
+ public void setupSpeedCamerasAlert() {
+ Preference speedCamerasAlert = findPreference(settings.SPEED_CAMERAS_UNINSTALLED.getId());
+ speedCamerasAlert.setIcon(getContentIcon(R.drawable.ic_action_alert));
+ speedCamerasAlert.setVisible(!settings.SPEED_CAMERAS_UNINSTALLED.get());
+ }
+
public void setupPrefRoundedBg(PreferenceViewHolder holder) {
View selectableView = holder.itemView.findViewById(R.id.selectable_list_item);
if (selectableView != null) {
diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ScreenAlertsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ScreenAlertsFragment.java
index b10d149342..a312253aee 100644
--- a/OsmAnd/src/net/osmand/plus/settings/fragments/ScreenAlertsFragment.java
+++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ScreenAlertsFragment.java
@@ -164,10 +164,4 @@ public class ScreenAlertsFragment extends BaseSettingsFragment implements OnPref
showCameras.setIcon(getIcon(R.drawable.list_warnings_speed_camera));
showCameras.setVisible(!settings.SPEED_CAMERAS_UNINSTALLED.get());
}
-
- public void setupSpeedCamerasAlert() {
- Preference speedCamerasAlert = findPreference(settings.SPEED_CAMERAS_UNINSTALLED.getId());
- speedCamerasAlert.setIcon(getContentIcon(R.drawable.ic_action_alert));
- speedCamerasAlert.setVisible(!settings.SPEED_CAMERAS_UNINSTALLED.get());
- }
}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/VoiceAnnouncesFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/VoiceAnnouncesFragment.java
index b51e71fe93..d86f4b4586 100644
--- a/OsmAnd/src/net/osmand/plus/settings/fragments/VoiceAnnouncesFragment.java
+++ b/OsmAnd/src/net/osmand/plus/settings/fragments/VoiceAnnouncesFragment.java
@@ -106,6 +106,9 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment implements OnPr
Preference voiceAnnouncesInfo = findPreference("voice_announces_info");
voiceAnnouncesInfo.setIcon(getContentIcon(R.drawable.ic_action_info_dark));
+ Preference languageSetting = findPreference("voice_provider");
+ languageSetting.setIcon(getContentIcon(R.drawable.ic_action_map_language));
+
setupSpeedLimitExceedPref();
setupKeepInformingPref();
@@ -116,7 +119,7 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment implements OnPr
enableDisablePreferences(!settings.VOICE_MUTE.getModeValue(getSelectedAppMode()));
setupSpeakCamerasPref();
- setupTurnScreenOnNavigationInstructionsPref();
+ setupSpeedCamerasAlert();
}
private void setupSpeedLimitExceedPref() {
@@ -191,11 +194,6 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment implements OnPr
getPreferenceScreen().addPreference(interruptMusicPref);
}
- private void setupTurnScreenOnNavigationInstructionsPref() {
- SwitchPreferenceEx turnScreenOnNavigationInstructions = findPreference(settings.TURN_SCREEN_ON_NAVIGATION_INSTRUCTIONS.getId());
- turnScreenOnNavigationInstructions.setDescription(R.string.turn_screen_on_navigation_instructions_descr);
- }
-
private void updateMenu() {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
@@ -277,6 +275,7 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment implements OnPr
public void onPreferenceChanged(String prefId) {
if (prefId.equals(settings.SPEED_CAMERAS_UNINSTALLED.getId())) {
setupSpeakCamerasPref();
+ setupSpeedCamerasAlert();
}
}
@@ -284,4 +283,5 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment implements OnPr
SwitchPreferenceCompat showCameras = findPreference(settings.SPEAK_SPEED_CAMERA.getId());
showCameras.setVisible(!settings.SPEED_CAMERAS_UNINSTALLED.get());
}
+
}
\ No newline at end of file