summaryrefslogtreecommitdiffstats
path: root/src/com
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
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')
-rw-r--r--src/com/android/launcher3/anim/RoundedRectRevealOutlineProvider.java2
-rw-r--r--src/com/android/launcher3/folder/FolderAnimationManager.java10
-rw-r--r--src/com/android/launcher3/notification/NotificationItemView.java3
-rw-r--r--src/com/android/launcher3/popup/PopupContainerWithArrow.java18
-rw-r--r--src/com/android/launcher3/shortcuts/ShortcutsItemView.java4
5 files changed, 30 insertions, 7 deletions
diff --git a/src/com/android/launcher3/anim/RoundedRectRevealOutlineProvider.java b/src/com/android/launcher3/anim/RoundedRectRevealOutlineProvider.java
index 7c5fa1ced..d01b26c8f 100644
--- a/src/com/android/launcher3/anim/RoundedRectRevealOutlineProvider.java
+++ b/src/com/android/launcher3/anim/RoundedRectRevealOutlineProvider.java
@@ -56,7 +56,7 @@ public class RoundedRectRevealOutlineProvider extends RevealOutlineAnimation {
@Override
public boolean shouldRemoveElevationDuringAnimation() {
- return true;
+ return false;
}
@Override
diff --git a/src/com/android/launcher3/folder/FolderAnimationManager.java b/src/com/android/launcher3/folder/FolderAnimationManager.java
index 3648c60e1..80eb74d66 100644
--- a/src/com/android/launcher3/folder/FolderAnimationManager.java
+++ b/src/com/android/launcher3/folder/FolderAnimationManager.java
@@ -198,8 +198,14 @@ public class FolderAnimationManager {
play(a, getAnimator(mFolder, SCALE_PROPERTY, initialScale, finalScale));
play(a, getAnimator(mFolderBackground, "color", initialColor, finalColor));
play(a, mFolderIcon.mFolderName.createTextAlphaAnimator(!mIsOpening));
- play(a, new RoundedRectRevealOutlineProvider(initialRadius, finalRadius, startRect,
- endRect).createRevealAnimator(mFolder, !mIsOpening));
+ RoundedRectRevealOutlineProvider outlineProvider = new RoundedRectRevealOutlineProvider(
+ initialRadius, finalRadius, startRect, endRect) {
+ @Override
+ public boolean shouldRemoveElevationDuringAnimation() {
+ return true;
+ }
+ };
+ play(a, outlineProvider.createRevealAnimator(mFolder, !mIsOpening));
// Animate the elevation midway so that the shadow is not noticeable in the background.
int midDuration = mDuration / 2;
diff --git a/src/com/android/launcher3/notification/NotificationItemView.java b/src/com/android/launcher3/notification/NotificationItemView.java
index 0b08ef835..0cd5a4c40 100644
--- a/src/com/android/launcher3/notification/NotificationItemView.java
+++ b/src/com/android/launcher3/notification/NotificationItemView.java
@@ -48,6 +48,7 @@ public class NotificationItemView extends PopupItemView implements LogContainerP
private static final Rect sTempRect = new Rect();
+ private TextView mHeaderText;
private TextView mHeaderCount;
private NotificationMainView mMainView;
private NotificationFooterLayout mFooter;
@@ -70,6 +71,7 @@ public class NotificationItemView extends PopupItemView implements LogContainerP
@Override
protected void onFinishInflate() {
super.onFinishInflate();
+ mHeaderText = (TextView) findViewById(R.id.notification_text);
mHeaderCount = (TextView) findViewById(R.id.notification_count);
mMainView = (NotificationMainView) findViewById(R.id.main_view);
mFooter = (NotificationFooterLayout) findViewById(R.id.footer);
@@ -106,6 +108,7 @@ public class NotificationItemView extends PopupItemView implements LogContainerP
IconPalette.resolveContrastColor(getContext(), palette.dominantColor,
Themes.getAttrColor(getContext(), R.attr.popupColorPrimary));
}
+ mHeaderText.setTextColor(mNotificationHeaderTextColor);
mHeaderCount.setTextColor(mNotificationHeaderTextColor);
}
}
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
diff --git a/src/com/android/launcher3/shortcuts/ShortcutsItemView.java b/src/com/android/launcher3/shortcuts/ShortcutsItemView.java
index 8785a56f9..f6fffe00b 100644
--- a/src/com/android/launcher3/shortcuts/ShortcutsItemView.java
+++ b/src/com/android/launcher3/shortcuts/ShortcutsItemView.java
@@ -35,6 +35,7 @@ import com.android.launcher3.ItemInfo;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAnimUtils;
import com.android.launcher3.R;
+import com.android.launcher3.anim.PropertyListBuilder;
import com.android.launcher3.anim.RoundedRectRevealOutlineProvider;
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.dragndrop.DragView;
@@ -280,6 +281,9 @@ public class ShortcutsItemView extends PopupItemView implements View.OnLongClick
// Make sure the text and icon stay centered in the shortcut.
animation.play(translateYFrom(shortcut.getBubbleText(), heightDiff / 2 * fromDir));
animation.play(translateYFrom(shortcut.getIconView(), heightDiff / 2 * fromDir));
+ // Scale icons back up to full size.
+ animation.play(LauncherAnimUtils.ofPropertyValuesHolder(shortcut.getIconView(),
+ new PropertyListBuilder().scale(1f).build()));
}
return animation;
}