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

Commit 4653a955 authored by Anton Potapov's avatar Anton Potapov
Browse files

Fix longer labels in Volume Panel

Flag: aconfig new_volume_panel TRUNKFOOD
Test: manual on the phone. Open volume panel with a spatial audio
headset connected and problematic locale
Fixes: 332538141
Fixes: 331324879

Change-Id: I8ee3c634736a661636d84b680f28464daf5004d8
parent 7e865633
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.volume.panel.component.anc.ui.composable
import android.content.Context
import android.view.ContextThemeWrapper
import android.view.View
import androidx.compose.foundation.basicMarquee
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
@@ -55,6 +56,7 @@ constructor(
    @Composable
    private fun Title() {
        Text(
            modifier = Modifier.basicMarquee(),
            text = stringResource(R.string.volume_panel_noise_control_title),
            style = MaterialTheme.typography.titleMedium,
            textAlign = TextAlign.Center,
+3 −4
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.volume.panel.component.button.ui.composable

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.basicMarquee
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
@@ -37,7 +38,6 @@ import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.role
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import com.android.compose.animation.Expandable
import com.android.systemui.animation.Expandable
@@ -81,11 +81,10 @@ class ButtonComponent(
                }
            }
            Text(
                modifier = Modifier.clearAndSetSemantics {},
                modifier = Modifier.clearAndSetSemantics {}.basicMarquee(),
                text = label,
                style = MaterialTheme.typography.labelMedium,
                maxLines = 1,
                overflow = TextOverflow.Ellipsis,
                maxLines = 2,
            )
        }
    }
+3 −4
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.volume.panel.component.button.ui.composable

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.basicMarquee
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
@@ -35,7 +36,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import com.android.systemui.common.ui.compose.Icon
import com.android.systemui.volume.panel.component.button.ui.viewmodel.ToggleButtonViewModel
@@ -78,11 +78,10 @@ class ToggleButtonComponent(
                Icon(modifier = Modifier.size(24.dp), icon = viewModel.icon)
            }
            Text(
                modifier = Modifier.clearAndSetSemantics {},
                modifier = Modifier.clearAndSetSemantics {}.basicMarquee(),
                text = label,
                style = MaterialTheme.typography.labelMedium,
                maxLines = 1,
                overflow = TextOverflow.Ellipsis,
                maxLines = 2,
            )
        }
    }
+4 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.VectorConverter
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.Spacer
@@ -130,9 +131,12 @@ fun VolumePanelRadioButtonBar(
                horizontalArrangement = Arrangement.spacedBy(spacing),
            ) {
                for (itemIndex in items.indices) {
                    val cornersRadius = 4.dp
                    TextButton(
                        modifier = Modifier.weight(1f),
                        onClick = { items[itemIndex].onItemSelected() },
                        shape = RoundedCornerShape(cornersRadius),
                        contentPadding = PaddingValues(cornersRadius)
                    ) {
                        val item = items[itemIndex]
                        if (item.icon !== Empty) {
+6 −0
Original line number Diff line number Diff line
@@ -16,12 +16,14 @@

package com.android.systemui.volume.panel.component.spatialaudio.ui.composable

import androidx.compose.foundation.basicMarquee
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import com.android.systemui.animation.Expandable
@@ -49,6 +51,7 @@ constructor(
    @Composable
    private fun Title() {
        Text(
            modifier = Modifier.basicMarquee(),
            text = stringResource(R.string.volume_panel_spatial_audio_title),
            style = MaterialTheme.typography.titleMedium,
            textAlign = TextAlign.Center,
@@ -82,9 +85,12 @@ constructor(
                    },
                    label = {
                        Text(
                            modifier = Modifier.basicMarquee(),
                            text = buttonViewModel.button.label.toString(),
                            style = MaterialTheme.typography.labelMedium,
                            color = buttonViewModel.labelColor.toColor(),
                            textAlign = TextAlign.Center,
                            maxLines = 2
                        )
                    }
                )