forked from organicmaps/organicmaps
[android] Fixed review notes
This commit is contained in:
parent
5024f06f8d
commit
dbc2b755b4
3 changed files with 15 additions and 20 deletions
|
@ -1140,7 +1140,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
@Override
|
||||
public void onPreviewVisibilityChanged(boolean isVisible)
|
||||
{
|
||||
|
||||
if (mVisibleRectMeasurer != null)
|
||||
mVisibleRectMeasurer.setPreviewVisible(isVisible);
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue