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

Commit 8eddc32e authored by Joshua Mokut's avatar Joshua Mokut Committed by Android (Google) Code Review
Browse files

Merge "Adjusted Height for shortcut helper on larger screens" into main

parents 7c3e0143 ecb9ca6e
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -24,18 +24,22 @@ import android.content.Intent.FLAG_ACTIVITY_NEW_TASK
import android.os.UserHandle
import android.provider.Settings
import androidx.annotation.VisibleForTesting
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.width
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.android.compose.modifiers.thenIf
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.display.dagger.SystemUIDisplaySubcomponent.DisplayAware
import com.android.systemui.display.dagger.SystemUIDisplaySubcomponent.LifecycleListener
import com.android.systemui.display.dagger.SystemUIDisplaySubcomponent.PerDisplaySingleton
import com.android.systemui.Flags
import com.android.systemui.keyboard.shortcut.ui.composable.ShortcutHelper
import com.android.systemui.keyboard.shortcut.ui.composable.ShortcutHelperBottomSheet
import com.android.systemui.keyboard.shortcut.ui.composable.getWidth
import com.android.systemui.keyboard.shortcut.ui.composable.hasExpandedWindowHeight
import com.android.systemui.keyboard.shortcut.ui.viewmodel.ShortcutHelperViewModel
import com.android.systemui.lifecycle.rememberActivated
import com.android.systemui.plugins.ActivityStarter
@@ -89,7 +93,12 @@ constructor(
                        shortcutCustomizationDialogStarterFactory.create()
                    }
                ShortcutHelper(
                    modifier = Modifier.width(getWidth()),
                    modifier =
                        Modifier
                            .width(getWidth())
                            .thenIf(hasExpandedWindowHeight()
                                    && Flags.shortcutHelperMultiDisplaySupport()
                            ) { Modifier.fillMaxHeight(0.72f) },
                    shortcutsUiState = shortcutsUiState,
                    onKeyboardSettingsClicked = { onKeyboardSettingsClicked(dialog) },
                    onSearchQueryChanged = { shortcutHelperViewModel.onSearchQueryChanged(it) },
+6 −0
Original line number Diff line number Diff line
@@ -47,6 +47,12 @@ fun getWidth(): Dp {
        }
}

@Composable
fun hasExpandedWindowHeight() =
    LocalWindowSizeClass.current.isHeightAtLeastBreakpoint(
        WindowSizeClass.HEIGHT_DP_EXPANDED_LOWER_BOUND
    )

object ShortcutHelperBottomSheet {
    val DefaultWidth = 412.dp
    val LargeScreenWidthPortrait = 704.dp