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

Commit d66bb04e authored by Lucas Silva's avatar Lucas Silva
Browse files

Use AutoSize for empty state CTA text

This will automatically adjust the size of the text based on the
available space.

Bug: 384572608
Test: on glanceable hub on mobile portrait, landscape and tablet
Flag: EXEMPT bugfix
Change-Id: I253fe78cdb8b04eb1545bfa575e4e07fceab950f
parent 7de9e84a
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -76,6 +76,8 @@ import androidx.compose.foundation.lazy.grid.rememberLazyGridState
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.selection.selectable
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.AutoSize
import androidx.compose.foundation.text.BasicText
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
@@ -1016,11 +1018,14 @@ private fun EmptyStateCta(contentPadding: PaddingValues, viewModel: BaseCommunal
            horizontalAlignment = Alignment.CenterHorizontally,
        ) {
            val titleForEmptyStateCTA = stringResource(R.string.title_for_empty_state_cta)
            Text(
            BasicText(
                text = titleForEmptyStateCTA,
                style = MaterialTheme.typography.displaySmall,
                textAlign = TextAlign.Center,
                style =
                    MaterialTheme.typography.displaySmall.merge(
                        color = colors.onPrimary,
                        textAlign = TextAlign.Center,
                    ),
                autoSize = AutoSize.StepBased(maxFontSize = 36.sp, stepSize = 0.1.sp),
                modifier =
                    Modifier.focusable().semantics(mergeDescendants = true) {
                        contentDescription = titleForEmptyStateCTA