diff options
author | Tony <twickham@google.com> | 2017-07-03 13:35:18 -0700 |
---|---|---|
committer | Tony <twickham@google.com> | 2017-07-06 08:28:33 -0700 |
commit | 67a25b3c4da9e72766993182f87419620faa7e0a (patch) | |
tree | 4468735038fd9c8acefb0778ea77a4b2ffd39988 /src/com/android/launcher3/notification/NotificationItemView.java | |
parent | 2ed276eb13f38e3383eab872b0bff26d569528c1 (diff) | |
download | android_packages_apps_Trebuchet-67a25b3c4da9e72766993182f87419620faa7e0a.tar.gz android_packages_apps_Trebuchet-67a25b3c4da9e72766993182f87419620faa7e0a.tar.bz2 android_packages_apps_Trebuchet-67a25b3c4da9e72766993182f87419620faa7e0a.zip |
Keep gutter aligned when removing notification footer
Bug: 63262764
Change-Id: I94e7978dafc04fc2673a9bb8c6d24ff20641416f
Diffstat (limited to 'src/com/android/launcher3/notification/NotificationItemView.java')
-rw-r--r-- | src/com/android/launcher3/notification/NotificationItemView.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/com/android/launcher3/notification/NotificationItemView.java b/src/com/android/launcher3/notification/NotificationItemView.java index 0cd5a4c40..11f6aa081 100644 --- a/src/com/android/launcher3/notification/NotificationItemView.java +++ b/src/com/android/launcher3/notification/NotificationItemView.java @@ -17,6 +17,8 @@ package com.android.launcher3.notification; import android.animation.Animator; +import android.animation.AnimatorSet; +import android.animation.ObjectAnimator; import android.app.Notification; import android.content.Context; import android.graphics.Rect; @@ -28,7 +30,9 @@ import android.widget.FrameLayout; import android.widget.TextView; import com.android.launcher3.ItemInfo; +import com.android.launcher3.LauncherAnimUtils; import com.android.launcher3.R; +import com.android.launcher3.anim.PropertyResetListener; import com.android.launcher3.anim.RoundedRectRevealOutlineProvider; import com.android.launcher3.graphics.IconPalette; import com.android.launcher3.logging.UserEventDispatcher.LogContainerProvider; @@ -89,6 +93,8 @@ public class NotificationItemView extends PopupItemView implements LogContainerP } public Animator animateHeightRemoval(int heightToRemove, boolean shouldRemoveFromTop) { + AnimatorSet anim = LauncherAnimUtils.createAnimatorSet(); + Rect startRect = new Rect(mPillRect); Rect endRect = new Rect(mPillRect); if (shouldRemoveFromTop) { @@ -96,8 +102,18 @@ public class NotificationItemView extends PopupItemView implements LogContainerP } else { endRect.bottom -= heightToRemove; } - return new RoundedRectRevealOutlineProvider(getBackgroundRadius(), getBackgroundRadius(), - startRect, endRect, mRoundedCorners).createRevealAnimator(this, false); + anim.play(new RoundedRectRevealOutlineProvider(getBackgroundRadius(), getBackgroundRadius(), + startRect, endRect, mRoundedCorners).createRevealAnimator(this, false)); + + View bottomGutter = findViewById(R.id.gutter_bottom); + if (bottomGutter != null && bottomGutter.getVisibility() == VISIBLE) { + Animator translateGutter = ObjectAnimator.ofFloat(bottomGutter, TRANSLATION_Y, + -heightToRemove); + translateGutter.addListener(new PropertyResetListener<>(TRANSLATION_Y, 0f)); + anim.play(translateGutter); + } + + return anim; } public void updateHeader(int notificationCount, @Nullable IconPalette palette) { |