1 /*
2  * Copyright 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 @file:OptIn(ExperimentalHorologistApi::class)
18 
19 package com.android.credentialmanager.ui.screens.single
20 
21 import androidx.compose.foundation.layout.Row
22 import androidx.compose.foundation.layout.Spacer
23 import androidx.compose.foundation.layout.fillMaxSize
24 import androidx.compose.runtime.Composable
25 import androidx.compose.ui.Modifier
26 import androidx.wear.compose.foundation.lazy.ScalingLazyListScope
27 import com.google.android.horologist.annotations.ExperimentalHorologistApi
28 import com.google.android.horologist.compose.layout.ScalingLazyColumn
29 import com.google.android.horologist.compose.layout.ScalingLazyColumnState
30 
31 @Composable
SingleAccountScreennull32 fun SingleAccountScreen(
33     headerContent: @Composable () -> Unit,
34     accountContent: @Composable () -> Unit,
35     columnState: ScalingLazyColumnState,
36     content: ScalingLazyListScope.() -> Unit,
37 ) {
38     Row {
39         Spacer(Modifier.weight(0.052f)) // 5.2% side margin
40         ScalingLazyColumn(
41             columnState = columnState,
42             modifier = Modifier.weight(0.896f).fillMaxSize(),
43         ) {
44             item { headerContent() }
45             item { accountContent() }
46             content()
47         }
48         Spacer(Modifier.weight(0.052f)) // 5.2% side margin
49     }
50 }