[android] Fixed the "crown" behaviour - too many appearances

This commit is contained in:
Dmitry Donskoy 2019-09-10 18:27:09 +03:00 committed by Aleksandr Zatsepin
parent ad6e632d65
commit 18d06b4a7a
2 changed files with 9 additions and 5 deletions

View file

@ -719,11 +719,15 @@ public class MwmActivity extends BaseMwmFragmentActivity
initToggleMapLayerController(frame);
View openSubsScreenBtn = frame.findViewById(R.id.subs_screen_btn);
mNavAnimationController = new NavigationButtonsAnimationController(
zoomIn, zoomOut, myPosition, getWindow().getDecorView().getRootView(), this, openSubsScreenBtn);
boolean hasCrownView = Framework.nativeNeedToShowCrown();
openSubsScreenBtn.setOnClickListener(v -> onCrownClicked());
UiUtils.showIf(Framework.nativeNeedToShowCrown(), openSubsScreenBtn);
mNavAnimationController = new NavigationButtonsAnimationController(
zoomIn, zoomOut, myPosition, getWindow().getDecorView().getRootView(), this,
hasCrownView ? openSubsScreenBtn : null);
UiUtils.showIf(hasCrownView, openSubsScreenBtn);
if (hasCrownView)
openSubsScreenBtn.setOnClickListener(v -> onCrownClicked());
}
private void onCrownClicked()

View file

@ -37,7 +37,7 @@ class NavigationButtonsAnimationController
NavigationButtonsAnimationController(@NonNull View zoomIn, @NonNull View zoomOut,
@NonNull View myPosition, @NonNull final View contentView,
@Nullable OnTranslationChangedListener translationListener,
@NonNull View crownView)
@Nullable View crownView)
{
mZoomIn = zoomIn;
mZoomOut = zoomOut;