summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/popup/PopupContainerWithArrow.java
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2017-06-22 14:22:40 -0700
committerTony <twickham@google.com>2017-06-27 19:43:18 -0700
commitaa2272f81cc4a62f847db777efda7959cc2b9979 (patch)
tree31fe70125c6918bdde27828d378609310e484da9 /src/com/android/launcher3/popup/PopupContainerWithArrow.java
parentd032d2cea4c453c626832a85c4b7bf5241f237dc (diff)
downloadandroid_packages_apps_Trebuchet-aa2272f81cc4a62f847db777efda7959cc2b9979.tar.gz
android_packages_apps_Trebuchet-aa2272f81cc4a62f847db777efda7959cc2b9979.tar.bz2
android_packages_apps_Trebuchet-aa2272f81cc4a62f847db777efda7959cc2b9979.zip
Popup visual changes
- Don't remove elevation during animation (b/62905720) - Other adjustments (b/35766387) - Add "gutter" between notification and shortcuts - Change shortcuts to always be primary color (e.g. white) - Scale down shortcut icons when notifications present - Apply icon extracted color to "Notifications" header Change-Id: Idf791dc76d15d05d246000ad73810916d7cd1750
Diffstat (limited to 'src/com/android/launcher3/popup/PopupContainerWithArrow.java')
-rw-r--r--src/com/android/launcher3/popup/PopupContainerWithArrow.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
index 77375fa48..425a08d96 100644
--- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java
+++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
@@ -285,9 +285,11 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra
int roundedCorners = ROUNDED_TOP_CORNERS | ROUNDED_BOTTOM_CORNERS;
if (shouldUnroundTopCorners) {
roundedCorners &= ~ROUNDED_TOP_CORNERS;
+ mNotificationItemView.findViewById(R.id.gutter_top).setVisibility(VISIBLE);
}
if (shouldUnroundBottomCorners) {
roundedCorners &= ~ROUNDED_BOTTOM_CORNERS;
+ mNotificationItemView.findViewById(R.id.gutter_bottom).setVisibility(VISIBLE);
}
int backgroundColor = Themes.getAttrColor(mLauncher, R.attr.popupColorTertiary);
mNotificationItemView.setBackgroundWithCorners(backgroundColor, roundedCorners);
@@ -308,9 +310,15 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra
}
if (itemTypeToPopulate != PopupPopulator.Item.SYSTEM_SHORTCUT_ICON
&& numNotifications > 0) {
+ int prevHeight = item.getLayoutParams().height;
// Condense shortcuts height when there are notifications.
item.getLayoutParams().height = res.getDimensionPixelSize(
R.dimen.bg_popup_item_condensed_height);
+ if (item instanceof DeepShortcutView) {
+ float iconScale = (float) item.getLayoutParams().height / prevHeight;
+ ((DeepShortcutView) item).getIconView().setScaleX(iconScale);
+ ((DeepShortcutView) item).getIconView().setScaleY(iconScale);
+ }
}
mShortcutsItemView.addShortcutView(item, itemTypeToPopulate);
if (shouldUnroundBottomCorners) {
@@ -320,8 +328,7 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra
addView(item);
}
}
- int backgroundColor = Themes.getAttrColor(mLauncher, mNotificationItemView == null
- ? R.attr.popupColorPrimary : R.attr.popupColorSecondary);
+ int backgroundColor = Themes.getAttrColor(mLauncher, R.attr.popupColorPrimary);
mShortcutsItemView.setBackgroundWithCorners(backgroundColor, shortcutsItemRoundedCorners);
if (numNotifications > 0) {
mShortcutsItemView.hideShortcuts(mIsAboveIcon, MAX_SHORTCUTS_IF_NOTIFICATIONS);
@@ -864,11 +871,14 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra
}
final ValueAnimator revealAnim = new RoundedRectRevealOutlineProvider(
radius, radius, mStartRect, mEndRect).createRevealAnimator(this, true);
- revealAnim.setDuration((long) res.getInteger(R.integer.config_popupOpenCloseDuration));
+ long revealDuration = (long) res.getInteger(R.integer.config_popupOpenCloseDuration);
+ revealAnim.setDuration(revealDuration);
revealAnim.setInterpolator(new AccelerateDecelerateInterpolator());
// Animate original icon's text back in.
- closeAnim.play(mOriginalIcon.createTextAlphaAnimator(true /* fadeIn */));
+ Animator fadeText = mOriginalIcon.createTextAlphaAnimator(true /* fadeIn */);
+ fadeText.setDuration(revealDuration);
+ closeAnim.play(fadeText);
closeAnim.addListener(new AnimatorListenerAdapter() {
@Override