Skip to content

Commit 9fcc09b

Browse files
jakerosemangithub-actions[bot]
authored andcommitted
Apply Spotless
1 parent a614624 commit 9fcc09b

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

compose/snippets/src/main/java/com/example/compose/snippets/components/NavigationDrawer.kt

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2024 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+
117
package com.example.compose.snippets.components
218

319
import androidx.compose.animation.AnimatedVisibility
@@ -27,17 +43,17 @@ import androidx.compose.ui.text.style.TextAlign
2743
import androidx.compose.ui.tooling.preview.Preview
2844
import androidx.compose.ui.unit.dp
2945

30-
enum class ExampleStrings(val description: String){
46+
enum class ExampleStrings(val description: String) {
3147
SIMPLE("simple navigation drawer example"),
3248
NESTED("navigation drawer with nested items")
3349
}
3450

3551
@Composable
36-
fun NavigationDrawerExamples(){
52+
fun NavigationDrawerExamples() {
3753
var currentExample by remember { mutableStateOf<ExampleStrings?>(null) }
3854

39-
if (currentExample == null){
40-
Column(){
55+
if (currentExample == null) {
56+
Column() {
4157
Text(
4258
text = "Select which example you'd like to see.",
4359
textAlign = TextAlign.Center,
@@ -46,18 +62,18 @@ fun NavigationDrawerExamples(){
4662
.padding(16.dp)
4763
)
4864

49-
Button(onClick = {currentExample = ExampleStrings.SIMPLE}){
65+
Button(onClick = { currentExample = ExampleStrings.SIMPLE }) {
5066
Text("Simple navigation drawer.")
5167
}
52-
Button(onClick = {currentExample = ExampleStrings.NESTED}){
68+
Button(onClick = { currentExample = ExampleStrings.NESTED }) {
5369
Text("Navigation drawer with nested items.")
5470
}
5571
}
5672

5773
return
5874
}
5975

60-
Column(modifier = Modifier.fillMaxSize()){
76+
Column(modifier = Modifier.fillMaxSize()) {
6177
Text(
6278
text = "Swipe from left to open the ${currentExample!!.description}.",
6379
textAlign = TextAlign.Center,
@@ -67,7 +83,7 @@ fun NavigationDrawerExamples(){
6783
)
6884
}
6985

70-
when (currentExample){
86+
when (currentExample) {
7187
null,
7288
ExampleStrings.SIMPLE -> SimpleNavigationDrawerExample()
7389
ExampleStrings.NESTED -> NestedNavigationDrawerExample()
@@ -76,7 +92,7 @@ fun NavigationDrawerExamples(){
7692

7793
@Preview
7894
@Composable
79-
private fun NavigationDrawerExamplesPreview(){
95+
private fun NavigationDrawerExamplesPreview() {
8096
NavigationDrawerExamples()
8197
}
8298

@@ -133,7 +149,7 @@ fun SimpleNavigationDrawerExample() {
133149

134150
@Preview
135151
@Composable
136-
private fun SimpleNavigationDrawerExamplePreview(){
152+
private fun SimpleNavigationDrawerExamplePreview() {
137153
SimpleNavigationDrawerExample()
138154
}
139155

@@ -190,6 +206,6 @@ fun NestedNavigationDrawerExample() {
190206

191207
@Preview
192208
@Composable
193-
private fun NestedNavigationDrawerExamplePreview(){
209+
private fun NestedNavigationDrawerExamplePreview() {
194210
NestedNavigationDrawerExample()
195211
}

0 commit comments

Comments
 (0)