summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/layout-land/all_apps_fast_scroller.xml38
-rw-r--r--res/layout-sw720dp/all_apps_fast_scroller.xml37
-rw-r--r--res/layout/all_apps.xml15
-rw-r--r--res/layout/all_apps_fast_scroller.xml37
-rw-r--r--res/layout/all_apps_search_container.xml28
-rw-r--r--res/layout/all_apps_search_divider.xml25
-rw-r--r--res/layout/widgets_view.xml25
-rw-r--r--res/values/attrs.xml4
-rw-r--r--res/values/dimens.xml10
9 files changed, 174 insertions, 45 deletions
diff --git a/res/layout-land/all_apps_fast_scroller.xml b/res/layout-land/all_apps_fast_scroller.xml
new file mode 100644
index 000000000..957c33174
--- /dev/null
+++ b/res/layout-land/all_apps_fast_scroller.xml
@@ -0,0 +1,38 @@
+<?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.
+-->
+<merge
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res-auto">
+ <!-- Fast scroller popup -->
+ <TextView
+ android:id="@+id/fast_scroller_popup"
+ style="@style/FastScrollerPopup"
+ android:layout_alignParentEnd="true"
+ android:layout_alignTop="@+id/apps_list_view"
+ android:layout_marginEnd="-5dp" />
+
+ <com.android.launcher3.allapps.LandscapeFastScroller
+ android:id="@+id/fast_scroller"
+ android:layout_width="48dp"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentEnd="true"
+ android:layout_alignTop="@+id/apps_list_view"
+ android:layout_marginEnd="-48dp"
+ android:layout_marginTop="-8dp"
+ launcher:canThumbDetach="true" />
+
+</merge> \ No newline at end of file
diff --git a/res/layout-sw720dp/all_apps_fast_scroller.xml b/res/layout-sw720dp/all_apps_fast_scroller.xml
new file mode 100644
index 000000000..12c15cca9
--- /dev/null
+++ b/res/layout-sw720dp/all_apps_fast_scroller.xml
@@ -0,0 +1,37 @@
+<?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.
+-->
+<merge
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res-auto">
+ <!-- Fast scroller popup -->
+ <TextView
+ android:id="@+id/fast_scroller_popup"
+ style="@style/FastScrollerPopup"
+ android:layout_alignParentEnd="true"
+ android:layout_alignTop="@+id/apps_list_view"
+ android:layout_marginEnd="@dimen/fastscroll_popup_margin" />
+
+ <com.android.launcher3.views.RecyclerViewFastScroller
+ android:id="@+id/fast_scroller"
+ android:layout_width="@dimen/fastscroll_width"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentEnd="true"
+ android:layout_alignTop="@+id/apps_list_view"
+ android:layout_marginEnd="@dimen/fastscroll_end_margin"
+ launcher:canThumbDetach="true" />
+
+</merge> \ No newline at end of file
diff --git a/res/layout/all_apps.xml b/res/layout/all_apps.xml
index a3c253537..93662fc08 100644
--- a/res/layout/all_apps.xml
+++ b/res/layout/all_apps.xml
@@ -16,7 +16,8 @@
<!-- The top and bottom paddings are defined in this container, but since we want
the list view to span the full width (for touch interception purposes), we
will bake the left/right padding into that view's background itself. -->
-<com.android.launcher3.allapps.AllAppsContainerView xmlns:android="http://schemas.android.com/apk/res/android"
+<com.android.launcher3.allapps.AllAppsContainerView
+ xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res-auto"
android:id="@+id/apps_view"
android:layout_width="match_parent"
@@ -39,6 +40,8 @@
android:layout_height="match_parent"
android:layout_gravity="center"
android:focusable="true"
+ android:clipToPadding="false"
+ android:clipChildren="true"
android:focusableInTouchMode="true"
android:saveEnabled="false"
android:visibility="gone">
@@ -55,20 +58,14 @@
android:descendantFocusability="afterDescendants"
android:focusable="true" />
- <!-- Fast scroller popup -->
- <TextView
- style="@style/FastScrollerPopup"
- android:layout_alignTop="@+id/apps_list_view"
- android:id="@+id/fast_scroller_popup"
- android:layout_alignParentEnd="true"
- android:layout_marginEnd="@dimen/fastscroll_popup_margin" />
-
<!-- Note: we are reusing/repurposing a system attribute for search layout, because of a
platform bug, which prevents using custom attributes in <include> tag -->
<include
layout="?android:attr/keyboardLayout"
android:id="@+id/search_container" />
+ <include layout="@layout/all_apps_fast_scroller" />
+
</com.android.launcher3.allapps.AllAppsRecyclerViewContainerView>
<View
style="@style/AllAppsNavBarProtection"
diff --git a/res/layout/all_apps_fast_scroller.xml b/res/layout/all_apps_fast_scroller.xml
new file mode 100644
index 000000000..12c15cca9
--- /dev/null
+++ b/res/layout/all_apps_fast_scroller.xml
@@ -0,0 +1,37 @@
+<?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.
+-->
+<merge
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res-auto">
+ <!-- Fast scroller popup -->
+ <TextView
+ android:id="@+id/fast_scroller_popup"
+ style="@style/FastScrollerPopup"
+ android:layout_alignParentEnd="true"
+ android:layout_alignTop="@+id/apps_list_view"
+ android:layout_marginEnd="@dimen/fastscroll_popup_margin" />
+
+ <com.android.launcher3.views.RecyclerViewFastScroller
+ android:id="@+id/fast_scroller"
+ android:layout_width="@dimen/fastscroll_width"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentEnd="true"
+ android:layout_alignTop="@+id/apps_list_view"
+ android:layout_marginEnd="@dimen/fastscroll_end_margin"
+ launcher:canThumbDetach="true" />
+
+</merge> \ No newline at end of file
diff --git a/res/layout/all_apps_search_container.xml b/res/layout/all_apps_search_container.xml
index c79360f66..2528034eb 100644
--- a/res/layout/all_apps_search_container.xml
+++ b/res/layout/all_apps_search_container.xml
@@ -20,13 +20,24 @@
android:layout_height="@dimen/all_apps_search_bar_height"
android:layout_gravity="center|top"
android:gravity="center|bottom"
- android:saveEnabled="false">
+ android:saveEnabled="false"
+ android:paddingLeft="@dimen/dynamic_grid_edge_margin"
+ android:paddingRight="@dimen/dynamic_grid_edge_margin"
+ android:layout_marginBottom="-8dp" >
+ <!--
+ Note: The following relation should always be true so that the shadows are aligned properly
+ search_box_input.layout_marginBottom
+ == search_divider.layout_marginBottom
+ == - (search_container.layout_marginBottom)
+ >= 5dp
+ -->
<com.android.launcher3.ExtendedEditText
android:id="@+id/search_box_input"
android:layout_width="match_parent"
android:layout_height="@dimen/all_apps_search_bar_field_height"
android:layout_gravity="bottom"
+ android:layout_marginBottom="8dp"
android:background="@android:color/transparent"
android:focusableInTouchMode="true"
android:gravity="center"
@@ -39,4 +50,19 @@
android:textColor="?android:attr/textColorSecondary"
android:textColorHint="@drawable/all_apps_search_hint"
android:textSize="16sp" />
+
+ <!-- This needs to be a container with a view, to simulate a scrolling effect for the header.
+ We translate the header down, and its content up by the same amount, so that it gets
+ clipped by the parent, making it look like the divider was scrolled out of the view. -->
+ <FrameLayout
+ android:id="@+id/search_divider"
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:layout_gravity="bottom"
+ android:layout_marginBottom="8dp" >
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:background="@drawable/all_apps_search_divider"/>
+ </FrameLayout>
</com.android.launcher3.allapps.search.AppsSearchContainerLayout> \ No newline at end of file
diff --git a/res/layout/all_apps_search_divider.xml b/res/layout/all_apps_search_divider.xml
deleted file mode 100644
index c052c6635..000000000
--- a/res/layout/all_apps_search_divider.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2015 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:importantForAccessibility="no"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingBottom="@dimen/all_apps_divider_margin_vertical"
- android:paddingLeft="@dimen/dynamic_grid_edge_margin"
- android:paddingRight="@dimen/dynamic_grid_edge_margin"
- android:src="@drawable/all_apps_search_divider"
- android:scaleType="fitXY"
- android:focusable="false" /> \ No newline at end of file
diff --git a/res/layout/widgets_view.xml b/res/layout/widgets_view.xml
index 558556ad8..4f3c7c8df 100644
--- a/res/layout/widgets_view.xml
+++ b/res/layout/widgets_view.xml
@@ -23,25 +23,25 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:descendantFocusability="afterDescendants"
- launcher:revealBackground="@drawable/round_rect_primary"
- android:theme="?attr/widgetsTheme">
+ android:theme="?attr/widgetsTheme"
+ launcher:revealBackground="@drawable/round_rect_primary">
<View
android:id="@+id/reveal_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
- android:focusable="false"
android:elevation="2dp"
+ android:focusable="false"
android:visibility="invisible" />
<FrameLayout
android:id="@+id/main_content"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_gravity="center"
android:elevation="15dp"
- android:visibility="gone"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:visibility="gone">
<com.android.launcher3.widget.WidgetsRecyclerView
android:id="@+id/widgets_list_view"
@@ -50,17 +50,24 @@
<!-- Fast scroller popup -->
<TextView
- style="@style/FastScrollerPopup"
android:id="@+id/fast_scroller_popup"
+ style="@style/FastScrollerPopup"
android:layout_gravity="top|end"
android:layout_marginEnd="@dimen/fastscroll_popup_margin" />
<ProgressBar
+ android:id="@+id/loader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:id="@+id/loader"
android:layout_gravity="center" />
- </FrameLayout>
+ <com.android.launcher3.views.RecyclerViewFastScroller
+ android:id="@+id/fast_scroller"
+ android:layout_width="@dimen/fastscroll_width"
+ android:layout_height="match_parent"
+ android:layout_gravity="end"
+ android:layout_marginEnd="@dimen/fastscroll_end_margin" />
+
+ </FrameLayout>
</com.android.launcher3.widget.WidgetsContainerView> \ No newline at end of file
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 3839eb130..7b52dae5d 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -138,4 +138,8 @@
<attr name="android:elevation" />
<attr name="darkTintColor" format="color"/>
</declare-styleable>
+
+ <declare-styleable name="RecyclerViewFastScroller">
+ <attr name="canThumbDetach" format="boolean" />
+ </declare-styleable>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 71f9edc91..a4dff7190 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -65,7 +65,15 @@
<dimen name="fastscroll_popup_text_size">32dp</dimen>
<dimen name="fastscroll_popup_margin">19dp</dimen>
-<!-- All Apps -->
+ <!--
+ Fast scroller draws the content horizontally centered. The end of the track should be
+ aligned at the end of the container.
+ fastscroll_end_margin = - (fastscroll_width - fastscroll_track_min_width) / 2
+ -->
+ <dimen name="fastscroll_width">58dp</dimen>
+ <dimen name="fastscroll_end_margin">-26dp</dimen>
+
+ <!-- All Apps -->
<dimen name="all_apps_button_scale_down">0dp</dimen>
<dimen name="all_apps_search_bar_field_height">48dp</dimen>
<dimen name="all_apps_search_bar_height">60dp</dimen>