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

Commit e95f996f authored by Helen Qin's avatar Helen Qin Committed by Automerger Merge Worker
Browse files

Merge "[CredManUi] Style fixes" into udc-dev am: 77742236

parents a906c316 77742236
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ android_app {
    },

    static_libs: [
        "PlatformComposeCore",
        "androidx.activity_activity-compose",
        "androidx.appcompat_appcompat",
        "androidx.compose.animation_animation-core",
+0 −2
Original line number Diff line number Diff line
@@ -5,7 +5,5 @@
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:statusBarColor">@android:color/transparent</item>
    <item name="android:navigationBarColor">@android:color/transparent</item>
  </style>
</resources>
 No newline at end of file
+2 −7
Original line number Diff line number Diff line
@@ -306,10 +306,6 @@ fun rememberModalBottomSheetState(
 * @param sheetContentColor The preferred content color provided by the bottom sheet to its
 * children. Defaults to the matching content color for [sheetBackgroundColor], or if that is not
 * a color from the theme, this will keep the same content color set above the bottom sheet.
 * @param scrimColor The color of the scrim that is applied to the rest of the screen when the
 * bottom sheet is visible. If the color passed is [Color.Unspecified], then a scrim will no
 * longer be applied and the bottom sheet will not block interaction with the rest of the screen
 * when visible.
 * @param content The content of rest of the screen.
 */
@Composable
@@ -322,7 +318,6 @@ fun ModalBottomSheetLayout(
    sheetElevation: Dp = ModalBottomSheetDefaults.Elevation,
    sheetBackgroundColor: Color = MaterialTheme.colorScheme.surface,
    sheetContentColor: Color = contentColorFor(sheetBackgroundColor),
    scrimColor: Color = ModalBottomSheetDefaults.scrimColor,
    content: @Composable () -> Unit
) {
    val scope = rememberCoroutineScope()
@@ -332,7 +327,7 @@ fun ModalBottomSheetLayout(
        Box(Modifier.fillMaxSize()) {
            content()
            Scrim(
                color = scrimColor,
                color = ModalBottomSheetDefaults.scrimColor,
                onDismiss = {
                    if (sheetState.confirmStateChange(Hidden)) {
                        scope.launch { sheetState.hide() }
@@ -505,5 +500,5 @@ object ModalBottomSheetDefaults {
     */
    val scrimColor: Color
        @Composable
        get() = MaterialTheme.colorScheme.scrim
        get() = MaterialTheme.colorScheme.scrim.copy(alpha = .32f)
}
 No newline at end of file
+0 −1
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ fun ModalBottomSheet(
        modifier = Modifier.background(Color.Transparent),
        sheetState = state,
        sheetContent = sheetContent,
        scrimColor = MaterialTheme.colorScheme.scrim.copy(alpha = 0.8f),
        sheetShape = EntryShape.TopRoundedCorner,
    ) {}
    LaunchedEffect(state.currentValue) {
+42 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.credentialmanager.common.ui

import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import com.android.compose.SystemUiController
import com.android.credentialmanager.common.material.ModalBottomSheetDefaults

@Composable
fun setTransparentSystemBarsColor(sysUiController: SystemUiController) {
    sysUiController.setSystemBarsColor(color = Color.Transparent, darkIcons = false)
}

@Composable
fun setBottomSheetSystemBarsColor(sysUiController: SystemUiController) {
    sysUiController.setStatusBarColor(
        color = ModalBottomSheetDefaults.scrimColor,
        darkIcons = false
    )
    sysUiController.setNavigationBarColor(
        color = MaterialTheme.colorScheme.surfaceColorAtElevation(
            ElevationTokens.Level1
        ),
        darkIcons = false
    )
}
 No newline at end of file
Loading