summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-10-08 17:43:48 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-10-10 14:17:16 -0700
commit5d9fb0e92f2ef2b25f3aa93c1f89838ccc68aa88 (patch)
tree46764e909a89e51c294ca23b0eed69a481fa9333 /res
parent631ffbda64b92b843f18af6756b52b1ac4c22461 (diff)
downloadandroid_packages_apps_Trebuchet-5d9fb0e92f2ef2b25f3aa93c1f89838ccc68aa88.tar.gz
android_packages_apps_Trebuchet-5d9fb0e92f2ef2b25f3aa93c1f89838ccc68aa88.tar.bz2
android_packages_apps_Trebuchet-5d9fb0e92f2ef2b25f3aa93c1f89838ccc68aa88.zip
Simplifying fast scroller logic
> Using a separate view for drawing the popup. This allows us to use elevation property instead of drawing the shadow as bitmap. > During the thumb animation, invalidating the full track width, instead of invalidating the track and thumb separately. > The thumb path is calculated at 0,0 and drawn using canvas.translate(). This avoids recalculating the path on every scroll. Change-Id: I48741e5b4432df0d939016db284d7aaf52cc2aa6
Diffstat (limited to 'res')
-rw-r--r--res/layout/all_apps.xml16
-rw-r--r--res/layout/widgets_view.xml16
-rw-r--r--res/values/dimens.xml1
3 files changed, 33 insertions, 0 deletions
diff --git a/res/layout/all_apps.xml b/res/layout/all_apps.xml
index 926883927..d48bd500e 100644
--- a/res/layout/all_apps.xml
+++ b/res/layout/all_apps.xml
@@ -55,6 +55,22 @@
android:focusable="true"
android:theme="@style/CustomOverscroll.Light" />
+ <!-- Fast scroller popup -->
+ <TextView
+ android:background="@drawable/container_fastscroll_popup_bg"
+ android:layout_width="@dimen/container_fastscroll_popup_size"
+ android:layout_height="@dimen/container_fastscroll_popup_size"
+ android:textSize="@dimen/container_fastscroll_popup_text_size"
+ android:layout_below="@+id/search_container"
+ android:id="@+id/fast_scroller_popup"
+ android:layout_alignParentEnd="true"
+ android:gravity="center"
+ android:alpha="0"
+ android:elevation="3dp"
+ android:saveEnabled="false"
+ android:layout_marginEnd="@dimen/container_fastscroll_popup_margin"
+ android:textColor="@android:color/white" />
+
<FrameLayout
android:id="@+id/search_container"
android:layout_width="match_parent"
diff --git a/res/layout/widgets_view.xml b/res/layout/widgets_view.xml
index c4431be25..2cf951938 100644
--- a/res/layout/widgets_view.xml
+++ b/res/layout/widgets_view.xml
@@ -49,6 +49,22 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
+ <!-- Fast scroller popup -->
+ <TextView
+ android:background="@drawable/container_fastscroll_popup_bg"
+ android:layout_width="@dimen/container_fastscroll_popup_size"
+ android:layout_height="@dimen/container_fastscroll_popup_size"
+ android:textSize="@dimen/container_fastscroll_popup_text_size"
+ android:layout_below="@+id/search_container"
+ android:id="@+id/fast_scroller_popup"
+ android:elevation="3dp"
+ android:gravity="center"
+ android:alpha="0"
+ android:saveEnabled="false"
+ android:layout_gravity="top|end"
+ android:layout_marginEnd="@dimen/container_fastscroll_popup_margin"
+ android:textColor="@android:color/white" />
+
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 12e902ac3..7f778d6d4 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -54,6 +54,7 @@
<dimen name="container_fastscroll_thumb_min_width">5dp</dimen>
<dimen name="container_fastscroll_thumb_max_width">9dp</dimen>
+ <dimen name="container_fastscroll_popup_margin">18dp</dimen>
<dimen name="container_fastscroll_thumb_height">72dp</dimen>
<dimen name="container_fastscroll_thumb_touch_inset">-24dp</dimen>
<dimen name="container_fastscroll_popup_size">72dp</dimen>