am 7d2630c4: am 385b037d: am 86385d7b: am b08e15be: Merge "Fix custom Snackbar durations not working" into lmp-mr1-ub-dev

* commit '7d2630c4db174a787cf939e63f8f828f965e8317':
  Fix custom Snackbar durations not working

GitOrigin-RevId=7ed439d59a37ce40c420a393df42b1ea78c2c6e5

PiperOrigin-RevId: 140548709
This commit is contained in:
Chris Banes 2016-11-30 01:18:50 +00:00 committed by Travis Collins
parent 8f02c50f98
commit 2d2a80e2f4

View File

@ -200,11 +200,14 @@ class SnackbarManager {
}
private void scheduleTimeoutLocked(SnackbarRecord r) {
int durationMs = LONG_DURATION_MS;
if (r.duration > 0) {
durationMs = r.duration;
} else if (r.duration == Snackbar.LENGTH_SHORT) {
durationMs = SHORT_DURATION_MS;
}
mHandler.removeCallbacksAndMessages(r);
mHandler.sendMessageDelayed(Message.obtain(mHandler, MSG_TIMEOUT, r),
r.duration == Snackbar.LENGTH_LONG
? LONG_DURATION_MS
: SHORT_DURATION_MS);
mHandler.sendMessageDelayed(Message.obtain(mHandler, MSG_TIMEOUT, r), durationMs);
}
private void handleTimeout(SnackbarRecord record) {