diff options
author | alexzatsepin <az@mapswithme.com> | 2016-12-07 13:48:37 +0300 |
---|---|---|
committer | alexzatsepin <az@mapswithme.com> | 2016-12-07 16:58:18 +0300 |
commit | dbc2b755b4bc445e236239e0e1cffad63aaa1b8a (patch) | |
tree | 37cc19d3b06d246f152b099d84df24110335bddb /android | |
parent | 5024f06f8dc7841224d0650c9f6324441e511bcf (diff) |
[android] Fixed review notes
Diffstat (limited to 'android')
3 files changed, 15 insertions, 20 deletions
diff --git a/android/src/com/mapswithme/maps/MwmActivity.java b/android/src/com/mapswithme/maps/MwmActivity.java index 4a87d892cd..8f64c8a8b0 100644 --- a/android/src/com/mapswithme/maps/MwmActivity.java +++ b/android/src/com/mapswithme/maps/MwmActivity.java @@ -1140,7 +1140,6 @@ public class MwmActivity extends BaseMwmFragmentActivity @Override public void onPreviewVisibilityChanged(boolean isVisible) { - if (mVisibleRectMeasurer != null) mVisibleRectMeasurer.setPreviewVisible(isVisible); diff --git a/android/src/com/mapswithme/maps/NavigationButtonsAnimationController.java b/android/src/com/mapswithme/maps/NavigationButtonsAnimationController.java index 01dfce506e..116ccbe2f5 100644 --- a/android/src/com/mapswithme/maps/NavigationButtonsAnimationController.java +++ b/android/src/com/mapswithme/maps/NavigationButtonsAnimationController.java @@ -1,6 +1,5 @@ package com.mapswithme.maps; -import android.content.res.Resources; import android.support.annotation.NonNull; import android.view.View; @@ -102,7 +101,7 @@ class NavigationButtonsAnimationController return; // If the top limit is decreased we try to return zoom buttons at initial position. - if (newTop < mTopLimit && tryPlaceZoomButtonsInInitialPosition()) + if (newTop < mTopLimit && tryPlaceZoomButtonsAtInitialPosition()) { LOGGER.d("Zoom buttons were come back to initial position"); return; @@ -122,29 +121,27 @@ class NavigationButtonsAnimationController } } - private boolean tryPlaceZoomButtonsInInitialPosition() + private boolean tryPlaceZoomButtonsAtInitialPosition() { float availableSpace = mBottomLimit - mTopLimit; float requiredSpace = mBottomLimit - mZoomIn.getTop() - mZoomIn.getTranslationY(); - if (requiredSpace < availableSpace) - { - mZoomIn.setTranslationY(0); - mZoomOut.setTranslationY(0); - return true; - } - return false; + if (requiredSpace > availableSpace) + return false; + + mZoomIn.setTranslationY(0); + mZoomOut.setTranslationY(0); + return true; } private boolean tryPlaceZoomButtonsUnderTopLimit() { - if (canZoomButtonsFitInScreen()) - { - float requiredTranslate = mTopLimit - mZoomIn.getTop(); - mZoomIn.setTranslationY(requiredTranslate); - mZoomOut.setTranslationY(requiredTranslate); - return true; - } - return false; + if (!canZoomButtonsFitInScreen()) + return false; + + float requiredTranslate = mTopLimit - mZoomIn.getTop(); + mZoomIn.setTranslationY(requiredTranslate); + mZoomOut.setTranslationY(requiredTranslate); + return true; } private boolean canZoomButtonsFitInScreen() diff --git a/android/src/com/mapswithme/maps/traffic/widget/TrafficButtonController.java b/android/src/com/mapswithme/maps/traffic/widget/TrafficButtonController.java index 53952e6d8d..9cec0b09e6 100644 --- a/android/src/com/mapswithme/maps/traffic/widget/TrafficButtonController.java +++ b/android/src/com/mapswithme/maps/traffic/widget/TrafficButtonController.java @@ -53,7 +53,6 @@ public class TrafficButtonController implements TrafficManager.TrafficCallback mButton.turnOn(); //TODO: put localized string Toast.makeText(mActivity, "There is not traffic data here", Toast.LENGTH_SHORT).show(); - } @Override |