summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2017-03-20 17:12:24 -0700
committerTony <twickham@google.com>2017-03-30 16:35:56 -0700
commit26b1746593851e239bfff65ae7a69b809ad87b99 (patch)
tree4f5a73f3253d52304a0f105aa03c2a882038b14a /res
parent4a907d0f9d1c80661c086aa95a8509698f38b324 (diff)
downloadandroid_packages_apps_Trebuchet-26b1746593851e239bfff65ae7a69b809ad87b99.tar.gz
android_packages_apps_Trebuchet-26b1746593851e239bfff65ae7a69b809ad87b99.tar.bz2
android_packages_apps_Trebuchet-26b1746593851e239bfff65ae7a69b809ad87b99.zip
Add support for system shortcuts in popup container
- Currently the system shortcuts are just widgets and app info - As shortcuts, they live in ShortcutsItemView - They are populated either as icons only (if there are deep shortcuts) or as icons + text - Widgets are disabled until binding them is complete (we request for them to be bound on long-press now). We should revisit this. Bug: 34940468 Change-Id: Ia51d002c3b3ede87658bdab57abfc3eeca1ed242
Diffstat (limited to 'res')
-rw-r--r--res/layout/deep_shortcut.xml5
-rw-r--r--res/layout/system_shortcut.xml50
-rw-r--r--res/layout/system_shortcut_icon_only.xml23
-rw-r--r--res/layout/system_shortcut_icons.xml25
-rw-r--r--res/layout/widgets_list_row_view.xml16
-rw-r--r--res/values/colors.xml4
-rw-r--r--res/values/dimens.xml2
7 files changed, 107 insertions, 18 deletions
diff --git a/res/layout/deep_shortcut.xml b/res/layout/deep_shortcut.xml
index b2ed709e2..60131e4fb 100644
--- a/res/layout/deep_shortcut.xml
+++ b/res/layout/deep_shortcut.xml
@@ -22,7 +22,7 @@
<com.android.launcher3.shortcuts.DeepShortcutTextView
style="@style/BaseIcon"
- android:id="@+id/deep_shortcut"
+ android:id="@+id/bubble_text"
android:background="?android:attr/selectableItemBackground"
android:gravity="start|center_vertical"
android:textAlignment="viewStart"
@@ -34,8 +34,7 @@
android:fontFamily="sans-serif"
launcher:layoutHorizontal="true"
launcher:iconDisplay="shortcut_popup"
- launcher:iconSizeOverride="@dimen/deep_shortcut_icon_size"
- android:elevation="@dimen/deep_shortcuts_elevation" />
+ launcher:iconSizeOverride="@dimen/deep_shortcut_icon_size" />
<View
android:id="@+id/icon"
diff --git a/res/layout/system_shortcut.xml b/res/layout/system_shortcut.xml
new file mode 100644
index 000000000..3baddc480
--- /dev/null
+++ b/res/layout/system_shortcut.xml
@@ -0,0 +1,50 @@
+<?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.DeepShortcutView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res-auto"
+ android:layout_width="@dimen/bg_popup_item_width"
+ android:layout_height="@dimen/bg_popup_item_height" >
+
+ <com.android.launcher3.BubbleTextView
+ style="@style/BaseIcon"
+ android:id="@+id/bubble_text"
+ android:background="?android:attr/selectableItemBackground"
+ android:gravity="start|center_vertical"
+ android:textAlignment="viewStart"
+ android:paddingStart="@dimen/bg_popup_item_height"
+ android:paddingEnd="@dimen/deep_shortcut_padding_end"
+ android:textSize="14sp"
+ android:fontFamily="sans-serif"
+ launcher:layoutHorizontal="true" />
+
+ <View
+ android:id="@+id/icon"
+ android:layout_width="@dimen/system_shortcut_icon_size"
+ android:layout_height="@dimen/system_shortcut_icon_size"
+ android:layout_margin="@dimen/system_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/system_shortcut_icon_only.xml b/res/layout/system_shortcut_icon_only.xml
new file mode 100644
index 000000000..02d4ef818
--- /dev/null
+++ b/res/layout/system_shortcut_icon_only.xml
@@ -0,0 +1,23 @@
+<?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.
+-->
+
+<ImageView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="@dimen/deep_shortcut_icon_size"
+ android:layout_height="@dimen/deep_shortcut_icon_size"
+ android:background="?android:attr/selectableItemBackground"
+ android:layout_marginEnd="@dimen/deep_shortcut_padding_start"
+ android:padding="4dp" />
diff --git a/res/layout/system_shortcut_icons.xml b/res/layout/system_shortcut_icons.xml
new file mode 100644
index 000000000..bf0a2512a
--- /dev/null
+++ b/res/layout/system_shortcut_icons.xml
@@ -0,0 +1,25 @@
+<?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.
+-->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/system_shortcut_icons"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/bg_popup_item_height"
+ android:paddingEnd="@dimen/deep_shortcut_padding_start"
+ android:orientation="horizontal"
+ android:gravity="end|center_vertical"
+ android:background="@color/notification_header_background_color" />
diff --git a/res/layout/widgets_list_row_view.xml b/res/layout/widgets_list_row_view.xml
index 4067503b7..b6e0a0bd7 100644
--- a/res/layout/widgets_list_row_view.xml
+++ b/res/layout/widgets_list_row_view.xml
@@ -47,19 +47,5 @@
launcher:iconSizeOverride="@dimen/widget_section_icon_size"
launcher:layoutHorizontal="true" />
- <HorizontalScrollView
- android:id="@+id/widgets_scroll_container"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="?android:attr/colorPrimaryDark"
- android:scrollbars="none">
- <LinearLayout
- android:id="@+id/widgets_cell_list"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:paddingStart="@dimen/widget_row_padding"
- android:paddingEnd="0dp"
- android:orientation="horizontal"
- android:showDividers="none"/>
- </HorizontalScrollView>
+ <include layout="@layout/widgets_scroll_container" />
</LinearLayout>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 83a44d7b9..028c98206 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -35,10 +35,14 @@
<color name="spring_loaded_panel_color">#40FFFFFF</color>
<color name="spring_loaded_highlighted_panel_border_color">#FFF</color>
+ <!-- Notifications -->
<color name="notification_icon_default_color">#757575</color> <!-- Gray 600 -->
<color name="notification_header_background_color">#F5F5F5</color> <!-- Gray 100 -->
<color name="notification_background_color">#FFF</color>
<color name="notification_color_beneath">#E0E0E0</color> <!-- Gray 300 -->
<color name="divider_color">@color/notification_color_beneath</color>
<color name="icon_background">#E0E0E0</color> <!-- Gray 300 -->
+
+ <!-- System shortcuts -->
+ <color name="system_shortcuts_icon_color">@android:color/tertiary_text_light</color>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 132ae0700..7b1d24720 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -172,6 +172,8 @@
<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>
+ <dimen name="system_shortcut_icon_size">28dp</dimen>
+ <dimen name="system_shortcut_padding_start">10dp</dimen>
<!-- Icon badges (with notification counts) -->
<dimen name="badge_size">24dp</dimen>