summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2016-04-28 17:39:03 -0700
committerTony Wickham <twickham@google.com>2016-06-29 17:48:46 -0700
commit1bce7fd342875be8f7c1f82c8cf21d0199c8d544 (patch)
tree44871413914606a046e9f4dcf24d3ee3bd1a8756 /res
parent3ccedd234acb1534190c596351cf293e8ef4727a (diff)
downloadandroid_packages_apps_Trebuchet-1bce7fd342875be8f7c1f82c8cf21d0199c8d544.tar.gz
android_packages_apps_Trebuchet-1bce7fd342875be8f7c1f82c8cf21d0199c8d544.tar.bz2
android_packages_apps_Trebuchet-1bce7fd342875be8f7c1f82c8cf21d0199c8d544.zip
Long-press on an app to reveal its shortcuts.
- Add ShortcutsContainerListener to icons on workspace, folders, and all apps. This handles long-press and forwards following touches to the DeepShortcutsContainer that is created. - Drag over shortcut before lifting finger to launch it. - Shortcuts are rendered in pill-shaped DeepShortcutViews, which are inside DeepShortcutContainer on DragLayer. - The shortcut container orients above or below the icon, and left or right-aligns with it. Biases for above + left-align. - Long press a DeepShortcutPill to drag and pin it to the workspace. Bug: 28980830 Change-Id: I08658d13ae51fe53064644e8d8f7b42f150fdd7d
Diffstat (limited to 'res')
-rw-r--r--res/drawable/bg_white_pill.xml22
-rw-r--r--res/layout/deep_shortcut.xml20
-rw-r--r--res/layout/deep_shortcuts_container.xml25
-rw-r--r--res/values/dimens.xml10
-rw-r--r--res/values/styles.xml16
5 files changed, 92 insertions, 1 deletions
diff --git a/res/drawable/bg_white_pill.xml b/res/drawable/bg_white_pill.xml
new file mode 100644
index 000000000..29c3145cc
--- /dev/null
+++ b/res/drawable/bg_white_pill.xml
@@ -0,0 +1,22 @@
+<?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="@color/quantum_panel_bg_color" />
+ <size android:height="48dp" />
+ <corners android:radius="24dp" />
+</shape> \ No newline at end of file
diff --git a/res/layout/deep_shortcut.xml b/res/layout/deep_shortcut.xml
new file mode 100644
index 000000000..b87923564
--- /dev/null
+++ b/res/layout/deep_shortcut.xml
@@ -0,0 +1,20 @@
+<?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.
+-->
+
+<com.android.launcher3.shortcuts.DeepShortcutView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/Icon.DeepShortcut"
+ android:focusable="true"/>
diff --git a/res/layout/deep_shortcuts_container.xml b/res/layout/deep_shortcuts_container.xml
new file mode 100644
index 000000000..0441995f1
--- /dev/null
+++ b/res/layout/deep_shortcuts_container.xml
@@ -0,0 +1,25 @@
+<?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.
+-->
+
+<com.android.launcher3.shortcuts.DeepShortcutsContainer
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/deep_shortcuts_container"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:elevation="@dimen/deep_shortcuts_elevation"
+ android:orientation="vertical">
+
+</com.android.launcher3.shortcuts.DeepShortcutsContainer> \ No newline at end of file
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 02c6c704d..c7dd3753b 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -154,4 +154,14 @@
<dimen name="pending_widget_min_padding">8dp</dimen>
<dimen name="pending_widget_elevation">2dp</dimen>
+<!-- Deep shortcuts -->
+ <dimen name="deep_shortcuts_elevation">9dp</dimen>
+ <dimen name="deep_shortcuts_width">180dp</dimen>
+ <dimen name="deep_shortcuts_spacing">4dp</dimen>
+ <dimen name="deep_shortcuts_drag_view_scale">6dp</dimen>
+ <!-- an icon with shortcuts must be dragged this much distance away from the nearest edge
+ of the shortcut container before the container is removed. -->
+ <dimen name="deep_shortcuts_start_drag_threshold">35dp</dimen>
+ <dimen name="deep_shortcut_icon_size">36dp</dimen>
+
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 0bfd0a041..a1ba0b0b5 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -70,6 +70,21 @@
<item name="customShadows">false</item>
</style>
+ <style name="Icon.DeepShortcut">
+ <item name="android:background">@drawable/bg_white_pill</item>
+ <item name="android:gravity">start|center_vertical</item>
+ <item name="android:minWidth">@dimen/deep_shortcuts_width</item>
+ <item name="android:maxWidth">@dimen/deep_shortcuts_width</item>
+ <item name="android:elevation">@dimen/deep_shortcuts_elevation</item>
+ <item name="android:paddingLeft">7dp</item>
+ <item name="android:drawablePadding">12dp</item>
+ <item name="android:textColor">@color/quantum_panel_text_color</item>
+ <item name="android:shadowRadius">0</item>
+ <item name="customShadows">false</item>
+ <item name="layoutHorizontal">true</item>
+ <item name="iconSizeOverride">@dimen/deep_shortcut_icon_size</item>
+ </style>
+
<!-- Drop targets -->
<style name="DropTargetButtonBase">
<item name="android:drawablePadding">7.5dp</item>
@@ -99,5 +114,4 @@
<item name="indicatorSize">4dp</item>
<item name="ringOutset">4dp</item>
</style>
-
</resources>