Merge remote-tracking branch 'origin/master'

This commit is contained in:
MadWasp79 2019-11-08 13:30:22 +02:00
commit 4de519c7a0
2 changed files with 16 additions and 8 deletions

View file

@ -913,7 +913,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, IRouteInfo
Animator circleAnimator = ViewAnimationUtils.createCircularReveal(content, centerX, centerY, initialRadius, finalRadius); Animator circleAnimator = ViewAnimationUtils.createCircularReveal(content, centerX, centerY, initialRadius, finalRadius);
animators.add(circleAnimator); animators.add(circleAnimator);
} }
float initialValueScale = show ? 0f : 1f; final float initialValueScale = show ? 0f : 1f;
float finalValueScale = show ? 1f : 0f; float finalValueScale = show ? 1f : 0f;
animators.add(ObjectAnimator.ofFloat(content, View.SCALE_X, initialValueScale, finalValueScale)); animators.add(ObjectAnimator.ofFloat(content, View.SCALE_X, initialValueScale, finalValueScale));
animators.add(ObjectAnimator.ofFloat(content, View.SCALE_Y, initialValueScale, finalValueScale)); animators.add(ObjectAnimator.ofFloat(content, View.SCALE_Y, initialValueScale, finalValueScale));
@ -946,6 +946,8 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, IRouteInfo
content.setTranslationX(0); content.setTranslationX(0);
content.setTranslationY(0); content.setTranslationY(0);
toolbar.setTranslationY(0); toolbar.setTranslationY(0);
content.setScaleX(initialValueScale);
content.setScaleY(initialValueScale);
} }
} }
}); });

View file

@ -639,16 +639,19 @@ public class MapControlsLayer extends OsmandMapLayer {
private void animateMapControls(final boolean show) { private void animateMapControls(final boolean show) {
final View mapHudButtonsOverlay = mapActivity.findViewById(R.id.MapHudButtonsOverlay); final View mapHudButtonsOverlay = mapActivity.findViewById(R.id.MapHudButtonsOverlay);
View mapHudButtonsTop = mapActivity.findViewById(R.id.MapHudButtonsOverlayTop); final View mapHudButtonsTop = mapActivity.findViewById(R.id.MapHudButtonsOverlayTop);
View mapHudButtonsBottom = mapActivity.findViewById(R.id.MapHudButtonsOverlayBottom); final View mapHudButtonsBottom = mapActivity.findViewById(R.id.MapHudButtonsOverlayBottom);
View mapHudButtonsQuickActions = mapActivity.findViewById(R.id.MapHudButtonsOverlayQuickActions); final View mapHudButtonsQuickActions = mapActivity.findViewById(R.id.MapHudButtonsOverlayQuickActions);
AnimatorSet set = new AnimatorSet();
float transTopInitial = show ? -mapHudButtonsTop.getHeight() : 0; final float transTopInitial = show ? -mapHudButtonsTop.getHeight() : 0;
final float transBottomInitial = show ? mapHudButtonsBottom.getHeight() : 0;
final float alphaInitial = show ? 0f : 1f;
float transTopFinal = show ? 0 : -mapHudButtonsTop.getHeight(); float transTopFinal = show ? 0 : -mapHudButtonsTop.getHeight();
float transBottomInitial = show ? mapHudButtonsBottom.getHeight() : 0;
float transBottomFinal = show ? 0 : mapHudButtonsBottom.getHeight(); float transBottomFinal = show ? 0 : mapHudButtonsBottom.getHeight();
float alphaInitial = show ? 0f : 1f;
float alphaFinal = show ? 1f : 0f; float alphaFinal = show ? 1f : 0f;
AnimatorSet set = new AnimatorSet();
set.setDuration(300).playTogether( set.setDuration(300).playTogether(
ObjectAnimator.ofFloat(mapHudButtonsTop, View.TRANSLATION_Y, transTopInitial, transTopFinal), ObjectAnimator.ofFloat(mapHudButtonsTop, View.TRANSLATION_Y, transTopInitial, transTopFinal),
ObjectAnimator.ofFloat(mapHudButtonsBottom, View.TRANSLATION_Y, transBottomInitial, transBottomFinal), ObjectAnimator.ofFloat(mapHudButtonsBottom, View.TRANSLATION_Y, transBottomInitial, transBottomFinal),
@ -668,6 +671,9 @@ public class MapControlsLayer extends OsmandMapLayer {
super.onAnimationEnd(animation); super.onAnimationEnd(animation);
if (!show) { if (!show) {
mapHudButtonsOverlay.setVisibility(View.INVISIBLE); mapHudButtonsOverlay.setVisibility(View.INVISIBLE);
mapHudButtonsTop.setTranslationY(transTopInitial);
mapHudButtonsBottom.setTranslationY(transBottomInitial);
mapHudButtonsQuickActions.setAlpha(alphaInitial);
} }
mapActivity.updateStatusBarColor(); mapActivity.updateStatusBarColor();
} }