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

Unverified Commit a1ca84ca authored by Michael Bestas's avatar Michael Bestas
Browse files

ThemePicker: Remove Beta tag from themed icons toggle

Change-Id: Ibdc7f3081ceaea1528b74bf8685226b915d775f2
parent 858b54a6
Loading
Loading
Loading
Loading
+2 −16
Original line number Diff line number Diff line
@@ -115,21 +115,7 @@
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toStartOf="@+id/themed_icon_toggle"
                    app:layout_constraintTop_toBottomOf="parent"
                    app:layout_constraintBottom_toTopOf="@+id/themed_icon_beta_title" />

                <TextView
                    style="@style/BetaTagTextStyle"
                    android:id="@+id/themed_icon_beta_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/floating_sheet_content_horizontal_padding"
                    android:layout_marginEnd="@dimen/floating_sheet_clock_style_clock_size_text_margin_end"
                    android:importantForAccessibility="no"
                    android:textColor="@color/text_color_on_accent"
                    android:text="@string/beta_title"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/themed_icon_toggle_title"
                    app:layout_constraintBottom_toBottomOf="parent" />
                    app:layout_constraintBottom_toTopOf="@+id/themed_icon_toggle" />

                <com.google.android.material.materialswitch.MaterialSwitch
                    style="@style/SettingslibSwitchStyle.Expressive"
@@ -140,7 +126,7 @@
                    android:contentDescription="@string/themed_icon_title"
                    android:clickable="true"
                    app:layout_constraintTop_toTopOf="@+id/themed_icon_toggle_title"
                    app:layout_constraintBottom_toBottomOf="@+id/themed_icon_beta_title"
                    app:layout_constraintBottom_toBottomOf="@+id/themed_icon_toggle_title"
                    app:layout_constraintEnd_toEndOf="parent"
                    android:theme="@style/Theme.Material3.DynamicColors.DayNight" />
            </androidx.constraintlayout.widget.ConstraintLayout>
+0 −22
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.wallpaper.customization.ui.binder

import android.content.Context
import android.content.res.ColorStateList
import android.view.View
import android.view.ViewGroup
import android.view.ViewTreeObserver.OnGlobalLayoutListener
@@ -138,7 +137,6 @@ object AppIconFloatingSheetBinder {
        val themedIconsSwitch = view.requireViewById<MaterialSwitch>(R.id.themed_icon_toggle)
        val themedIconEntry = view.requireViewById<ViewGroup>(R.id.themed_icon_toggle_entry)
        val themedIconTitle = view.requireViewById<TextView>(R.id.themed_icon_toggle_title)
        val themedIconBetaLabel = view.requireViewById<TextView>(R.id.themed_icon_beta_title)

        data class FloatingSheetHeightsViewModel(
            val styleContentHeight: Int? = null,
@@ -293,7 +291,6 @@ object AppIconFloatingSheetBinder {
                            titleBinding =
                                bindTitleColor(
                                    themedIconTitle,
                                    themedIconBetaLabel,
                                    colorUpdateViewModel,
                                    isFloatingSheetActive,
                                    lifecycleOwner,
@@ -324,7 +321,6 @@ object AppIconFloatingSheetBinder {

    private fun bindTitleColor(
        title: TextView,
        betaLabel: TextView,
        colorUpdateViewModel: ColorUpdateViewModel,
        shouldAnimateColor: () -> Boolean,
        lifecycleOwner: LifecycleOwner,
@@ -336,27 +332,9 @@ object AppIconFloatingSheetBinder {
                shouldAnimate = shouldAnimateColor,
                lifecycleOwner = lifecycleOwner,
            )
        val labelBinding =
            ColorUpdateBinder.bind(
                setColor = { color -> betaLabel.setTextColor(color) },
                color = colorUpdateViewModel.colorOnPrimaryContainer,
                shouldAnimate = shouldAnimateColor,
                lifecycleOwner = lifecycleOwner,
            )
        val labelBackgroundBinding =
            ColorUpdateBinder.bind(
                setColor = { color ->
                    betaLabel.background.setTintList(ColorStateList.valueOf(color))
                },
                color = colorUpdateViewModel.colorPrimaryContainer,
                shouldAnimate = shouldAnimateColor,
                lifecycleOwner = lifecycleOwner,
            )
        return object : ColorUpdateBinder.Binding {
            override fun destroy() {
                titleBinding.destroy()
                labelBinding.destroy()
                labelBackgroundBinding.destroy()
            }
        }
    }