forked from organicmaps/organicmaps
[android] Review fixes.
This commit is contained in:
parent
0894313c17
commit
ab184a3bff
2 changed files with 9 additions and 3 deletions
|
@ -1522,8 +1522,14 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
return;
|
||||
|
||||
int resultOffset = offsetY;
|
||||
if (mNavAnimationController != null && mNavAnimationController.isCollideWithCompass(offsetY))
|
||||
resultOffset = -offsetY;
|
||||
//If the compass is covered by navigation buttons, we move it beyond the visible screen
|
||||
if (mNavAnimationController != null && mNavAnimationController.isConflictWithCompass(offsetY))
|
||||
{
|
||||
int halfHeight = (int)(UiUtils.dimen(R.dimen.compass_height) * 0.5f);
|
||||
int margin = UiUtils.dimen(R.dimen.margin_compass_top)
|
||||
+ UiUtils.dimen(R.dimen.nav_frame_padding);
|
||||
resultOffset = -(offsetY + halfHeight + margin);
|
||||
}
|
||||
|
||||
mMapFragment.setupCompass(resultOffset, true);
|
||||
|
||||
|
|
|
@ -310,7 +310,7 @@ class NavigationButtonsAnimationController
|
|||
mZoomVisible = state.getBoolean(STATE_VISIBLE, false);
|
||||
}
|
||||
|
||||
boolean isCollideWithCompass(int compassOffset)
|
||||
boolean isConflictWithCompass(int compassOffset)
|
||||
{
|
||||
int zoomTop = mZoomIn.getTop();
|
||||
return zoomTop != 0 && zoomTop <= compassOffset + mCompassHeight;
|
||||
|
|
Loading…
Add table
Reference in a new issue