From 3cfd3d67ce02c7bd564c830d586341baea7ab9ee Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Sat, 27 Feb 2016 18:26:41 +0300 Subject: [PATCH] Small fixes --- .../src/net/osmand/plus/dashboard/DashboardOnMap.java | 11 ++--------- .../osmand/plus/helpers/MapMarkerDialogHelper.java | 2 +- .../osmand/plus/views/controls/DynamicListView.java | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java index 40575ce14e..0d1b4a3409 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java @@ -9,6 +9,7 @@ import android.os.Build; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; +import android.support.v4.view.ViewCompat; import android.support.v7.widget.Toolbar; import android.util.TypedValue; import android.view.Gravity; @@ -1291,16 +1292,8 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis } } - @SuppressLint("NewApi") private void setTranslationY(View v, int y) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { - v.setTranslationY(y); - } else { - TranslateAnimation anim = new TranslateAnimation(0, 0, y, y); - anim.setFillAfter(true); - anim.setDuration(0); - v.startAnimation(anim); - } + ViewCompat.setTranslationY(v, y); } @SuppressLint("NewApi") diff --git a/OsmAnd/src/net/osmand/plus/helpers/MapMarkerDialogHelper.java b/OsmAnd/src/net/osmand/plus/helpers/MapMarkerDialogHelper.java index 112b5fd6f6..626a52053f 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/MapMarkerDialogHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/MapMarkerDialogHelper.java @@ -832,7 +832,7 @@ public class MapMarkerDialogHelper { } } - if (markersHelper.isStartFromMyLocation() && prevMyLoc == null && myLoc != null) { + if (selectionMode && markersHelper.isStartFromMyLocation() && prevMyLoc == null && myLoc != null) { if (helperCallbacks != null) { helperCallbacks.showMarkersRouteOnMap(); } else { diff --git a/OsmAnd/src/net/osmand/plus/views/controls/DynamicListView.java b/OsmAnd/src/net/osmand/plus/views/controls/DynamicListView.java index afc5588c2f..7350e6cdb4 100644 --- a/OsmAnd/src/net/osmand/plus/views/controls/DynamicListView.java +++ b/OsmAnd/src/net/osmand/plus/views/controls/DynamicListView.java @@ -457,7 +457,7 @@ public class DynamicListView extends ObservableListView { int switchViewNewTop = switchView.getTop(); int delta = switchViewStartTop - switchViewNewTop; - switchView.setTranslationY(delta); + ViewCompat.setTranslationY(switchView, delta); if (android.os.Build.VERSION.SDK_INT < 12) { ViewCompat.animate(switchView)