6729f0b950
This will help enable transitions between A-Z apps lists and search results because both can be seen simultaneously and manipulated independently. Some high level items of the refactor: - SearchRecyclerView is added; logic that populated the main (personal) tab with search results was simply redirected to this RV instead. - BaseAllAppsContainerView added isSearching() method. Returns false, and ActivityAllAppsContainerView overrides (as search is handled there). - Renamed BaseRecyclerView to FastScrollRecyclerView to better describe what it does. SearchRecyclerView extends this, but returns false for supportsFastScrolling(). - AlphabeticalAppsList#mAllAppsStore is now optional, so the Search RV doesn't need to store/listen to apps. Note this doesn't affect the predicted app row which is still updated if one of the predicted apps is uninstalled (I tested this). Future work: - Determine why dispatchRestoreInstanceState is not called for BaseAllAppsContainerView. Save is called, e.g. on rotation. Effect of restore not called: rotating while searching goes back to A-Z list. - Keep suggested apps in Header while searching. Currently they are rendered in the SearchRV above search results, as before. - Potentially extract Personal/Work tabs to move independently of header. - AlphabeticalAppsList is a misleading name because it can also contains search results. However, things are pretty intertwined between that and BaseAllAppsAdapter (effectively a circular dependency), so I figured cleaning all that up was out of the immediate scope of this refactor, which is mainly meant to unblock transition work. Bug: 206905515 Test: Manually checked for regressions, ran tests. Change-Id: I4d3757c8a8f9b774956ca6be541dd4fcdad1de13
58 lines
2.3 KiB
XML
58 lines
2.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2016 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.
|
|
-->
|
|
<!-- 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.LauncherAllAppsContainerView xmlns:android="http://schemas.android.com/apk/res/android"
|
|
android:id="@+id/apps_view"
|
|
android:theme="?attr/allAppsTheme"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:clipChildren="true"
|
|
android:clipToPadding="false"
|
|
android:focusable="false"
|
|
android:saveEnabled="false">
|
|
|
|
<include
|
|
layout="@layout/all_apps_bottom_sheet_background"
|
|
android:visibility="gone" />
|
|
|
|
<include
|
|
layout="@layout/search_results_rv_layout"
|
|
android:visibility="gone" />
|
|
|
|
<include
|
|
layout="@layout/all_apps_rv_layout"
|
|
android:visibility="gone" />
|
|
|
|
<com.android.launcher3.allapps.FloatingHeaderView
|
|
android:id="@+id/all_apps_header"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:clipToPadding="false"
|
|
android:paddingTop="@dimen/all_apps_header_top_padding"
|
|
android:paddingBottom="@dimen/all_apps_header_bottom_padding"
|
|
android:orientation="vertical" >
|
|
|
|
<include layout="@layout/floating_header_content" />
|
|
|
|
<include layout="@layout/all_apps_personal_work_tabs" />
|
|
|
|
</com.android.launcher3.allapps.FloatingHeaderView>
|
|
|
|
<include layout="@layout/search_container_all_apps" />
|
|
|
|
<include layout="@layout/all_apps_fast_scroller" />
|
|
</com.android.launcher3.allapps.LauncherAllAppsContainerView> |