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

Commit 8b21dec3 authored by George Lin's avatar George Lin
Browse files

Fix preview cut on clock settings page

Fix by forcing the text view to be invisible instead of gone.

Test: Manually tested that the shortcuts show up
Bug: 273161637
Change-Id: I3a3c528b1cc80d23767eabbbb3f9907076a6cc73
parent d73f5158
Loading
Loading
Loading
Loading
+102 −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.
-->
<!-- Content description is set programmatically on the parent FrameLayout -->
<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:clipChildren="false">
    <FrameLayout
        android:id="@+id/icon_container"
        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" />

        <FrameLayout
            android:id="@id/foreground"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <ImageView
                android:id="@+id/color_preview_0"
                android:layout_width="@dimen/component_color_chip_small_radius_default2"
                android:layout_height="@dimen/component_color_chip_small_radius_default2"
                android:layout_gravity="center"
                android:layout_marginRight="@dimen/color_seed_chip_margin2"
                android:layout_marginBottom="@dimen/color_seed_chip_margin2"
                android:src="@drawable/color_chip_seed_filled0"
                android:importantForAccessibility="no"/>

            <ImageView
                android:id="@+id/color_preview_1"
                android:layout_width="@dimen/component_color_chip_small_radius_default2"
                android:layout_height="@dimen/component_color_chip_small_radius_default2"
                android:layout_gravity="center"
                android:layout_marginLeft="@dimen/color_seed_chip_margin2"
                android:layout_marginBottom="@dimen/color_seed_chip_margin2"
                android:src="@drawable/color_chip_seed_filled2"
                android:importantForAccessibility="no"/>

            <ImageView
                android:id="@+id/color_preview_2"
                android:layout_width="@dimen/component_color_chip_small_radius_default2"
                android:layout_height="@dimen/component_color_chip_small_radius_default2"
                android:layout_gravity="center"
                android:layout_marginRight="@dimen/color_seed_chip_margin2"
                android:layout_marginTop="@dimen/color_seed_chip_margin2"
                android:src="@drawable/color_chip_seed_filled1"
                android:importantForAccessibility="no"/>

            <ImageView
                android:id="@+id/color_preview_3"
                android:layout_width="@dimen/component_color_chip_small_radius_default2"
                android:layout_height="@dimen/component_color_chip_small_radius_default2"
                android:layout_gravity="center"
                android:layout_marginLeft="@dimen/color_seed_chip_margin2"
                android:layout_marginTop="@dimen/color_seed_chip_margin2"
                android:src="@drawable/color_chip_seed_filled3"
                android:importantForAccessibility="no" />
        </FrameLayout>
    </FrameLayout>

    <TextView
        android:id="@+id/text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/option_bottom_margin"
        android:textColor="@color/text_color_primary"
        android:visibility="invisible"
        android:gravity="center"
        android:text="Placeholder for stable size calculation, please do not remove."
        tools:ignore="HardcodedText" />
</LinearLayout>
+6 −5
Original line number Diff line number Diff line
@@ -18,7 +18,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    android:orientation="vertical"
    android:clipChildren="false">

    <FrameLayout
        android:id="@+id/section_header_container"
        android:layout_width="match_parent"
@@ -31,13 +33,13 @@
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:paddingTop="36dp"
        android:paddingTop="20dp"
        android:paddingBottom="40dp">

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

@@ -48,7 +50,6 @@
            android:layout_gravity="center" />
    </com.android.wallpaper.picker.DisplayAspectRatioFrameLayout>


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
@@ -123,7 +124,7 @@
                    without changing its size after the content is loaded into the RecyclerView.
                    -->
                    <include
                        layout="@layout/color_option_2"
                        layout="@layout/clock_color_option"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:visibility="invisible" />
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ object ClockSettingsBinder {
        val colorOptionContainerView: RecyclerView = view.requireViewById(R.id.color_options)
        val colorOptionAdapter =
            OptionItemAdapter(
                layoutResourceId = R.layout.color_option_2,
                layoutResourceId = R.layout.clock_color_option,
                lifecycleOwner = lifecycleOwner,
                bindIcon = { foregroundView: View, colorIcon: ColorOptionIconViewModel ->
                    val viewGroup = foregroundView as? ViewGroup
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ class ClockSettingsFragment : AppbarFragment() {
                                .createCurrentWallpaperInfos(
                                    { homeWallpaper, lockWallpaper, _ ->
                                        continuation.resume(
                                            homeWallpaper ?: lockWallpaper,
                                            lockWallpaper ?: homeWallpaper,
                                            null,
                                        )
                                    },