@@ -34,22 +34,59 @@ fun RYScaffold(
34
34
currentWindowAdaptiveInfo()
35
35
)
36
36
37
- NavigationSuiteScaffold (
38
- modifier = modifier
39
- .background(
40
- MaterialTheme .colorScheme.surfaceColorAtElevation(
41
- topBarTonalElevation,
42
- color = containerColor
43
- )
44
- ),
45
- layoutType = layoutType,
46
- containerColor = MaterialTheme .colorScheme.surfaceColorAtElevation(
47
- containerTonalElevation,
48
- color = containerColor
49
- ) onDark MaterialTheme .colorScheme.surface,
50
- navigationSuiteItems = navigationSuiteItems ? : {},
51
- content = {
52
- Column {
37
+ if (navigationSuiteItems != null ) {
38
+ NavigationSuiteScaffold (
39
+ modifier = modifier
40
+ .background(
41
+ MaterialTheme .colorScheme.surfaceColorAtElevation(
42
+ topBarTonalElevation,
43
+ color = containerColor
44
+ )
45
+ ),
46
+ layoutType = layoutType,
47
+ containerColor = MaterialTheme .colorScheme.surfaceColorAtElevation(
48
+ containerTonalElevation,
49
+ color = containerColor
50
+ ) onDark MaterialTheme .colorScheme.surface,
51
+ navigationSuiteItems = navigationSuiteItems,
52
+ content = {
53
+ Column {
54
+ if (topBar != null ) {
55
+ topBar()
56
+ } else if (navigationIcon != null || actions != null ) {
57
+ TopAppBar (
58
+ title = {},
59
+ navigationIcon = { navigationIcon?.invoke() },
60
+ actions = { actions?.invoke(this ) },
61
+ colors = TopAppBarDefaults .topAppBarColors(
62
+ containerColor = MaterialTheme .colorScheme.surfaceColorAtElevation(
63
+ topBarTonalElevation
64
+ ),
65
+ )
66
+ )
67
+ }
68
+ content()
69
+ if (floatingActionButton != null ) {
70
+ Box (
71
+ modifier = Modifier .fillMaxSize(),
72
+ contentAlignment = Alignment .BottomEnd
73
+ ) {
74
+ floatingActionButton()
75
+ }
76
+ }
77
+ }
78
+ }
79
+ )
80
+ } else {
81
+ Scaffold (
82
+ modifier = modifier
83
+ .background(
84
+ MaterialTheme .colorScheme.surfaceColorAtElevation(
85
+ topBarTonalElevation,
86
+ color = containerColor
87
+ )
88
+ ),
89
+ topBar = {
53
90
if (topBar != null ) {
54
91
topBar()
55
92
} else if (navigationIcon != null || actions != null ) {
@@ -64,17 +101,23 @@ fun RYScaffold(
64
101
)
65
102
)
66
103
}
67
- content()
104
+ },
105
+ floatingActionButton = {
68
106
if (floatingActionButton != null ) {
69
- Box (
70
- modifier = Modifier .fillMaxSize(),
71
- contentAlignment = Alignment .BottomEnd
72
- ) {
73
- floatingActionButton()
74
- }
107
+ floatingActionButton()
75
108
}
76
- }
77
- }
78
- )
109
+ },
110
+ content = {
111
+ Column {
112
+ Spacer (modifier = Modifier .height(it.calculateTopPadding()))
113
+ content()
114
+ }
115
+ },
116
+ containerColor = MaterialTheme .colorScheme.surfaceColorAtElevation(
117
+ containerTonalElevation,
118
+ color = containerColor
119
+ ) onDark MaterialTheme .colorScheme.surface
120
+ )
121
+ }
79
122
}
80
123
0 commit comments