diff options
author | Lucas Dupin <dupin@google.com> | 2018-05-23 20:15:19 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-05-23 20:15:19 +0000 |
commit | 3116918bf0457f8eb36d37dea0d0e8802bd38b3d (patch) | |
tree | 946977f7c606137fce299d3a7a43b9445409a162 /packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java | |
parent | f021d88cd85a6a10e6f89465ee319702bc71a885 (diff) | |
parent | 3978e6e6ee0852aad0dc62d6abee27568ac9c0d2 (diff) |
Merge "Only animate when the slice is actually animating" into pi-dev
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java index 97cf1e51e1df..52e1c167ffc8 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java @@ -84,10 +84,9 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe private LiveData<Slice> mLiveData; private int mIconSize; /** - * Listener called whenever the view contents change. - * Boolean will be true when the change happens animated. + * Runnable called whenever the view contents change. */ - private Consumer<Boolean> mContentChangeListener; + private Runnable mContentChangeListener; private boolean mHasHeader; private Slice mSlice; private boolean mPulsing; @@ -150,7 +149,9 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe if (mPulsing || mSlice == null) { mTitle.setVisibility(GONE); mRow.setVisibility(GONE); - mContentChangeListener.accept(getLayoutTransition() != null); + if (mContentChangeListener != null) { + mContentChangeListener.run(); + } return; } @@ -223,7 +224,7 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe } if (mContentChangeListener != null) { - mContentChangeListener.accept(getLayoutTransition() != null); + mContentChangeListener.run(); } } @@ -310,11 +311,10 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe } /** - * Listener that gets invoked every time the title or the row visibility changes. - * Parameter will be {@code true} whenever the change happens animated. + * Runnable that gets invoked every time the title or the row visibility changes. * @param contentChangeListener The listener. */ - public void setContentChangeListener(Consumer<Boolean> contentChangeListener) { + public void setContentChangeListener(Runnable contentChangeListener) { mContentChangeListener = contentChangeListener; } |