Dynamically set contentDescription attribute for compass and back to
location map widgets.
This commit is contained in:
parent
ac5bad0c35
commit
089816ea32
3 changed files with 8 additions and 0 deletions
|
@ -1994,4 +1994,5 @@
|
|||
<string name="access_collapsed_list">Свёрнутый список</string>
|
||||
<string name="access_expanded_list">Развёрнутый список</string>
|
||||
<string name="access_empty_list">Пустой список</string>
|
||||
<string name="access_map_linked_to_location">Карта привязана к местоположению</string>
|
||||
</resources>
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
|
||||
-->
|
||||
|
||||
<string name="access_map_linked_to_location">Map is linked to location</string>
|
||||
<string name="access_collapsed_list">Collapsed list</string>
|
||||
<string name="access_expanded_list">Expanded list</string>
|
||||
<string name="access_empty_list">Empty list</string>
|
||||
|
|
|
@ -577,10 +577,13 @@ public class MapControlsLayer extends OsmandMapLayer {
|
|||
}
|
||||
if (settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_NONE) {
|
||||
compassHud.setIconResId(isNight ? R.drawable.map_compass_niu_white : R.drawable.map_compass_niu);
|
||||
compassHud.iv.setContentDescription(mapActivity.getString(R.string.rotate_map_none_opt));
|
||||
} else if (settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_BEARING) {
|
||||
compassHud.setIconResId(isNight ? R.drawable.map_compass_bearing_white : R.drawable.map_compass_bearing);
|
||||
compassHud.iv.setContentDescription(mapActivity.getString(R.string.rotate_map_bearing_opt));
|
||||
} else {
|
||||
compassHud.setIconResId(isNight ? R.drawable.map_compass_white : R.drawable.map_compass);
|
||||
compassHud.iv.setContentDescription(mapActivity.getString(R.string.rotate_map_compass_opt));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -591,12 +594,15 @@ public class MapControlsLayer extends OsmandMapLayer {
|
|||
if (!enabled) {
|
||||
backToLocationControl.setBg(R.drawable.btn_circle, R.drawable.btn_circle_night);
|
||||
backToLocationControl.setIconColorId(R.color.icon_color, 0);
|
||||
backToLocationControl.iv.setContentDescription(mapActivity.getString(R.string.unknown_location));
|
||||
} else if (tracked) {
|
||||
backToLocationControl.setBg(R.drawable.btn_circle, R.drawable.btn_circle_night);
|
||||
backToLocationControl.setIconColorId(R.color.color_myloc_distance);
|
||||
backToLocationControl.iv.setContentDescription(mapActivity.getString(R.string.access_map_linked_to_location));
|
||||
} else {
|
||||
backToLocationControl.setIconColorId(0);
|
||||
backToLocationControl.setBg(R.drawable.btn_circle_blue);
|
||||
backToLocationControl.iv.setContentDescription(mapActivity.getString(R.string.map_widget_back_to_loc));
|
||||
}
|
||||
boolean visible = !(tracked && rh.isFollowingMode());
|
||||
backToLocationControl.updateVisibility(visible && !dialogOpened);
|
||||
|
|
Loading…
Reference in a new issue