Update route info layer

This commit is contained in:
Victor Shcherb 2011-12-11 00:02:38 +01:00
parent 79484705fe
commit 62745416b1
9 changed files with 16 additions and 13 deletions

Binary file not shown.

View file

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="show_zoom_level_descr">Показывать уровень приближения вместо масштаба.</string>
<string name="show_zoom_level">Показывать уровень приближения.</string>
<string name="tip_select_destination_point">Выбор точки назначения</string>
<string name="tip_select_destination_point_t">
\tNEW VERSION, PLEASE ADAPT TRANSLATION: You can select a destination directly in the map (context menu, then \'Set as destination\'), in all search activities, or via long pressing an entry in your \'List of Favorite Points\'.
\n\tThe destination is marked as an orange disk on the map and OsmAnd displays the distance to it and the direction to it (orange triangle).
\n\tВы можете выбрать точку назначения в контекстном меню карты \'Идти к\' или в поиске.
\n\tВы также можете выбрать избранную точку долгим нажатием в \'Избранных\'.</string>

View file

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<resources>
<string name="show_zoom_level_descr">Show zoom level constantly instead of ruler.</string>
<string name="show_zoom_level">Show zoom level</string>
<string name="tip_select_destination_point">Select Destination</string>
<string name="tip_select_destination_point_t">\tYou can select a destination directly in the map (context menu, then \'Set as destination\'), in all search activities, or via long pressing an entry in your \'List of Favorite Points\'.
\n\tThe destination is marked as an orange disk on the map and OsmAnd displays the distance to it and the direction to it (orange triangle).</string>

View file

@ -90,6 +90,7 @@
<PreferenceScreen android:key="appearance_settings" android:title="@string/appearance_settings" android:summary="@string/appearance_settings_descr">
<CheckBoxPreference android:key="transparent_map_theme" android:title="@string/use_transparent_map_theme" android:summary="@string/use_transparent_map_theme_descr"/>
<CheckBoxPreference android:key="show_altitude_info" android:title="@string/show_altitude_info" android:summary="@string/show_altitude_info_descr"/>
<CheckBoxPreference android:key="show_zoom_level" android:title="@string/show_zoom_level" android:summary="@string/show_zoom_level_descr"/>
</PreferenceScreen>
<PreferenceScreen android:key = "osm_settings" android:title="@string/osm_settings" android:summary="@string/osm_settings_descr">

View file

@ -271,7 +271,7 @@ public class OsmandSettings {
}
private BooleanPreference(String id, boolean defaultValue, boolean global, boolean cache) {
super(id, global, cache);
super(id, global, cache, defaultValue);
}
@Override
@ -1061,7 +1061,12 @@ public class OsmandSettings {
}
public final CommonPreference<Boolean> SHOW_ALTITUDE_INFO =
new BooleanPreference("show_altitude_info", false, false);
new BooleanPreference("show_altitude_info", false, false, true);
public final CommonPreference<Boolean> SHOW_ZOOM_LEVEL =
new BooleanPreference("show_zoom_level", false, false, true);
public enum DayNightMode {
AUTO(R.string.daynight_mode_auto),

View file

@ -832,12 +832,6 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso
if (LocationProvider.OUT_OF_SERVICE == status) {
// do not use it in routing
if (service.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) {
// try {
// service.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, GPS_TIMEOUT_REQUEST, GPS_DIST_REQUEST,
// networkListener);
// } catch (IllegalArgumentException e) {
// Log.d(LogUtil.TAG, "Network location provider not available"); //$NON-NLS-1$
// }
}
} else if (LocationProvider.AVAILABLE == status) {
// Do not remove right now network listener

View file

@ -176,6 +176,8 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
registerBooleanPreference(osmandSettings.TEST_ANIMATE_ROUTING,screen);
registerBooleanPreference(osmandSettings.NATIVE_RENDERING,screen);
registerBooleanPreference(osmandSettings.SHOW_ALTITUDE_INFO,screen);
registerBooleanPreference(osmandSettings.SHOW_ZOOM_LEVEL,screen);
registerEditTextPreference(osmandSettings.USER_NAME, screen);
registerEditTextPreference(osmandSettings.USER_PASSWORD, screen);

View file

@ -124,7 +124,7 @@ public class MapControlsLayer extends OsmandMapLayer {
hideZoomLevelInTime();
}
}
if (showZoomLevel) {
if (showZoomLevel || view.getSettings().SHOW_ZOOM_LEVEL.get()) {
drawZoomLevel(canvas);
} else {
drawRuler(canvas);

View file

@ -548,7 +548,7 @@ public class MapInfoLayer extends OsmandMapLayer {
// Back to location icon
params = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
params.leftMargin = (int) (10 * scaleCoefficient);
params.rightMargin = (int) (1 * scaleCoefficient);
params.rightMargin = 0;
backToLocation = new ImageView(view.getContext());
backToLocation.setImageDrawable(view.getResources().getDrawable(R.drawable.back_to_loc));
backToLocation.setOnClickListener(new View.OnClickListener() {