Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-03-15 23:56:40 +01:00
commit 75154d218e
8 changed files with 545 additions and 18 deletions

View file

@ -0,0 +1,272 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="horizontal" >
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|left"
>
<!-- ALARM -->
<FrameLayout
android:id="@+id/map_alarm_warning"
android:layout_width="@dimen/map_alarm_size"
android:layout_height="@dimen/map_alarm_size"
android:layout_gravity="bottom|left"
android:layout_marginBottom="@dimen/map_alarm_bottom_margin_land"
android:layout_marginLeft="@dimen/map_button_shadow_margin" >
<ImageView
android:id="@+id/map_alarm_warning_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/warnings_limit" />
<TextView
android:id="@+id/map_alarm_warning_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="60"
android:textColor="@color/color_black"
android:textSize="@dimen/map_alarm_text_size"
android:textStyle="bold" />
</FrameLayout>
<!-- SHADOW -->
<FrameLayout
android:id="@+id/map_app_mode_shadow"
android:layout_width="@dimen/map_button_shadow_width"
android:layout_height="@dimen/map_button_shadow_height"
android:layout_gravity="bottom|left"
android:layout_marginBottom="@dimen/map_button_shadow_margin"
android:layout_marginLeft="@dimen/map_button_shadow_margin"
android:background="@drawable/btn_round_trans" >
<ImageView
android:id="@+id/map_app_mode_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|center"
android:layout_marginTop="3dp"
android:src="@drawable/ic_action_remove_light" />
<TextView
android:id="@+id/map_app_mode_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|center"
android:layout_marginTop="3dp"
android:textSize="@dimen/map_button_text_size" />
</FrameLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|left"
android:layout_marginBottom="@dimen/map_button_margin"
android:layout_marginLeft="@dimen/map_button_margin"
android:layout_marginRight="@dimen/map_button_spacing_land"
android:orientation="horizontal" >
<ImageButton
android:id="@+id/map_menu_button"
android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size"
android:background="@drawable/btn_round"
android:src="@drawable/ic_action_remove_light" />
<ImageButton
android:id="@+id/map_route_info_button"
android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size"
android:layout_marginLeft="@dimen/map_button_spacing_land"
android:background="@drawable/btn_round"
android:src="@drawable/ic_action_remove_light" />
</LinearLayout>
</FrameLayout>
<FrameLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/map_button_margin"
android:layout_weight="1" >
<!-- RULER -->
<FrameLayout
android:id="@+id/map_ruler_layout"
android:layout_width="@dimen/map_ruler_width"
android:layout_height="wrap_content"
android:layout_gravity="bottom" >
<TextView
android:id="@+id/map_ruler_text"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/map_ruler_bottom_margin"
android:gravity="center_horizontal"
android:text="100 m"
android:textSize="@dimen/map_widget_text_size_small" />
<ImageView
android:id="@+id/map_ruler_image"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@drawable/ruler" />
</FrameLayout>
<!-- TRANSPARENCY -->
<LinearLayout
android:id="@+id/map_transparency_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:layout_marginBottom="@dimen/map_button_size"
android:orientation="horizontal" >
<SeekBar
android:id="@+id/map_transparency_seekbar"
android:layout_width="@dimen/map_trans_seek_size"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<ImageButton
android:id="@+id/map_transparency_hide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/btn_circle_transparent"
android:src="@drawable/headliner_close" />
</LinearLayout>
<!-- PREPARATION SCREEN -->
<LinearLayout
android:id="@+id/map_route_preparation_layout"
android:layout_width="match_parent"
android:layout_height="@dimen/map_route_buttons_height_land"
android:layout_gravity="bottom" >
<ImageButton
android:id="@+id/map_cancel_route_button"
android:layout_width="@dimen/map_route_buttons_width"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:background="@drawable/btn_flat"
android:src="@drawable/ic_action_remove_light" />
<ImageButton
android:id="@+id/map_waypoints_route_button"
android:layout_width="@dimen/map_route_buttons_width"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:background="@drawable/btn_flat"
android:src="@drawable/ic_action_remove_light" />
<ImageButton
android:id="@+id/map_options_route_button"
android:layout_width="@dimen/map_route_buttons_width"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:background="@drawable/btn_flat"
android:src="@drawable/ic_action_remove_light" />
<TextView
android:id="@+id/map_go_route_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:background="@drawable/btn_flat"
android:drawableLeft="@drawable/ic_action_remove_light"
android:drawablePadding="4dp"
android:gravity="center_vertical"
android:paddingLeft="12dp"
android:textSize="20sp"
android:textStyle="bold" />
</LinearLayout>
<!-- CONTEXT MENU -->
<LinearLayout
android:id="@+id/map_context_menu_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@drawable/btn_flat"
android:visibility="gone" >
<TextView
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center" >
</TextView>
<ImageButton
android:layout_width="@dimen/map_address_height"
android:layout_height="@dimen/map_address_height"
android:layout_gravity="center_vertical"
android:background="@drawable/btn_circle_transparent"
android:src="@drawable/ic_action_remove_light" />
<ImageButton
android:layout_width="@dimen/map_address_height"
android:layout_height="@dimen/map_address_height"
android:layout_gravity="center_vertical"
android:background="@drawable/btn_circle_transparent"
android:src="@drawable/ic_action_remove_light" />
</LinearLayout>
</FrameLayout>
<!-- RIGHT BUTTONS -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/map_button_margin"
android:layout_marginLeft="@dimen/map_button_spacing_land"
android:layout_marginRight="@dimen/map_button_margin" >
<ImageButton
android:id="@+id/map_my_location_button"
android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size"
android:layout_gravity="bottom"
android:background="@drawable/btn_circle"
android:src="@drawable/ic_action_remove_light" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="@dimen/map_button_spacing_land"
android:orientation="vertical" >
<ImageButton
android:id="@+id/map_zoom_in_button"
android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size"
android:background="@drawable/btn_circle"
android:src="@drawable/ic_action_remove_light" />
<ImageButton
android:id="@+id/map_zoom_out_button"
android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size"
android:layout_marginTop="@dimen/map_button_spacing_land"
android:background="@drawable/btn_circle"
android:src="@drawable/ic_action_remove_light" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

View file

@ -0,0 +1,218 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="1" >
<!-- LEFT widgets colon -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|left"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/map_left_widgets_panel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|left"
android:orientation="vertical" >
<include
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/map_hud_widget" />
<include layout="@layout/map_hud_widget" />
<include layout="@layout/map_hud_widget" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<FrameLayout
android:id="@+id/map_top_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/btn_round"
android:minHeight="@dimen/map_address_height" >
<TextView
android:id="@+id/map_address_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:ellipsize="end"
android:maxLines="1"
android:shadowColor="@color/color_myloc_distance"
android:shadowRadius="10"
android:text="Long Street Name"
android:textColor="@color/color_black"
android:textSize="@dimen/map_widget_text_size"
android:textStyle="bold" >
</TextView>
<LinearLayout
android:id="@+id/waypoint_info_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="@+id/waypoint_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/map_button_margin"
android:layout_marginRight="@dimen/map_button_margin"
android:src="@drawable/ic_action_remove_light" />
<TextView
android:id="@+id/waypoint_dist"
android:layout_width="60dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:maxLines="2"
android:textColor="@color/wpt_distance_color"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:id="@+id/waypoint_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="2"
android:textSize="18sp" />
<ImageButton
android:id="@+id/waypoint_more"
android:layout_width="@dimen/map_address_height"
android:layout_height="@dimen/map_address_height"
android:background="@drawable/btn_circle_transparent"
android:src="@drawable/ic_overflow_menu_white" />
<ImageButton
android:id="@+id/waypoint_close"
android:layout_width="@dimen/map_address_height"
android:layout_height="@dimen/map_address_height"
android:background="@drawable/btn_circle_transparent"
android:src="@drawable/ic_action_remove_light" />
</LinearLayout>
</FrameLayout>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<!-- CENTER -->
<LinearLayout
android:id="@+id/map_center_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|center"
android:layout_marginTop="@dimen/map_button_margin"
android:background="@drawable/btn_round"
android:orientation="vertical" >
<ImageView
android:id="@+id/map_lanes"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/map_lanes_dist_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:maxLines="1"
android:text="1048 km"
android:textColor="@color/color_black"
android:textSize="@dimen/map_widget_text_size_small" />
<ProgressBar
android:id="@+id/map_horizontal_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="@dimen/map_routing_progress_width"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/map_button_margin"
android:layout_marginRight="@dimen/map_button_margin"
android:max="100"
android:progress="60"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|left"
android:layout_marginLeft="@dimen/map_button_margin"
android:layout_marginTop="@dimen/map_button_margin"
android:orientation="horizontal" >
<ImageButton
android:id="@+id/map_layers_button"
android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size"
android:background="@drawable/btn_inset_circle"
android:src="@drawable/ic_action_remove_light" />
<ImageButton
android:id="@+id/map_compass_button"
android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size"
android:background="@drawable/btn_inset_circle"
android:src="@drawable/ic_action_remove_light" />
</LinearLayout>
</FrameLayout>
</LinearLayout>
<!-- RIGHT widgets colon -->
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|right" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|right"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/map_right_widgets_panel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|right"
android:orientation="vertical" >
<include layout="@layout/map_hud_widget" />
<include layout="@layout/map_hud_widget" />
</LinearLayout>
<ImageButton
android:id="@+id/map_collapse_button"
android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size"
android:layout_gravity="top|center_horizontal"
android:background="@drawable/btn_inset_circle"
android:src="@drawable/ic_action_remove_light" />
</LinearLayout>
</FrameLayout>
</LinearLayout>

View file

@ -21,7 +21,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:shadowColor="@color/color_myloc_distance"
android:shadowRadius="10"

View file

@ -56,6 +56,8 @@
<dimen name="map_button_text_size">18sp</dimen>
<dimen name="map_route_buttons_width">60dp</dimen>
<dimen name="map_route_buttons_height">54dp</dimen>
<dimen name="map_route_buttons_height_land">48dp</dimen>
<dimen name="map_address_height">40dp</dimen>
<dimen name="map_button_size">48dp</dimen>
<dimen name="map_ruler_width">120dp</dimen>
@ -65,11 +67,13 @@
<dimen name="map_alarm_text_size">25sp</dimen>
<dimen name="map_alarm_bottom_margin">87dp</dimen>
<dimen name="map_alarm_bottom_margin_land">55dp</dimen>
<dimen name="map_button_shadow_height">85dp</dimen>
<dimen name="map_widget_icon">24dp</dimen>
<dimen name="map_widget_height">32dp</dimen>
<dimen name="map_widget_image">80dp</dimen>
<dimen name="map_button_spacing">15dp</dimen>
<dimen name="map_button_spacing_land">10dp</dimen>
<dimen name="map_button_margin">4dp</dimen>
<dimen name="map_routing_progress_width">100dp</dimen>

View file

@ -113,7 +113,7 @@ public class DashboardOnMap {
params.gravity = landscape ? Gravity.BOTTOM | Gravity.RIGHT : Gravity.TOP | Gravity.RIGHT;
actionButton.setLayoutParams(params);
actionButton.setImageDrawable(mapActivity.getResources().getDrawable(R.drawable.ic_action_map));
actionButton.setImageDrawable(mapActivity.getResources().getDrawable(R.drawable.ic_action_get_my_location));
actionButton.setButtonColor(mapActivity.getResources().getColor(R.color.color_myloc_distance));
actionButton.hide();
actionButton.setOnClickListener(new View.OnClickListener() {

View file

@ -39,7 +39,7 @@ import android.widget.TextView;
public class MapControlsLayer extends OsmandMapLayer {
private static final int TIMEOUT_TO_SHOW_BUTTONS = 5000;
private static final int TIMEOUT_TO_SHOW_BUTTONS = 7000;
public MapHudButton createHudButton(View iv, int resId) {
MapHudButton mc = new MapHudButton();
@ -76,13 +76,14 @@ public class MapControlsLayer extends OsmandMapLayer {
private OsmandMapTileView mapView;
private OsmandApplication app;
private View mapAppModeShadow;
private MapHudButton routePlanningBtn;
private long touchEvent;
public MapControlsLayer(MapActivity activity) {
this.mapActivity = activity;
app = activity.getMyApplication();
settings = activity.getMyApplication().getSettings();
mapView = mapActivity.getMapView();
}
@Override
@ -304,8 +305,9 @@ public class MapControlsLayer extends OsmandMapLayer {
zoomText = (TextView) mapActivity.findViewById(R.id.map_app_mode_text);
View routePlanButton = mapActivity.findViewById(R.id.map_route_info_button);
controls.add(createHudButton((ImageView) routePlanButton, R.drawable.ic_action_gdirections_dark).setBg(
R.drawable.btn_round, R.drawable.btn_round_night));
routePlanningBtn = createHudButton((ImageView) routePlanButton, R.drawable.ic_action_gdirections_dark).setBg(
R.drawable.btn_round, R.drawable.btn_round_night);
controls.add(routePlanningBtn);
routePlanButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -441,14 +443,16 @@ public class MapControlsLayer extends OsmandMapLayer {
boolean routeFollowingMode = !routePlanningMode && rh.isFollowingMode();
boolean showRouteCalculationControls = routePlanningMode;
boolean showDefaultButtons = !routePlanningMode
&& (!routeFollowingMode || settings.SHOW_ZOOM_BUTTONS_NAVIGATION.get());
// /////////////////////////////////////////////
// new update
updateMyLocation();
// boolean showDefaultButtons = !routePlanningMode
// && (!routeFollowingMode || settings.SHOW_ZOOM_BUTTONS_NAVIGATION.get());
boolean showButtons = routePlanningMode || !routeFollowingMode || (System.currentTimeMillis() - touchEvent < TIMEOUT_TO_SHOW_BUTTONS);
updateMyLocation(rh);
routePlanningBtn.setIconResId(routeFollowingMode ? R.drawable.ic_action_info_dark : R.drawable.ic_action_gdirections_dark );
routePlanningBtn.updateVisibility(showButtons && !routePlanningMode);
menuControl.setIconResId(settings.USE_DASHBOARD_INSTEAD_OF_DRAWER.get() ? R.drawable.ic_dashboard_dark
: R.drawable.ic_navigation_drawer);
menuControl.updateVisibility(showButtons);
if(routeFollowingMode || routePlanningMode) {
mapAppModeShadow.setVisibility(View.GONE);
@ -491,6 +495,14 @@ public class MapControlsLayer extends OsmandMapLayer {
}
}
updateCompass(isNight);
for (MapHudButton mc : controls) {
mc.update(mapActivity.getMyApplication(), nightMode == null ? false : nightMode.isNightMode());
}
}
private void updateCompass(boolean isNight) {
float mapRotate = mapActivity.getMapView().getRotate();
if (mapRotate != cachedRotate) {
cachedRotate = mapRotate;
@ -504,13 +516,9 @@ public class MapControlsLayer extends OsmandMapLayer {
} else {
compassHud.setIconResId(isNight ? R.drawable.map_compass_white : R.drawable.map_compass);
}
for (MapHudButton mc : controls) {
mc.update(mapActivity.getMyApplication(), nightMode == null ? false : nightMode.isNightMode());
}
}
private void updateMyLocation() {
private void updateMyLocation(RoutingHelper rh) {
// final Drawable backToLoc = map.getResources().getDrawable(R.drawable.back_to_loc);
// final Drawable backToLocWhite = map.getResources().getDrawable(R.drawable.back_to_loc_white);
// final Drawable backToLocDisabled = map.getResources().getDrawable(R.drawable.la_backtoloc_disabled);
@ -526,6 +534,8 @@ public class MapControlsLayer extends OsmandMapLayer {
} else {
backToLocationControl.setIconColorId(R.color.color_white);
}
boolean visible = !(tracked && rh.isFollowingMode());
backToLocationControl.updateVisibility(visible);
}
@ -540,6 +550,11 @@ public class MapControlsLayer extends OsmandMapLayer {
@Override
public boolean onTouchEvent(MotionEvent event, RotatedTileBox tileBox) {
stopCounter();
touchEvent = System.currentTimeMillis();
RoutingHelper rh = mapActivity.getRoutingHelper();
if (rh.isFollowingMode()) {
mapActivity.refreshMap();
}
return false;
}
@ -617,7 +632,19 @@ public class MapControlsLayer extends OsmandMapLayer {
bgLight = dayBg;
f = true;
return this;
}
public boolean updateVisibility(boolean visible) {
if (visible != (iv.getVisibility() == View.VISIBLE)) {
if (visible) {
iv.setVisibility(View.VISIBLE);
} else {
iv.setVisibility(View.GONE);
}
iv.invalidate();
return true;
}
return false;
}
public MapHudButton setBg(int bg) {

View file

@ -12,6 +12,7 @@ import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.dialogs.ConfigureMapMenu;
import net.osmand.plus.helpers.ScreenOrientationHelper;
import net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory;
import net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory.TopTextView;
import net.osmand.plus.views.mapwidgets.MapWidgetRegistry;
@ -191,7 +192,8 @@ public class MapInfoLayer extends OsmandMapLayer {
}
private void updateStreetName(TextState ts) {
streetNameView.setBackgroundResource(ts.boxTop);
streetNameView.setBackgroundResource(ScreenOrientationHelper.isOrientationPortrait(map) ? ts.boxTop
: ts.boxFree);
streetNameView.updateTextColor(ts.textColor, ts.textShadowColor, ts.textBold, ts.textShadowRadius);
}

View file

@ -19,6 +19,7 @@ import net.osmand.plus.TargetPointsHelper;
import net.osmand.plus.TargetPointsHelper.TargetPoint;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.base.MapViewTrackingUtilities;
import net.osmand.plus.helpers.ScreenOrientationHelper;
import net.osmand.plus.helpers.WaypointHelper;
import net.osmand.plus.routing.AlarmInfo;
import net.osmand.plus.routing.AlarmInfo.AlarmInfoType;
@ -712,6 +713,7 @@ public class RouteInfoWidgetsFactory {
private int cacheRulerZoom;
private double cacheRulerTileX;
private double cacheRulerTileY;
private boolean orientationPortrait;
public RulerWidget(final OsmandApplication app, MapActivity ma) {
this.ma = ma;
@ -719,6 +721,7 @@ public class RouteInfoWidgetsFactory {
icon = (ImageView) ma.findViewById(R.id.map_ruler_image);
text = (TextView) ma.findViewById(R.id.map_ruler_text);
maxWidth = ma.getResources().getDimensionPixelSize(R.dimen.map_ruler_width);
orientationPortrait = ScreenOrientationHelper.isOrientationPortrait(ma);
}
public void updateTextSize(boolean isNight, int textColor, int textShadowColor, int shadowRadius) {
@ -733,6 +736,8 @@ public class RouteInfoWidgetsFactory {
// update cache
if (view.isZooming()) {
visible = false;
} else if (!orientationPortrait && ma.getRoutingHelper().isRoutePlanningMode()) {
visible = false;
} else if ((tb.getZoom() != cacheRulerZoom || Math.abs(tb.getCenterTileX() - cacheRulerTileX) > 1 || Math
.abs(tb.getCenterTileY() - cacheRulerTileY) > 1) && tb.getPixWidth() > 0 && maxWidth > 0) {
cacheRulerZoom = tb.getZoom();