Only update FAB state if last state is different from new state

This commit is contained in:
Phillip Hsu 2016-08-25 15:34:18 -07:00
parent e99b964d9b
commit eaff0fcb5d

View File

@ -440,7 +440,10 @@ public class NumpadTimePicker extends GridLayoutNumpad {
} }
private void updateFabState() { private void updateFabState() {
final boolean lastEnabled = mFab.isEnabled();
mFab.setEnabled(checkTimeValid()); mFab.setEnabled(checkTimeValid());
if (lastEnabled == mFab.isEnabled())
return;
// Workaround for mFab.setBackgroundTintList() because I don't know how to reference the // Workaround for mFab.setBackgroundTintList() because I don't know how to reference the
// correct accent color in XML. Also because I don't want to programmatically create a // correct accent color in XML. Also because I don't want to programmatically create a
// ColorStateList. // ColorStateList.