From 00ac9202417cb5023b9990b2f6f33d321378ff26 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 9 Nov 2017 15:24:06 -0800 Subject: [PATCH] Simplifying app icon popup > Using a single linearLayout instead of multiple nested views > Using clipToOutline for rounded corners instead of using canvas.saveLayer > Removing nested view elevations and overdraw > Using LayoutTransition for animating layout changes, instead of manually creating animators Change-Id: I8e57092f52ca5a032a2756594fdd39788acc5a0d --- res/drawable/bg_notification_content.xml | 28 + res/layout/notification.xml | 97 -- res/layout/notification_content.xml | 134 +++ res/layout/notification_footer.xml | 46 - res/layout/notification_gutter.xml | 21 + res/layout/notification_main.xml | 66 -- res/layout/popup_container.xml | 7 +- res/layout/shortcuts_item.xml | 39 - res/layout/system_shortcut_icons.xml | 4 +- res/values/dimens.xml | 2 +- res/values/styles.xml | 7 - src/com/android/launcher3/Launcher.java | 9 +- .../anim/RevealOutlineAnimation.java | 13 +- .../RoundedRectRevealOutlineProvider.java | 20 - .../keyboard/CustomActionsPopup.java | 4 +- .../NotificationFooterLayout.java | 39 +- .../notification/NotificationItemView.java | 180 ++-- .../notification/NotificationMainView.java | 96 +- .../launcher3/popup/BaseActionPopup.java | 599 ------------ .../popup/PopupContainerWithArrow.java | 923 +++++++++++++----- .../launcher3/popup/PopupDataProvider.java | 6 +- .../launcher3/popup/PopupItemView.java | 145 --- .../launcher3/popup/PopupPopulator.java | 214 +--- .../launcher3/popup/SystemShortcut.java | 18 +- .../launcher3/shortcuts/DeepShortcutView.java | 9 +- .../shortcuts/ShortcutsItemView.java | 340 ------- 26 files changed, 1071 insertions(+), 1995 deletions(-) create mode 100644 res/drawable/bg_notification_content.xml delete mode 100644 res/layout/notification.xml create mode 100644 res/layout/notification_content.xml delete mode 100644 res/layout/notification_footer.xml create mode 100644 res/layout/notification_gutter.xml delete mode 100644 res/layout/notification_main.xml delete mode 100644 res/layout/shortcuts_item.xml delete mode 100644 src/com/android/launcher3/popup/BaseActionPopup.java delete mode 100644 src/com/android/launcher3/popup/PopupItemView.java delete mode 100644 src/com/android/launcher3/shortcuts/ShortcutsItemView.java diff --git a/res/drawable/bg_notification_content.xml b/res/drawable/bg_notification_content.xml new file mode 100644 index 0000000000..cf129eba82 --- /dev/null +++ b/res/drawable/bg_notification_content.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/res/layout/notification.xml b/res/layout/notification.xml deleted file mode 100644 index 1eebb434ba..0000000000 --- a/res/layout/notification.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/res/layout/notification_content.xml b/res/layout/notification_content.xml new file mode 100644 index 0000000000..d01be019eb --- /dev/null +++ b/res/layout/notification_content.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/layout/notification_footer.xml b/res/layout/notification_footer.xml deleted file mode 100644 index 86280e0b6d..0000000000 --- a/res/layout/notification_footer.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - diff --git a/res/layout/notification_gutter.xml b/res/layout/notification_gutter.xml new file mode 100644 index 0000000000..10e7f7d68a --- /dev/null +++ b/res/layout/notification_gutter.xml @@ -0,0 +1,21 @@ + + + \ No newline at end of file diff --git a/res/layout/notification_main.xml b/res/layout/notification_main.xml deleted file mode 100644 index f94face1b1..0000000000 --- a/res/layout/notification_main.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/res/layout/popup_container.xml b/res/layout/popup_container.xml index 67db4a5617..c73740771d 100644 --- a/res/layout/popup_container.xml +++ b/res/layout/popup_container.xml @@ -19,11 +19,8 @@ android:id="@+id/deep_shortcuts_container" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingTop="4dp" - android:paddingBottom="4dp" + android:background="?attr/popupColorPrimary" android:clipToPadding="false" android:clipChildren="false" android:elevation="@dimen/deep_shortcuts_elevation" - android:orientation="vertical"> - - \ No newline at end of file + android:orientation="vertical" /> \ No newline at end of file diff --git a/res/layout/shortcuts_item.xml b/res/layout/shortcuts_item.xml deleted file mode 100644 index 7cd996de01..0000000000 --- a/res/layout/shortcuts_item.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - diff --git a/res/layout/system_shortcut_icons.xml b/res/layout/system_shortcut_icons.xml index 34d63e71fe..4daf469589 100644 --- a/res/layout/system_shortcut_icons.xml +++ b/res/layout/system_shortcut_icons.xml @@ -22,6 +22,4 @@ android:orientation="horizontal" android:gravity="end|center_vertical" android:background="?attr/popupColorSecondary" - android:elevation="1dp" - android:outlineProvider="none" /> - + android:clipToPadding="true" /> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 957ec191cb..378249b49a 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -179,6 +179,7 @@ 16dp 10dp 16dp + 4dp 10dp 8dp -2dp @@ -226,7 +227,6 @@ 18dp 52dp - 2dp 18dp 19dp diff --git a/res/values/styles.xml b/res/values/styles.xml index 8129e810f5..8cc4743a32 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -136,13 +136,6 @@ -