diff options
| author | Abodunrinwa Toki <toki@google.com> | 2015-04-21 20:33:21 +0100 |
|---|---|---|
| committer | Abodunrinwa Toki <toki@google.com> | 2015-04-23 17:33:58 +0000 |
| commit | 0ce3e08a8444c73e63a0f733357581fb4409449a (patch) | |
| tree | 8e6a6991c096ef7a761387d59a7e81f2a6fb93a2 | |
| parent | 6446d97942b6b5b3108d4c8e53410b38497049d8 (diff) | |
| download | frameworks_base-0ce3e08a8444c73e63a0f733357581fb4409449a.zip frameworks_base-0ce3e08a8444c73e63a0f733357581fb4409449a.tar.gz frameworks_base-0ce3e08a8444c73e63a0f733357581fb4409449a.tar.bz2 | |
Fix FloatingToolbar.show()
*Finer cancel animation methods so we call only the necessary ones.
*Don't set the FloatingToolbarPopup content view's alpha to 0
before showing it's popup window.
*FloatingToolbarPopup.dismiss() should run when toolbar is hidden.
Bug: 20456876
Change-Id: I2e7ff5f2ec56af2def0976fa8e770c651daaa3a3
| -rw-r--r-- | core/java/com/android/internal/widget/FloatingToolbar.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/core/java/com/android/internal/widget/FloatingToolbar.java b/core/java/com/android/internal/widget/FloatingToolbar.java index 579cad4..3a1e0ca 100644 --- a/core/java/com/android/internal/widget/FloatingToolbar.java +++ b/core/java/com/android/internal/widget/FloatingToolbar.java @@ -433,15 +433,13 @@ public final class FloatingToolbar { mHidden = false; mDismissed = false; - cancelAllAnimations(); + cancelDismissAndHideAnimations(); + cancelOverflowAnimations(); // Make sure a panel is set as the content. if (mContentContainer.getChildCount() == 0) { setMainPanelAsContent(); } preparePopupContent(); - // If we're yet to show the popup, set the container visibility to zero. - // The "show" animation will make this visible. - mContentContainer.setAlpha(0); mPopupWindow.showAtLocation(mParent, Gravity.NO_GRAVITY, x, y); setTouchableSurfaceInsetsComputer(); runShowAnimation(); @@ -451,12 +449,13 @@ public final class FloatingToolbar { * Gets rid of this popup. If the popup isn't currently showing, this will be a no-op. */ public void dismiss() { - if (!isShowing()) { + if (mDismissed) { return; } mHidden = false; mDismissed = true; + mHideAnimation.cancel(); runDismissAnimation(); setZeroTouchableSurface(); } @@ -499,7 +498,7 @@ public final class FloatingToolbar { return; } - cancelAllAnimations(); + cancelOverflowAnimations(); preparePopupContent(); mPopupWindow.update(x, y, getWidth(), getHeight()); } @@ -563,10 +562,12 @@ public final class FloatingToolbar { mHideAnimation.start(); } - private void cancelAllAnimations() { - mShowAnimation.cancel(); + private void cancelDismissAndHideAnimations() { mDismissAnimation.cancel(); mHideAnimation.cancel(); + } + + private void cancelOverflowAnimations() { mOpenOverflowAnimation.cancel(); mCloseOverflowAnimation.cancel(); } |
