Skip to content

Commit

Permalink
[TabLayout] Fixing bug with animation cancelling if tab is double-tapped
Browse files Browse the repository at this point in the history
resolves #3069

PiperOrigin-RevId: 487376299
  • Loading branch information
imhappi authored and raajkumars committed Nov 10, 2022
1 parent 3fc3ec1 commit 857f481
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/java/com/google/android/material/tabs/TabLayout.java
Expand Up @@ -3280,7 +3280,9 @@ private void tweenIndicatorPosition(View startTitle, View endTitle, float fracti
* @param duration The duration over which the animation should take place.
*/
void animateIndicatorToPosition(final int position, int duration) {
if (indicatorAnimator != null && indicatorAnimator.isRunning()) {
if (indicatorAnimator != null
&& indicatorAnimator.isRunning()
&& indicatorPosition != position) {
indicatorAnimator.cancel();
}

Expand Down

0 comments on commit 857f481

Please sign in to comment.