Cap toolbar transitionProgress to 0-1

multisite
Floens 10 years ago
parent 7b5118c4a1
commit ed97dc121f
  1. 2
      Clover/app/src/main/java/org/floens/chan/ui/toolbar/Toolbar.java

@ -173,6 +173,8 @@ public class Toolbar extends LinearLayout implements View.OnClickListener {
throw new IllegalStateException("transitionProgress called while not transitioning"); throw new IllegalStateException("transitionProgress called while not transitioning");
} }
progress = Math.max(0f, Math.min(1f, progress));
final int offset = dp(16); final int offset = dp(16);
toItem.view.setTranslationY((pushing ? offset : -offset) * (1f - progress)); toItem.view.setTranslationY((pushing ? offset : -offset) * (1f - progress));

Loading…
Cancel
Save