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

Commit b73d1ff2 authored by Pat Manning's avatar Pat Manning Committed by Android (Google) Code Review
Browse files

Merge "Update dimensions of ShortcutHelper. Fix text wrapping for large font." into main

parents fdbaa299 5ee6c1f2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -307,6 +307,6 @@ private fun draggableTopPadding(): Dp {

private object DraggableBottomSheet {
    val DefaultTopPadding = 64.dp
    val LargeScreenTopPadding = 72.dp
    val LargeScreenTopPadding = 56.dp
    val MaxWidth = 640.dp
}
+36 −20
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
@@ -90,6 +91,7 @@ import androidx.compose.ui.input.key.Key
import androidx.compose.ui.input.key.key
import androidx.compose.ui.input.key.onKeyEvent
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
@@ -99,6 +101,7 @@ import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
@@ -377,16 +380,20 @@ private fun ShortcutHelperTwoPane(

    Column(modifier = modifier.fillMaxSize().padding(horizontal = 24.dp)) {
        Row(modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
            Box(modifier = Modifier.padding(start = 202.dp).width(412.dp)) {
            // Keep title centered whether customize button is visible or not.
            Box(modifier = Modifier.fillMaxWidth(), contentAlignment = Alignment.CenterEnd) {
                Box(modifier = Modifier.fillMaxWidth(), contentAlignment = Alignment.Center) {
                    TitleBar(isCustomizing)
                }
            Spacer(modifier = Modifier.weight(1f))
                if (isShortcutCustomizerFlagEnabled) {
                    if (isCustomizing) {
                        DoneButton(onClick = { isCustomizing = false })
                    } else {
                        CustomizeButton(onClick = { isCustomizing = true })
                    }
                } else {
                    Spacer(modifier = Modifier.width(if (isCustomizing) 69.dp else 133.dp))
                }
            }
        }
        Spacer(modifier = Modifier.height(12.dp))
@@ -550,7 +557,7 @@ private fun Shortcut(
            .padding(8.dp)
    ) {
        Row(
            modifier = Modifier.width(128.dp).align(Alignment.CenterVertically),
            modifier = Modifier.width(128.dp).align(Alignment.CenterVertically).weight(0.333f),
            horizontalArrangement = Arrangement.spacedBy(16.dp),
            verticalAlignment = Alignment.CenterVertically,
        ) {
@@ -561,7 +568,7 @@ private fun Shortcut(
        }
        Spacer(modifier = Modifier.width(24.dp))
        ShortcutKeyCombinations(
            modifier = Modifier.weight(1f),
            modifier = Modifier.weight(.666f),
            shortcut = shortcut,
            isCustomizing = isCustomizing,
            onAddShortcutRequested = { onCustomizationRequested(shortcut.label) },
@@ -790,6 +797,14 @@ private fun StartSidePanel(
    onKeyboardSettingsClicked: () -> Unit,
    selectedCategory: ShortcutCategoryType?,
    onCategoryClicked: (ShortcutCategoryUi) -> Unit,
) {
    CompositionLocalProvider(
        // Restrict system font scale increases up to a max so categories display correctly.
        LocalDensity provides
            Density(
                density = LocalDensity.current.density,
                fontScale = LocalDensity.current.fontScale.coerceIn(1f, 1.5f),
            )
    ) {
        Column(modifier) {
            ShortcutsSearchBar(onSearchQueryChanged)
@@ -803,6 +818,7 @@ private fun StartSidePanel(
            )
        }
    }
}

@Composable
private fun CategoriesPanelTwoPane(
+1 −1
Original line number Diff line number Diff line
@@ -49,5 +49,5 @@ fun getWidth(): Dp {
object ShortcutHelperBottomSheet {
    val DefaultWidth = 412.dp
    val LargeScreenWidthPortrait = 704.dp
    val LargeScreenWidthLandscape = 864.dp
    val LargeScreenWidthLandscape = 960.dp
}