summaryrefslogtreecommitdiffstats
path: root/res/layout
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2017-03-20 17:12:24 -0700
committerTony Wickham <twickham@google.com>2017-03-30 15:48:53 -0700
commit50e5165b78c75ccb022f0954699f49c579547115 (patch)
tree754a3dfe45fbed74cb3b122312304cf406226ebf /res/layout
parent8eb0de133154666cd20d0244953ee755b626b44a (diff)
downloadandroid_packages_apps_Trebuchet-50e5165b78c75ccb022f0954699f49c579547115.tar.gz
android_packages_apps_Trebuchet-50e5165b78c75ccb022f0954699f49c579547115.tar.bz2
android_packages_apps_Trebuchet-50e5165b78c75ccb022f0954699f49c579547115.zip
Add WidgetsAndMore bottom sheet
- Contains two rows, one for widgets, and one for "configurable shortcuts" that have customization activities - Extends AbstractFloatingView and uses VerticalPullDetector for touch interactions - No way to show this currently; will add options to popup in followup Bug: 34940468 Change-Id: Iab62c2cb89428f91119c9c86f9db886496c321fd
Diffstat (limited to 'res/layout')
-rw-r--r--res/layout/widgets_and_more.xml80
-rw-r--r--res/layout/widgets_scroll_container.xml32
2 files changed, 112 insertions, 0 deletions
diff --git a/res/layout/widgets_and_more.xml b/res/layout/widgets_and_more.xml
new file mode 100644
index 000000000..7a6d00688
--- /dev/null
+++ b/res/layout/widgets_and_more.xml
@@ -0,0 +1,80 @@
+<?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.widget.WidgetsAndMore
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:padding="8dp"
+ android:background="?android:attr/colorPrimary"
+ android:elevation="@dimen/deep_shortcuts_elevation"
+ android:layout_gravity="bottom">
+
+ <TextView
+ android:id="@+id/title"
+ android:layout_width="match_parent"
+ android:layout_height="48dp"
+ android:gravity="center_horizontal|bottom"
+ android:fontFamily="sans-serif"
+ android:textStyle="bold"
+ android:textColor="?android:attr/textColorPrimary"
+ android:textSize="20sp"/>
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="48dp"
+ android:gravity="center_horizontal|top"
+ android:fontFamily="sans-serif"
+ android:textColor="?android:attr/textColorPrimary"
+ android:textSize="16sp"
+ android:text="@string/long_press_widget_to_add"/>
+
+ <TextView
+ android:id="@+id/widgets_header"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:fontFamily="sans-serif"
+ android:textColor="?android:attr/textColorPrimary"
+ android:textSize="16sp"
+ android:textStyle="bold"
+ android:text="@string/widget_button_text"/>
+
+ <include layout="@layout/widgets_scroll_container"
+ android:id="@+id/widgets"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/widget_row_padding"
+ android:layout_marginBottom="@dimen/widget_row_padding"/>
+
+ <TextView
+ android:id="@+id/shortcuts_header"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:fontFamily="sans-serif"
+ android:textColor="?android:attr/textColorPrimary"
+ android:textSize="16sp"
+ android:textStyle="bold"
+ android:text="@string/widgets_bottom_sheet_custom_shortcuts_section_title"/>
+
+ <include layout="@layout/widgets_scroll_container"
+ android:id="@+id/shortcuts"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/widget_row_padding"
+ android:layout_marginBottom="@dimen/widget_row_padding" />
+
+</com.android.launcher3.widget.WidgetsAndMore> \ No newline at end of file
diff --git a/res/layout/widgets_scroll_container.xml b/res/layout/widgets_scroll_container.xml
new file mode 100644
index 000000000..33c981a31
--- /dev/null
+++ b/res/layout/widgets_scroll_container.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.
+-->
+
+<HorizontalScrollView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ 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="0dp"
+ android:paddingEnd="0dp"
+ android:orientation="horizontal"
+ android:showDividers="none"/>
+</HorizontalScrollView> \ No newline at end of file