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

Commit 15b36ffa authored by Catherine Liang's avatar Catherine Liang Committed by Android (Google) Code Review
Browse files

Merge changes from topic "wpp-revamped-ui-clean-up-grid-option" into main

* changes:
  Pre-revamped UI cleanup grid option rename
  Pre-revamped UI unused grid option cleanup
parents a68a254b 2d07c7a4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@
            It's critical for any TextViews inside the included layout to have text.
            -->
            <include
                layout="@layout/grid_option_2"
                layout="@layout/grid_option"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="invisible" />
+58 −35
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2019 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.
  ~ 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="wrap_content"

<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:paddingBottom="@dimen/option_bottom_margin"
    android:clipChildren="false"
    android:clipToPadding="false"
    android:orientation="vertical">
    android:orientation="vertical"
    android:gravity="center_horizontal"
    android:clipChildren="false">

    <FrameLayout
        android:id="@+id/option_tile"
        android:layout_width="@dimen/option_tile_width"
        android:layout_height="@dimen/option_tile_width"
        android:layout_gravity="center_horizontal"
        android:padding="@dimen/option_tile_padding_vertical"
        android:background="@drawable/option_border"
        android:gravity="center">
        android:layout_width="@dimen/option_item_size"
        android:layout_height="@dimen/option_item_size"
        android:clipChildren="false">

        <ImageView
            android:id="@+id/grid_option_thumbnail"
            android:id="@id/selection_border"
            android:layout_width="match_parent"
            android:layout_height="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/option_label"
        android:id="@id/text"
        android:layout_width="wrap_content"
        android:layout_height="24dp"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="@dimen/theme_option_label_margin"
        android:gravity="center"
        android:textAppearance="@style/OptionTitleTextAppearance" />
        android:layout_height="wrap_content"
        android:textColor="@color/system_on_surface"
        android:singleLine="true"
        android:ellipsize="end"
        android:text="Placeholder for stable size calculation, please do not remove."
        tools:ignore="HardcodedText" />

</LinearLayout>

res/layout/grid_option_2.xml

deleted100644 → 0
+0 −70
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/system_on_surface"
        android:singleLine="true"
        android:ellipsize="end"
        android:text="Placeholder for stable size calculation, please do not remove."
        tools:ignore="HardcodedText" />

</LinearLayout>
+1 −19
Original line number Diff line number Diff line
@@ -15,14 +15,11 @@
 */
package com.android.customization.model.grid;

import android.content.Context;
import android.graphics.PorterDuff.Mode;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;

import androidx.annotation.Nullable;

@@ -30,7 +27,6 @@ import com.android.customization.model.CustomizationManager;
import com.android.customization.model.CustomizationOption;
import com.android.customization.widget.GridTileDrawable;
import com.android.wallpaper.R;
import com.android.wallpaper.util.ResourceUtils;

/**
 * Represents a grid layout option available in the current launcher.
@@ -94,21 +90,7 @@ public class GridOption implements CustomizationOption<GridOption>, Parcelable {

    @Override
    public void bindThumbnailTile(View view) {
        Context context = view.getContext();

        int colorFilter = ResourceUtils.getColorAttr(context,
                view.isActivated()
                        ? (mIsCurrent
                            ? android.R.attr.textColorPrimary
                            : android.R.attr.textColorPrimaryInverse)
                        : android.R.attr.textColorTertiary);
        mTileDrawable.setColorFilter(colorFilter, Mode.SRC_ATOP);
        ((ImageView) view.findViewById(R.id.grid_option_thumbnail))
                .setImageDrawable(mTileDrawable);

        int backgroundResource = view.isActivated() && !mIsCurrent
                ? R.drawable.option_border_new_selection : R.drawable.option_border;
        view.findViewById(R.id.option_tile).setBackgroundResource(backgroundResource);
        // Do nothing. This function will no longer be used in the Revamped UI
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ object GridScreenBinder {
        optionView.addItemDecoration(ItemSpacing(ItemSpacing.ITEM_SPACING_DP))
        val adapter =
            OptionItemAdapter(
                layoutResourceId = R.layout.grid_option_2,
                layoutResourceId = R.layout.grid_option,
                lifecycleOwner = lifecycleOwner,
                backgroundDispatcher = backgroundDispatcher,
                foregroundTintSpec =