Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89d5c5a3 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Updating fast scrollbar UI in Landscape

Creating a separate view for FastScrollBar and moving all the relavant logic in
the view.
For protrait, the touch handling is delegated by the recycler view just like before.
For landscape, the dcrollbar does not overlay with recyclerView and handles the touch
itself

Bug: 37015359
Change-Id: Ie1981326457ba739bdf0ac8063db1065f395f133
parent bbe504d2
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2015 The Android Open Source Project
<!-- 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.
@@ -13,13 +13,26 @@
     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"
<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: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
        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
+37 −0
Original line number Diff line number Diff line
<?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
+6 −9
Original line number Diff line number Diff line
@@ -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"
+37 −0
Original line number Diff line number Diff line
<?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
+27 −1
Original line number Diff line number Diff line
@@ -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
Loading