summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2017-02-27 16:30:47 -0800
committerTony Wickham <twickham@google.com>2017-03-01 10:16:16 -0800
commit51889b0be83dc34c9752fc066d0d6e75ab4f5e26 (patch)
treeb3c466ce4742e561fc19dce1a1a028a65f28801b /res
parent7f3526a1a4d5d3578d4648abb1422646d23c6080 (diff)
downloadandroid_packages_apps_Trebuchet-51889b0be83dc34c9752fc066d0d6e75ab4f5e26.tar.gz
android_packages_apps_Trebuchet-51889b0be83dc34c9752fc066d0d6e75ab4f5e26.tar.bz2
android_packages_apps_Trebuchet-51889b0be83dc34c9752fc066d0d6e75ab4f5e26.zip
Merge deep shortcuts in rounded rect
- DeepShortcutViews are added to ShortcutsItemView, which is in PopupContainerWithArrow - Moved some shortcut-specific logic to ShortcutsItemView (namely, touch/long-click handling for draggin shortcuts) - Moved round-rect clipping to PopupItemView - Removed collapseToIcon() logic, including PillWidthRevealOutlineProvider, which was only used for that purpose. It isn't necessary now that the deep shortcuts have no background themselves. - Replaced focus pill drawable with ripple effect on shortcuts and notification view. Bug: 35766387 Change-Id: I6bc09f1851cfbb806df4bf75a6e435b0f1900c9c
Diffstat (limited to 'res')
-rw-r--r--res/drawable/bg_pill_focused.xml24
-rw-r--r--res/drawable/bg_white_pill.xml21
-rw-r--r--res/layout/deep_shortcut.xml20
-rw-r--r--res/layout/notification.xml2
-rw-r--r--res/layout/notification_footer.xml2
-rw-r--r--res/layout/shortcuts_item.xml32
-rw-r--r--res/values/dimens.xml13
7 files changed, 54 insertions, 60 deletions
diff --git a/res/drawable/bg_pill_focused.xml b/res/drawable/bg_pill_focused.xml
deleted file mode 100644
index 54075d92c..000000000
--- a/res/drawable/bg_pill_focused.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2016 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_focused="true">
- <shape android:shape="rectangle">
- <stroke android:color="?android:attr/colorControlActivated" android:width="2dp" />
- <corners android:radius="@dimen/bg_pill_radius" />
- </shape>
- </item>
-</selector> \ No newline at end of file
diff --git a/res/drawable/bg_white_pill.xml b/res/drawable/bg_white_pill.xml
deleted file mode 100644
index f92f7394e..000000000
--- a/res/drawable/bg_white_pill.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2016 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="rectangle">
- <solid android:color="#FFFFFF" />
- <corners android:radius="@dimen/bg_pill_radius" />
-</shape> \ No newline at end of file
diff --git a/res/layout/deep_shortcut.xml b/res/layout/deep_shortcut.xml
index 6c1d4da91..b2ed709e2 100644
--- a/res/layout/deep_shortcut.xml
+++ b/res/layout/deep_shortcut.xml
@@ -17,18 +17,16 @@
<com.android.launcher3.shortcuts.DeepShortcutView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res-auto"
- android:layout_width="@dimen/bg_pill_width"
- android:layout_height="@dimen/bg_pill_height"
- android:elevation="@dimen/deep_shortcuts_elevation"
- android:background="@drawable/bg_white_pill" >
+ android:layout_width="@dimen/bg_popup_item_width"
+ android:layout_height="@dimen/bg_popup_item_height" >
<com.android.launcher3.shortcuts.DeepShortcutTextView
style="@style/BaseIcon"
android:id="@+id/deep_shortcut"
- android:background="@drawable/bg_pill_focused"
+ android:background="?android:attr/selectableItemBackground"
android:gravity="start|center_vertical"
android:textAlignment="viewStart"
- android:paddingStart="@dimen/bg_pill_height"
+ android:paddingStart="@dimen/bg_popup_item_height"
android:paddingEnd="@dimen/deep_shortcut_padding_end"
android:drawableEnd="@drawable/deep_shortcuts_drag_handle"
android:drawablePadding="@dimen/deep_shortcut_drawable_padding"
@@ -40,10 +38,18 @@
android:elevation="@dimen/deep_shortcuts_elevation" />
<View
- android:id="@+id/popup_item_icon"
+ android:id="@+id/icon"
android:layout_width="@dimen/deep_shortcut_icon_size"
android:layout_height="@dimen/deep_shortcut_icon_size"
android:layout_margin="@dimen/deep_shortcut_padding_start"
android:layout_gravity="start" />
+ <View
+ android:id="@+id/divider"
+ android:layout_width="@dimen/deep_shortcuts_divider_width"
+ android:layout_height="@dimen/popup_item_divider_height"
+ android:layout_gravity="end|bottom"
+ android:visibility="gone"
+ android:background="?android:attr/listDivider" />
+
</com.android.launcher3.shortcuts.DeepShortcutView>
diff --git a/res/layout/notification.xml b/res/layout/notification.xml
index 48c7b48b9..e148cbb44 100644
--- a/res/layout/notification.xml
+++ b/res/layout/notification.xml
@@ -17,7 +17,7 @@
<com.android.launcher3.notification.NotificationItemView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/notification_view"
- android:layout_width="@dimen/bg_pill_width"
+ android:layout_width="@dimen/bg_popup_item_width"
android:layout_height="wrap_content"
android:elevation="@dimen/deep_shortcuts_elevation"
android:background="@drawable/bg_white_round_rect">
diff --git a/res/layout/notification_footer.xml b/res/layout/notification_footer.xml
index c025819a2..54282086c 100644
--- a/res/layout/notification_footer.xml
+++ b/res/layout/notification_footer.xml
@@ -26,7 +26,7 @@
<View
android:id="@+id/divider"
android:layout_width="match_parent"
- android:layout_height="@dimen/notification_divider_height"/>
+ android:layout_height="@dimen/popup_item_divider_height"/>
<LinearLayout
android:id="@+id/icon_row"
diff --git a/res/layout/shortcuts_item.xml b/res/layout/shortcuts_item.xml
new file mode 100644
index 000000000..8b20bcbdc
--- /dev/null
+++ b/res/layout/shortcuts_item.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<com.android.launcher3.shortcuts.ShortcutsItemView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/shortcuts_view"
+ android:layout_width="@dimen/bg_popup_item_width"
+ android:layout_height="wrap_content"
+ android:elevation="@dimen/deep_shortcuts_elevation"
+ android:background="@drawable/bg_white_round_rect">
+
+ <LinearLayout
+ android:id="@+id/deep_shortcuts"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+ </LinearLayout>
+
+</com.android.launcher3.shortcuts.ShortcutsItemView>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 177e08e2f..8fee26b0b 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -150,10 +150,9 @@
<!-- Deep shortcuts -->
<dimen name="deep_shortcuts_elevation">9dp</dimen>
- <dimen name="bg_pill_width">208dp</dimen>
- <dimen name="bg_pill_height">48dp</dimen>
- <dimen name="bg_pill_radius">24dp</dimen>
- <dimen name="deep_shortcuts_spacing">4dp</dimen>
+ <dimen name="bg_popup_item_width">208dp</dimen>
+ <dimen name="bg_popup_item_height">48dp</dimen>
+ <dimen name="popup_items_spacing">4dp</dimen>
<dimen name="pre_drag_view_scale">6dp</dimen>
<!-- an icon with shortcuts must be dragged this far before the container is removed. -->
<dimen name="deep_shortcuts_start_drag_threshold">16dp</dimen>
@@ -171,6 +170,8 @@
deep_shortcut_padding_end + deep_shortcut_drag_handle_size / 2 - deep_shortcuts_arrow_width / 2
also happens to equal 19dp-->
<dimen name="deep_shortcuts_arrow_horizontal_offset">19dp</dimen>
+ <!-- popup_item_width - icon_size - padding_start - drawable_padding -->
+ <dimen name="deep_shortcuts_divider_width">158dp</dimen>
<!-- Icon badges (with notification counts) -->
<dimen name="badge_size">24dp</dimen>
@@ -186,9 +187,9 @@
<!-- (icon_size - footer_icon_size) / 2 -->
<dimen name="notification_footer_icon_row_padding">2dp</dimen>
<dimen name="notification_main_height">60dp</dimen>
- <dimen name="notification_footer_height">@dimen/bg_pill_height</dimen>
+ <dimen name="notification_footer_height">@dimen/bg_popup_item_height</dimen>
<dimen name="notification_elevation">2dp</dimen>
- <dimen name="notification_divider_height">0.5dp</dimen>
+ <dimen name="popup_item_divider_height">0.5dp</dimen>
<dimen name="swipe_helper_falsing_threshold">70dp</dimen>
<!-- Other -->