[android] Fixed compass visibility

This commit is contained in:
Александр Зацепин 2017-09-05 19:51:58 +03:00 committed by Vladimir Byko-Ianko
parent 614988ab5f
commit 9f8cd778d6
2 changed files with 15 additions and 7 deletions

View file

@ -1883,9 +1883,17 @@ public class MwmActivity extends BaseMwmFragmentActivity
mPlacePage.refreshViews();
}
private void adjustCompassAndTraffic(int offsetY)
private void adjustCompassAndTraffic(final int offsetY)
{
adjustCompass(offsetY);
addTask(new MapTask()
{
@Override
public boolean run(MwmActivity target)
{
adjustCompass(offsetY);
return true;
}
});
adjustTraffic(0, offsetY);
}
@ -1901,7 +1909,11 @@ public class MwmActivity extends BaseMwmFragmentActivity
return;
int toolbarHeight = mSearchController.getToolbar().getHeight();
adjustCompassAndTraffic(visible ? toolbarHeight : UiUtils.getStatusBarHeight(this));
int offset = mRoutingPlanInplaceController != null
&& mRoutingPlanInplaceController.getHeight() > 0
? mRoutingPlanInplaceController.getHeight() : UiUtils.getStatusBarHeight(this);
adjustCompassAndTraffic(visible ? toolbarHeight : offset);
setNavButtonsTopLimit(visible ? toolbarHeight : 0);
if (mFilterController != null)
{
@ -1934,7 +1946,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
refreshFade();
if (mOnmapDownloader != null)
mOnmapDownloader.updateState(false);
adjustCompass(UiUtils.getCompassYOffset(this));
if (show)
{
mSearchController.clear();

View file

@ -25,9 +25,6 @@ public class RoutingPlanInplaceController extends RoutingPlanController
public void show(final boolean show)
{
if (show == UiUtils.isVisible(mFrame))
return;
if (show)
UiUtils.show(mFrame);