Skip to content

Commit 8c4eb21

Browse files
wardlaurengithub-actions[bot]
authored andcommitted
Apply Spotless
1 parent d0523d3 commit 8c4eb21

File tree

1 file changed

+28
-14
lines changed
  • compose/snippets/src/main/java/com/example/compose/snippets/components

1 file changed

+28
-14
lines changed

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

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,53 @@
1+
/*
2+
* Copyright 2025 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.foundation.layout.Box
420
import androidx.compose.foundation.layout.fillMaxSize
21+
import androidx.compose.foundation.layout.padding
522
import androidx.compose.material.icons.Icons
623
import androidx.compose.material.icons.filled.Album
724
import androidx.compose.material.icons.filled.MusicNote
825
import androidx.compose.material.icons.filled.PlaylistAddCircle
26+
import androidx.compose.material3.ExperimentalMaterial3Api
927
import androidx.compose.material3.Icon
1028
import androidx.compose.material3.NavigationBar
1129
import androidx.compose.material3.NavigationBarDefaults
1230
import androidx.compose.material3.NavigationBarItem
31+
import androidx.compose.material3.NavigationRail
32+
import androidx.compose.material3.NavigationRailItem
33+
import androidx.compose.material3.PrimaryTabRow
1334
import androidx.compose.material3.Scaffold
35+
import androidx.compose.material3.Tab
1436
import androidx.compose.material3.Text
1537
import androidx.compose.runtime.Composable
38+
import androidx.compose.runtime.getValue
39+
import androidx.compose.runtime.mutableIntStateOf
1640
import androidx.compose.runtime.saveable.rememberSaveable
41+
import androidx.compose.runtime.setValue
1742
import androidx.compose.ui.Alignment
1843
import androidx.compose.ui.Modifier
1944
import androidx.compose.ui.graphics.vector.ImageVector
45+
import androidx.compose.ui.text.style.TextOverflow
2046
import androidx.compose.ui.tooling.preview.Preview
2147
import androidx.navigation.NavHostController
2248
import androidx.navigation.compose.NavHost
2349
import androidx.navigation.compose.composable
2450
import androidx.navigation.compose.rememberNavController
25-
import androidx.compose.runtime.mutableIntStateOf
26-
import androidx.compose.runtime.getValue
27-
import androidx.compose.runtime.setValue
28-
import androidx.compose.material3.NavigationRail
29-
import androidx.compose.material3.NavigationRailItem
30-
import androidx.compose.foundation.layout.padding
31-
import androidx.compose.material3.ExperimentalMaterial3Api
32-
import androidx.compose.material3.PrimaryTabRow
33-
import androidx.compose.material3.Tab
34-
import androidx.compose.ui.text.style.TextOverflow
3551

3652
@Composable
3753
fun SongsScreen(modifier: Modifier = Modifier) {
@@ -140,7 +156,7 @@ fun NavigationRailExample(modifier: Modifier = Modifier) {
140156
var selectedDestination by rememberSaveable { mutableIntStateOf(startDestination.ordinal) }
141157

142158
Scaffold { contentPadding ->
143-
NavigationRail (modifier = Modifier.padding(contentPadding)) {
159+
NavigationRail(modifier = Modifier.padding(contentPadding)) {
144160
Destination.entries.forEachIndexed { index, destination ->
145161
NavigationRailItem(
146162
selected = selectedDestination == index,
@@ -172,7 +188,7 @@ fun NavigationTabExample(modifier: Modifier = Modifier) {
172188
val startDestination = Destination.SONGS
173189
var selectedDestination by rememberSaveable { mutableIntStateOf(startDestination.ordinal) }
174190

175-
Scaffold{ contentPadding ->
191+
Scaffold { contentPadding ->
176192
PrimaryTabRow(selectedTabIndex = selectedDestination, modifier = Modifier.padding(contentPadding)) {
177193
Destination.entries.forEachIndexed { index, destination ->
178194
Tab(
@@ -195,5 +211,3 @@ fun NavigationTabExample(modifier: Modifier = Modifier) {
195211
}
196212
}
197213
// [END android_compose_components_navigationtabexample]
198-
199-

0 commit comments

Comments
 (0)