Created
October 28, 2018 17:08
-
-
Save tunjid/95c679af193e63da2eac33a622420e0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
animator.addIndicatorWatcher((indicator, position, fraction, totalTranslation) -> { | |
double radians = Math.PI * fraction; | |
float sine = (float) -Math.sin(radians); | |
float cosine = (float) Math.cos(radians); | |
float maxScale = Math.max(Math.abs(cosine), 0.4F); | |
ImageView currentIndicator = animator.getIndicatorAt(position); | |
currentIndicator.setScaleX(maxScale); | |
currentIndicator.setScaleY(maxScale); | |
indicator.setTranslationY(indicatorSize * sine); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment