launcher: show smartspace date card on Wallpaper & style

Smartspace requires a lot of information to show cards, and it shouldn't
be required to show a preview for the user on how the home screen looks
like. This changes that to always use the date card from smartspace.

Fixes: 197328474
Test: open Wallpaper & style
Change-Id: I4718a1c0397172f654b7b6b4beb96b50b3b9eeb3
This commit is contained in:
Thales Lima 2021-08-31 12:42:38 +01:00
parent 701c76013c
commit 60936f5eac
2 changed files with 32 additions and 2 deletions

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 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.qsb.QsbContainerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="0dp"
android:id="@id/search_container_workspace"
android:padding="0dp" >
<fragment
android:name="com.android.launcher3.qsb.QsbContainerView$QsbFragment"
android:layout_width="match_parent"
android:tag="qsb_view"
android:layout_height="match_parent"/>
</com.android.launcher3.qsb.QsbContainerView>

View File

@ -511,8 +511,8 @@ public class LauncherPreviewRenderer extends ContextWrapper
// Add first page QSB
if (FeatureFlags.QSB_ON_FIRST_SCREEN) {
CellLayout firstScreen = mWorkspaceScreens.get(FIRST_SCREEN_ID);
View qsb = mHomeElementInflater.inflate(
R.layout.search_container_workspace, firstScreen, false);
View qsb = mHomeElementInflater.inflate(R.layout.qsb_preview, firstScreen,
false);
CellLayout.LayoutParams lp =
new CellLayout.LayoutParams(0, 0, firstScreen.getCountX(), 1);
lp.canReorder = false;