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

Commit ecb9ca6e authored by Josh's avatar Josh
Browse files

Adjusted Height for shortcut helper on larger screens

When on larger screen shortcut helper should take up 72% of the screen

Flag: com.android.systemui.shortcut_helper_multi_display_support
Test: Manual - Test shortcut helper on connected display monitor, e.g
1920x2560
Fix: 411491171

Change-Id: Ie5386e5c015d97c9622bfda1a51acaac4a2c080a
parent 39bf2614
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