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+ 
117package  com.example.compose.snippets.components 
218
319import  androidx.compose.animation.AnimatedVisibility 
@@ -27,17 +43,17 @@ import androidx.compose.ui.text.style.TextAlign
2743import  androidx.compose.ui.tooling.preview.Preview 
2844import  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,16 +62,16 @@ 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
58-     Column (modifier =  Modifier .fillMaxSize()){
74+     Column (modifier =  Modifier .fillMaxSize())  {
5975        Text (
6076            text =  " Swipe from left to open the ${currentExample!! .description} ."  ,
6177            textAlign =  TextAlign .Center ,
@@ -65,7 +81,7 @@ fun NavigationDrawerExamples(){
6581        )
6682    }
6783
68-     when  (currentExample){
84+     when  (currentExample)  {
6985        null ,
7086        ExampleStrings .SIMPLE  ->  SimpleNavigationDrawerExample ()
7187        ExampleStrings .NESTED  ->  NestedNavigationDrawerExample ()
@@ -74,7 +90,7 @@ fun NavigationDrawerExamples(){
7490
7591@Preview
7692@Composable
77- private  fun  NavigationDrawerExamplesPreview (){
93+ private  fun  NavigationDrawerExamplesPreview ()  {
7894    NavigationDrawerExamples ()
7995}
8096
@@ -104,7 +120,7 @@ fun SimpleNavigationDrawerExample() {
104120
105121@Preview
106122@Composable
107- private  fun  SimpleNavigationDrawerExamplePreview (){
123+ private  fun  SimpleNavigationDrawerExamplePreview ()  {
108124    SimpleNavigationDrawerExample ()
109125}
110126
@@ -188,6 +204,6 @@ fun NestedNavigationDrawerExample() {
188204
189205@Preview
190206@Composable
191- private  fun  NestedNavigationDrawerExamplePreview (){
207+ private  fun  NestedNavigationDrawerExamplePreview ()  {
192208    NestedNavigationDrawerExample ()
193209}
0 commit comments