Fixed the FAB animation getting stuck in the middle on older versions of Android.

This commit is contained in:
Karim Abou Zeid 2016-02-28 15:57:21 +01:00
commit b98bfa1480
2 changed files with 6 additions and 5 deletions

View file

@ -105,7 +105,7 @@ public class PlayPauseDrawable extends Drawable {
rightPauseBar.lineTo(2 * barWidth + barDist, 0);
rightPauseBar.close();
canvas.save();
final int saveCount = canvas.save();
// Translate the play button a tiny bit to the right so it looks more centered.
canvas.translate(lerp(0, pauseBarHeight / 8f, progress), 0);
@ -123,7 +123,7 @@ public class PlayPauseDrawable extends Drawable {
canvas.drawPath(leftPauseBar, paint);
canvas.drawPath(rightPauseBar, paint);
canvas.restore();
canvas.restoreToCount(saveCount);
}
@NonNull