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

Commit f74b465c authored by Ale Nijamkin's avatar Ale Nijamkin Committed by Android (Google) Code Review
Browse files

Merge "[TP] App grid support for reset (3/4)." into tm-qpr-dev

parents e694242e 58c5e99d
Loading
Loading
Loading
Loading
+93 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2023 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.
  ~
  -->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:clipChildren="false">

    <FrameLayout
        android:id="@+id/section_header_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <include layout="@layout/section_header" />

    </FrameLayout>

    <com.android.wallpaper.picker.DisplayAspectRatioFrameLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:paddingTop="20dp"
        android:paddingBottom="40dp">

        <include
            android:id="@+id/preview"
            layout="@layout/wallpaper_preview_card"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_gravity="center"/>

    </com.android.wallpaper.picker.DisplayAspectRatioFrameLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_marginHorizontal="24dp"
        android:layout_marginBottom="28dp"
        android:background="@drawable/picker_fragment_background"
        android:paddingBottom="62dp"
        android:clipChildren="false">

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="22dp"
            android:clipChildren="false">

            <androidx.recyclerview.widget.RecyclerView
                android:id="@id/options"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:clipToPadding="false"
                android:paddingHorizontal="16dp"
                android:clipChildren="false" />

            <!--
            This is just an invisible placeholder put in place so that the parent keeps its height
            stable as the RecyclerView updates from 0 items to N items. Keeping it stable allows the
            layout logic to keep the size of the preview container stable as well, which bodes well
            for setting up the SurfaceView for remote rendering without changing its size after the
            content is loaded into the RecyclerView.

            It's critical for any TextViews inside the included layout to have text.
            -->
            <include
                layout="@layout/grid_option_2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="invisible" />

        </FrameLayout>

    </LinearLayout>

</LinearLayout>
+70 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2023 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.
  ~
  -->

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="@dimen/option_item_size"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:gravity="center_horizontal"
    android:clipChildren="false">

    <FrameLayout
        android:layout_width="@dimen/option_item_size"
        android:layout_height="@dimen/option_item_size"
        android:clipChildren="false">

        <ImageView
            android:id="@id/selection_border"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/option_item_border"
            android:alpha="0"
            android:importantForAccessibility="no" />

        <ImageView
            android:id="@id/background"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/option_item_background"
            android:importantForAccessibility="no" />

        <ImageView
            android:id="@id/foreground"
            android:layout_width="58dp"
            android:layout_height="58dp"
            android:layout_gravity="center" />

    </FrameLayout>

    <View
        android:layout_width="0dp"
        android:layout_height="8dp" />

    <TextView
        android:id="@id/text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="@color/text_color_primary"
        android:singleLine="true"
        android:ellipsize="end"
        android:text="Placeholder for stable size calculation, please do not remove."
        tools:ignore="HardcodedText" />

</LinearLayout>
+3 −3
Original line number Diff line number Diff line
@@ -19,15 +19,15 @@
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="@dimen/keyguard_quick_affordance_picker_item_width"
    android:layout_width="@dimen/option_item_size"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:gravity="center_horizontal"
    android:clipChildren="false">

    <FrameLayout
        android:layout_width="@dimen/keyguard_quick_affordance_icon_container_size"
        android:layout_height="@dimen/keyguard_quick_affordance_icon_container_size"
        android:layout_width="@dimen/option_item_size"
        android:layout_height="@dimen/option_item_size"
        android:clipChildren="false">

        <ImageView
+0 −2
Original line number Diff line number Diff line
@@ -150,8 +150,6 @@
    <dimen name="keyguard_quick_affordance_icon_container_size">74dp</dimen>
    <!-- Size for the icon of a quick affordance for the lock screen in the picker experience. -->
    <dimen name="keyguard_quick_affordance_icon_size">24dp</dimen>
    <!-- Width of a single selectable item in the lock screen quick affordance picker. -->
    <dimen name="keyguard_quick_affordance_picker_item_width">74dp</dimen>

    <dimen name="clock_carousel_item_width">190dp</dimen>
    <dimen name="clock_carousel_item_height">380dp</dimen>
+9 −0
Original line number Diff line number Diff line
@@ -21,7 +21,9 @@ import android.os.Handler;
import android.os.Looper;
import android.util.Log;

import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.lifecycle.LiveData;

import com.android.customization.model.CustomizationManager;
import com.android.customization.module.CustomizationInjector;
@@ -110,6 +112,13 @@ public class GridOptionsManager implements CustomizationManager<GridOption> {
        });
    }

    /**
     * Returns an observable that receives a new value each time that the grid options are changed.
     */
    public LiveData<Object> getOptionChangeObservable(@Nullable Handler handler) {
        return mProvider.getOptionChangeObservable(handler);
    }

    /** Call through content provider API to render preview */
    public void renderPreview(Bundle bundle, String gridName,
            PreviewUtils.WorkspacePreviewCallback callback) {
Loading