Improved accessibility of the map widget showing time to go.

This commit is contained in:
Igor B. Poretsky 2013-03-12 19:51:52 +04:00
parent a00ba77ccf
commit fc8f0dda29
3 changed files with 4 additions and 0 deletions

View file

@ -1129,4 +1129,5 @@
<string name="item_checked">отмечено</string> <string name="item_checked">отмечено</string>
<string name="item_unchecked">не отмечено</string> <string name="item_unchecked">не отмечено</string>
<string name="map_view">Карта</string> <string name="map_view">Карта</string>
<string name="access_arrival_time">Время прибытия</string>
</resources> </resources>

View file

@ -9,6 +9,7 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). 3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy 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_arrival_time">Arrival time</string>
<string name="item_checked">checked</string> <string name="item_checked">checked</string>
<string name="item_unchecked">unchecked</string> <string name="item_unchecked">unchecked</string>
<string name="map_view">Map</string> <string name="map_view">Map</string>

View file

@ -230,6 +230,7 @@ public class RouteInfoControls {
long toFindTime = time * 1000 + System.currentTimeMillis(); long toFindTime = time * 1000 + System.currentTimeMillis();
if (Math.abs(toFindTime - cachedLeftTime) > 30000) { if (Math.abs(toFindTime - cachedLeftTime) > 30000) {
cachedLeftTime = toFindTime; cachedLeftTime = toFindTime;
setContentTitle(getContext().getString(R.string.access_arrival_time));
if (DateFormat.is24HourFormat(ctx)) { if (DateFormat.is24HourFormat(ctx)) {
setText(DateFormat.format("k:mm", toFindTime).toString(), null); //$NON-NLS-1$ setText(DateFormat.format("k:mm", toFindTime).toString(), null); //$NON-NLS-1$
} else { } else {
@ -243,6 +244,7 @@ public class RouteInfoControls {
cachedLeftTime = time; cachedLeftTime = time;
int hours = time / (60 * 60); int hours = time / (60 * 60);
int minutes = (time / 60) % 60; int minutes = (time / 60) % 60;
setContentTitle(getContext().getString(R.string.map_widget_time));
setText(String.format("%d:%02d", hours, minutes), null); //$NON-NLS-1$ setText(String.format("%d:%02d", hours, minutes), null); //$NON-NLS-1$
return true; return true;
} }