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
This commit is contained in:
androiddevkotlin 2021-04-18 21:12:43 +03:00
parent 23cc2430f1
commit 66ba7ff2f6
4 changed files with 32 additions and 27 deletions

View file

@ -15,23 +15,19 @@
android:key="voice_provider" android:key="voice_provider"
android:layout="@layout/preference_with_descr" android:layout="@layout/preference_with_descr"
android:persistent="false" android:persistent="false"
android:title="@string/shared_string_languages" android:title="@string/shared_string_language"
tools:icon="@drawable/ic_action_volume_up" /> tools:icon="@drawable/ic_action_volume_up" />
<Preference <Preference
android:key="language_divider"
android:layout="@layout/simple_divider_item" android:layout="@layout/simple_divider_item"
android:selectable="false" /> android:selectable="false" />
<PreferenceCategory <PreferenceCategory
android:key="language_and_output" android:key="announce_header"
android:layout="@layout/preference_category_with_descr" android:layout="@layout/preference_category_with_descr"
android:title="@string/accessibility_announce" /> android:title="@string/accessibility_announce" />
<net.osmand.plus.settings.preferences.SwitchPreferenceEx
android:key="turn_screen_on_navigation_instructions"
android:layout="@layout/preference_with_descr"
android:title="@string/turn_screen_on_navigation_instructions" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
android:key="speak_street_names" android:key="speak_street_names"
android:layout="@layout/preference_switch" android:layout="@layout/preference_switch"
@ -43,6 +39,7 @@
android:title="@string/exit_number" /> android:title="@string/exit_number" />
<Preference <Preference
android:key="exit_number_divider"
android:layout="@layout/divider_half_item" android:layout="@layout/divider_half_item"
android:selectable="false" /> android:selectable="false" />
@ -61,17 +58,26 @@
android:layout="@layout/preference_switch" android:layout="@layout/preference_switch"
android:title="@string/speak_cameras" /> android:title="@string/speak_cameras" />
<Preference
android:key="speed_cameras_uninstalled"
android:layout="@layout/preference_permission"
android:persistent="false"
android:summary="@string/read_more"
android:title="@string/speed_cameras_alert"
tools:icon="@drawable/ic_action_alert" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
android:key="speak_tunnels" android:key="speak_tunnels"
android:layout="@layout/preference_switch" android:layout="@layout/preference_switch"
android:title="@string/show_tunnels" /> android:title="@string/show_tunnels" />
<Preference <Preference
android:key="announce_divider"
android:layout="@layout/divider_half_item" android:layout="@layout/divider_half_item"
android:selectable="false" /> android:selectable="false" />
<PreferenceCategory <PreferenceCategory
android:key="language_and_output" android:key="user_points_header"
android:layout="@layout/preference_category_with_descr" android:layout="@layout/preference_category_with_descr"
android:title="@string/user_points" /> android:title="@string/user_points" />
@ -91,11 +97,12 @@
android:title="@string/speak_poi" /> android:title="@string/speak_poi" />
<Preference <Preference
android:key="user_points_divider"
android:layout="@layout/divider_half_item" android:layout="@layout/divider_half_item"
android:selectable="false" /> android:selectable="false" />
<PreferenceCategory <PreferenceCategory
android:key="language_and_output" android:key="speed_limit_header"
android:layout="@layout/preference_category_with_descr" android:layout="@layout/preference_category_with_descr"
android:title="@string/speak_speed_limit" /> android:title="@string/speak_speed_limit" />
@ -110,15 +117,12 @@
android:title="@string/speed_limit_exceed" /> android:title="@string/speed_limit_exceed" />
<Preference <Preference
android:layout="@layout/simple_divider_item" android:key="speed_limit_divider"
android:selectable="false" />
<Preference
android:layout="@layout/simple_divider_item" android:layout="@layout/simple_divider_item"
android:selectable="false" /> android:selectable="false" />
<PreferenceCategory <PreferenceCategory
android:key="language_and_output" android:key="options_header"
android:layout="@layout/preference_category_with_descr" android:layout="@layout/preference_category_with_descr"
android:title="@string/shared_string_options" /> android:title="@string/shared_string_options" />
@ -133,11 +137,12 @@
android:title="@string/announcement_time_title" /> android:title="@string/announcement_time_title" />
<Preference <Preference
android:key="options_divider"
android:layout="@layout/simple_divider_item" android:layout="@layout/simple_divider_item"
android:selectable="false" /> android:selectable="false" />
<PreferenceCategory <PreferenceCategory
android:key="language_and_output" android:key="output_header"
android:layout="@layout/preference_category_with_descr" android:layout="@layout/preference_category_with_descr"
android:title="@string/output" /> android:title="@string/output" />

View file

@ -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) { public void setupPrefRoundedBg(PreferenceViewHolder holder) {
View selectableView = holder.itemView.findViewById(R.id.selectable_list_item); View selectableView = holder.itemView.findViewById(R.id.selectable_list_item);
if (selectableView != null) { if (selectableView != null) {

View file

@ -164,10 +164,4 @@ public class ScreenAlertsFragment extends BaseSettingsFragment implements OnPref
showCameras.setIcon(getIcon(R.drawable.list_warnings_speed_camera)); showCameras.setIcon(getIcon(R.drawable.list_warnings_speed_camera));
showCameras.setVisible(!settings.SPEED_CAMERAS_UNINSTALLED.get()); 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());
}
} }

View file

@ -106,6 +106,9 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment implements OnPr
Preference voiceAnnouncesInfo = findPreference("voice_announces_info"); Preference voiceAnnouncesInfo = findPreference("voice_announces_info");
voiceAnnouncesInfo.setIcon(getContentIcon(R.drawable.ic_action_info_dark)); voiceAnnouncesInfo.setIcon(getContentIcon(R.drawable.ic_action_info_dark));
Preference languageSetting = findPreference("voice_provider");
languageSetting.setIcon(getContentIcon(R.drawable.ic_action_map_language));
setupSpeedLimitExceedPref(); setupSpeedLimitExceedPref();
setupKeepInformingPref(); setupKeepInformingPref();
@ -116,7 +119,7 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment implements OnPr
enableDisablePreferences(!settings.VOICE_MUTE.getModeValue(getSelectedAppMode())); enableDisablePreferences(!settings.VOICE_MUTE.getModeValue(getSelectedAppMode()));
setupSpeakCamerasPref(); setupSpeakCamerasPref();
setupTurnScreenOnNavigationInstructionsPref(); setupSpeedCamerasAlert();
} }
private void setupSpeedLimitExceedPref() { private void setupSpeedLimitExceedPref() {
@ -191,11 +194,6 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment implements OnPr
getPreferenceScreen().addPreference(interruptMusicPref); 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() { private void updateMenu() {
MapActivity mapActivity = getMapActivity(); MapActivity mapActivity = getMapActivity();
if (mapActivity != null) { if (mapActivity != null) {
@ -277,6 +275,7 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment implements OnPr
public void onPreferenceChanged(String prefId) { public void onPreferenceChanged(String prefId) {
if (prefId.equals(settings.SPEED_CAMERAS_UNINSTALLED.getId())) { if (prefId.equals(settings.SPEED_CAMERAS_UNINSTALLED.getId())) {
setupSpeakCamerasPref(); setupSpeakCamerasPref();
setupSpeedCamerasAlert();
} }
} }
@ -284,4 +283,5 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment implements OnPr
SwitchPreferenceCompat showCameras = findPreference(settings.SPEAK_SPEED_CAMERA.getId()); SwitchPreferenceCompat showCameras = findPreference(settings.SPEAK_SPEED_CAMERA.getId());
showCameras.setVisible(!settings.SPEED_CAMERAS_UNINSTALLED.get()); showCameras.setVisible(!settings.SPEED_CAMERAS_UNINSTALLED.get());
} }
} }