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

@ -165,11 +165,12 @@ public class PlaybackControlsFragment extends Fragment implements MusicServiceEv
}
private void setUpPlayPauseFab() {
updatePlayPauseDrawableState(false);
playPauseFab.setImageDrawable(playerFabPlayPauseDrawable);
final int fabColor = Color.WHITE;
TintHelper.setTintAuto(playPauseFab, fabColor, true);
// because of our custom drawable we have to set the tint manually
updatePlayPauseDrawableState(false);
// Note: set the drawable AFTER TintHelper.setTintAuto() is called
playPauseFab.setImageDrawable(playerFabPlayPauseDrawable);
playPauseFab.getDrawable().mutate().setColorFilter(MaterialValueHelper.getPrimaryTextColor(getContext(), ColorUtil.isColorLight(fabColor)), PorterDuff.Mode.SRC_IN);
playPauseFab.setOnClickListener(new PlayPauseButtonOnClickHandler());
playPauseFab.post(new Runnable() {