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

Commit b7483c1d authored by Shamali Patwa's avatar Shamali Patwa Committed by Android (Google) Code Review
Browse files

Merge changes from topic "categories" into main

* changes:
  Initial UI changes for displaying categorized suggestions.
  Use full-width two picker in both orientations in tablets
  Use derived padding instead of static 300dp for large portrait displays
  Align items in the center within each table row within suggestions.
parents f4ed37cb b3a4d65b
Loading
Loading
Loading
Loading
+58 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2024 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">

    <!--
    Shown when there are more than one pages
    Note: on page change, using accessibility live region lets user know that the title has changed.
    -->
    <TextView
        android:id="@+id/recommendations_page_title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="12dp"
        android:layout_marginTop="16dp"
        android:accessibilityLiveRegion="polite"
        android:gravity="center_horizontal"
        android:lineHeight="20sp"
        android:textColor="?attr/widgetPickerTitleColor"
        android:textFontWeight="500"
        android:textSize="16sp"
        android:visibility="gone" />
    <!-- Shown when there are more than one pages -->
    <com.android.launcher3.pageindicators.PageIndicatorDots
        android:id="@+id/widget_recommendations_page_indicator"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:elevation="1dp"
        android:visibility="gone" />
    <!--
     Note: importantForAccessibility = yes on this view ensures that with talkback, when user
     swipes right on the last item in current page, they are taken to the next page. And, doing
     the same on the last page, takes them to the next section e.g. apps list in single pane
     picker.
    -->
    <com.android.launcher3.widget.picker.WidgetRecommendationsView
        android:id="@+id/widget_recommendations_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:background="@drawable/widgets_surface_background"
        android:importantForAccessibility="yes"
        launcher:pageIndicator="@+id/widget_recommendations_page_indicator" />
</merge>
 No newline at end of file
+21 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2024 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.widget.picker.WidgetsRecommendationTableLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingHorizontal="@dimen/widget_recommendations_table_horizontal_padding"
    android:paddingVertical="@dimen/widget_recommendations_table_vertical_padding" />
+8 −5
Original line number Diff line number Diff line
@@ -73,15 +73,18 @@
            <include layout="@layout/widgets_search_bar" />
        </FrameLayout>

        <com.android.launcher3.widget.picker.WidgetsRecommendationTableLayout
            android:id="@+id/recommended_widget_table"
        <!-- Shown when there are recommendations to display -->
        <LinearLayout
            android:id="@+id/widget_recommendations_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:layout_marginHorizontal="@dimen/widget_list_horizontal_margin"
            android:background="@drawable/widgets_surface_background"
            android:paddingVertical="@dimen/recommended_widgets_table_vertical_padding"
            android:visibility="gone" />
            android:orientation="vertical"
            android:layout_marginHorizontal="@dimen/widget_list_horizontal_margin"
            android:visibility="gone">
            <include layout="@layout/widget_recommendations" />
        </LinearLayout>

        <com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip
            android:id="@+id/tabs"
+7 −4
Original line number Diff line number Diff line
@@ -56,14 +56,17 @@
            <include layout="@layout/widgets_search_bar" />
        </FrameLayout>

        <com.android.launcher3.widget.picker.WidgetsRecommendationTableLayout
            android:id="@+id/recommended_widget_table"
        <!-- Shown when there are recommendations to display -->
        <LinearLayout
            android:id="@+id/widget_recommendations_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:background="@drawable/widgets_surface_background"
            android:paddingVertical="@dimen/recommended_widgets_table_vertical_padding"
            android:visibility="gone" />
            android:orientation="vertical"
            android:visibility="gone">
            <include layout="@layout/widget_recommendations" />
        </LinearLayout>
    </com.android.launcher3.views.StickyHeaderLayout>

</merge>
 No newline at end of file
+8 −5
Original line number Diff line number Diff line
@@ -118,13 +118,16 @@
                        android:background="@drawable/widgets_surface_background"
                        android:importantForAccessibility="yes"
                        android:id="@+id/right_pane">
                        <com.android.launcher3.widget.picker.WidgetsRecommendationTableLayout
                            android:id="@+id/recommended_widget_table"
                        <!-- Shown when there are recommendations to display -->
                        <LinearLayout
                            android:id="@+id/widget_recommendations_container"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:paddingHorizontal=
                                "@dimen/widget_list_horizontal_margin_two_pane"
                            android:visibility="gone" />
                            android:background="@drawable/widgets_surface_background"
                            android:orientation="vertical"
                            android:visibility="gone">
                            <include layout="@layout/widget_recommendations" />
                        </LinearLayout>
                    </LinearLayout>
                </ScrollView>
            </FrameLayout>
Loading