improvement: Use auto-size text for the Keyguard label on an empty page

This commit is contained in:
Artem Chepurnoy 2024-04-12 21:27:46 +03:00
parent 943fb0dc45
commit d536404e0a
No known key found for this signature in database
GPG Key ID: FAC37D0CF674043E
1 changed files with 6 additions and 3 deletions

View File

@ -65,6 +65,7 @@ import com.artemchep.keyguard.ui.surface.color
import com.artemchep.keyguard.ui.surface.splitHigh import com.artemchep.keyguard.ui.surface.splitHigh
import com.artemchep.keyguard.ui.surface.splitLow import com.artemchep.keyguard.ui.surface.splitLow
import com.artemchep.keyguard.ui.surface.surfaceElevationColor import com.artemchep.keyguard.ui.surface.surfaceElevationColor
import com.artemchep.keyguard.ui.text.AutoSizeText
import com.artemchep.keyguard.ui.util.VerticalDivider import com.artemchep.keyguard.ui.util.VerticalDivider
import org.kodein.di.compose.rememberInstance import org.kodein.di.compose.rememberInstance
@ -232,12 +233,14 @@ fun TwoPaneScaffoldScope.TwoPaneLayout(
contentDescription = null, contentDescription = null,
tint = MaterialTheme.colorScheme.onBackground, tint = MaterialTheme.colorScheme.onBackground,
) )
Text( val textStyle = MaterialTheme.typography.displayLarge
AutoSizeText(
text = remember { text = remember {
keyguardSpan() keyguardSpan()
}, },
textAlign = TextAlign.Center, minTextSize = MaterialTheme.typography.displayMedium.fontSize,
style = MaterialTheme.typography.displayLarge, maxTextSize = textStyle.fontSize,
style = textStyle,
color = MaterialTheme.colorScheme.onBackground, color = MaterialTheme.colorScheme.onBackground,
maxLines = 1, maxLines = 1,
) )