Animation
This commit is contained in:
parent
3c4f9618af
commit
fd8df84e32
1 changed files with 25 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
|||
package net.osmand.plus.routepreparationmenu;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.app.Activity;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Intent;
|
||||
|
@ -179,6 +181,24 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
|
|||
return view;
|
||||
}
|
||||
|
||||
private void testShadowOn() {
|
||||
// buttonsShadow.setAlpha(0f);
|
||||
buttonsShadow.setVisibility(View.VISIBLE);
|
||||
buttonsShadow.animate()
|
||||
.alpha(1f)
|
||||
.setDuration(100)
|
||||
.setListener(null);
|
||||
}
|
||||
|
||||
private void testShadowOff() {
|
||||
// buttonsShadow.setAlpha(0.5f);
|
||||
buttonsShadow.animate()
|
||||
.alpha(0f)
|
||||
.setDuration(100);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void setupCards() {
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
|
@ -602,7 +622,6 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
|
|||
UiUtilities.setupDialogButton(isNightMode(), cancelButton, DialogButtonType.SECONDARY, R.string.shared_string_close);
|
||||
}
|
||||
|
||||
|
||||
private void setupScrollShadow() {
|
||||
final View scrollView = getBottomScrollView();
|
||||
scrollView.getViewTreeObserver().addOnScrollChangedListener(new OnScrollChangedListener() {
|
||||
|
@ -610,7 +629,11 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
|
|||
@Override
|
||||
public void onScrollChanged() {
|
||||
boolean scrollToBottomAvailable = scrollView.canScrollVertically(1);
|
||||
AndroidUiHelper.updateVisibility(buttonsShadow, scrollToBottomAvailable);
|
||||
if (scrollToBottomAvailable) {
|
||||
testShadowOn();
|
||||
} else {
|
||||
testShadowOff();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue