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

Commit c07acc5e authored by Fabián Kozynski's avatar Fabián Kozynski
Browse files

Match Clock properties from xml

We match the properties from the qs_combined_header xml for Clock. We
also use unbounded wrap content, to make sure the clock will have enough
room when it expands.

Test: manual, expand from QQS to QS
Flag: com.android.systemui.scene_container
Fixes: 438431529
Change-Id: I553b27c1f0f5c69ee795aa8bc2b876744967e9d7
parent 1fde0526
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@
package com.android.systemui.shade.ui.composable

import android.view.ContextThemeWrapper
import android.view.Gravity
import android.view.View
import android.view.ViewGroup
import androidx.annotation.ColorInt
import androidx.compose.animation.core.Animatable
@@ -38,6 +40,7 @@ import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
@@ -522,13 +525,22 @@ private fun ContentScope.Clock(
            AndroidView(
                factory = { context ->
                    Clock(
                        ContextThemeWrapper(context, R.style.Theme_SystemUI_QuickSettings_Header),
                            ContextThemeWrapper(
                                context,
                                R.style.Theme_SystemUI_QuickSettings_Header,
                            ),
                            null,
                        )
                        .apply {
                            isSingleLine = true
                            textDirection = View.TEXT_DIRECTION_LOCALE
                            gravity = Gravity.START or Gravity.CENTER_VERTICAL
                        }
                },
                update = { view -> textColor?.let { view.setTextColor(it.toArgb()) } },
                modifier =
                    modifier
                        .wrapContentWidth(unbounded = true)
                        // use graphicsLayer instead of Modifier.scale to anchor transform to the
                        // (start, top) corner
                        .graphicsLayer {