Skip to content

Commit c9405a1

Browse files
committed
Apply Spotless
1 parent 89507d5 commit c9405a1

File tree

7 files changed

+23
-30
lines changed

7 files changed

+23
-30
lines changed

compose/snippets/src/main/java/com/example/compose/snippets/navigation3/Content.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,7 +29,6 @@ import androidx.compose.runtime.Composable
2929
import androidx.compose.ui.Alignment
3030
import androidx.compose.ui.Modifier
3131
import androidx.compose.ui.draw.clip
32-
import androidx.compose.ui.graphics.Color
3332
import androidx.compose.ui.text.font.FontWeight
3433
import androidx.compose.ui.unit.dp
3534
import com.example.compose.snippets.ui.theme.PastelBlue
@@ -66,7 +65,6 @@ fun ContentBase(
6665
}
6766
}
6867
}
69-
7068
}
7169

7270
@Composable
@@ -182,4 +180,4 @@ fun ContentPink(
182180
modifier = modifier.background(PastelPink),
183181
onNext = onNext,
184182
content = content
185-
)
183+
)

compose/snippets/src/main/java/com/example/compose/snippets/navigation3/animations/AnimationSnippets.kt

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ data object ScreenB : NavKey
5252
@Serializable
5353
data object ScreenC : NavKey
5454

55-
5655
class AnimatedNavDisplayActivity : ComponentActivity() {
5756

5857
override fun onCreate(savedInstanceState: Bundle?) {
@@ -91,41 +90,41 @@ class AnimatedNavDisplayActivity : ComponentActivity() {
9190
} + NavDisplay.popTransitionSpec {
9291
// Slide old content down, revealing the new content in place underneath
9392
EnterTransition.None togetherWith
94-
slideOutVertically(
95-
targetOffsetY = { it },
96-
animationSpec = tween(1000)
97-
)
93+
slideOutVertically(
94+
targetOffsetY = { it },
95+
animationSpec = tween(1000)
96+
)
9897
} + NavDisplay.predictivePopTransitionSpec {
9998
// Slide old content down, revealing the new content in place underneath
10099
EnterTransition.None togetherWith
101-
slideOutVertically(
102-
targetOffsetY = { it },
103-
animationSpec = tween(1000)
104-
)
100+
slideOutVertically(
101+
targetOffsetY = { it },
102+
animationSpec = tween(1000)
103+
)
105104
}
106-
){
105+
) {
107106
ContentGreen("This is Screen C")
108107
}
109108
},
110109
transitionSpec = {
111110
// Slide in from right when navigating forward
112111
slideInHorizontally(initialOffsetX = { it }) togetherWith
113-
slideOutHorizontally(targetOffsetX = { -it })
112+
slideOutHorizontally(targetOffsetX = { -it })
114113
},
115114
popTransitionSpec = {
116115
// Slide in from left when navigating back
117116
slideInHorizontally(initialOffsetX = { -it }) togetherWith
118-
slideOutHorizontally(targetOffsetX = { it })
117+
slideOutHorizontally(targetOffsetX = { it })
119118
},
120119
predictivePopTransitionSpec = {
121120
// Slide in from left when navigating back
122121
slideInHorizontally(initialOffsetX = { -it }) togetherWith
123-
slideOutHorizontally(targetOffsetX = { it })
122+
slideOutHorizontally(targetOffsetX = { it })
124123
},
125124
modifier = Modifier.padding(paddingValues)
126125
)
127126
}
128127
}
129128
}
130129
}
131-
// [END android_compose_navigation3_animations_1]
130+
// [END android_compose_navigation3_animations_1]

compose/snippets/src/main/java/com/example/compose/snippets/navigation3/basic/BasicSnippets.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fun MyApp() {
3939
val backStack = remember { mutableStateListOf<Any>(ProductList) }
4040

4141
// Supply your back stack to a NavDisplay so it can reflect changes in the UI
42-
//...more on this below...
42+
// ...more on this below...
4343

4444
// Push a key onto the back stack (navigate forward), the navigation library will reflect the change in state
4545
backStack.add(ProductDetail(id = "ABC"))

compose/snippets/src/main/java/com/example/compose/snippets/navigation3/savingstate/SavingStateSnippets.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,15 @@
1616

1717
package com.example.compose.snippets.navigation3.savingstate
1818

19-
import androidx.compose.material3.Text
2019
import androidx.compose.runtime.Composable
2120
import androidx.lifecycle.viewmodel.navigation3.rememberViewModelStoreNavEntryDecorator
2221
import androidx.navigation3.runtime.NavKey
23-
import androidx.navigation3.runtime.entry
2422
import androidx.navigation3.runtime.entryProvider
2523
import androidx.navigation3.runtime.rememberNavBackStack
2624
import androidx.navigation3.runtime.rememberSavedStateNavEntryDecorator
2725
import androidx.navigation3.ui.NavDisplay
2826
import androidx.navigation3.ui.rememberSceneSetupNavEntryDecorator
2927
import kotlinx.serialization.Serializable
30-
import java.util.Map.entry
3128

3229
// [START android_compose_navigation3_savingstate_1]
3330
@Serializable

compose/snippets/src/main/java/com/example/compose/snippets/navigation3/scenes/ScenesSnippets.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ class TwoPaneSceneStrategy<T : Any> : SceneStrategy<T> {
131131

132132
// Condition 2: Only return a Scene if there are two entries, and both have declared
133133
// they can be displayed in a two pane scene.
134-
return if (lastTwoEntries.size == 2
135-
&& lastTwoEntries.all { it.metadata.containsKey(TwoPaneScene.TWO_PANE_KEY) }
134+
return if (lastTwoEntries.size == 2 &&
135+
lastTwoEntries.all { it.metadata.containsKey(TwoPaneScene.TWO_PANE_KEY) }
136136
) {
137137
val firstEntry = lastTwoEntries.first()
138138
val secondEntry = lastTwoEntries.last()
@@ -203,4 +203,4 @@ fun MyAppContent() {
203203
}
204204
)
205205
}
206-
// [END android_compose_navigation3_scenes_4]
206+
// [END android_compose_navigation3_scenes_4]

compose/snippets/src/main/java/com/example/compose/snippets/navigation3/scenes/material/MaterialScenesSnippets.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class MaterialListDetailActivity : ComponentActivity() {
6666
NavDisplay(
6767
backStack = backStack,
6868
modifier = Modifier.padding(paddingValues),
69-
onBack = { keysToRemove -> repeat(keysToRemove){ backStack.removeLastOrNull() } },
69+
onBack = { keysToRemove -> repeat(keysToRemove) { backStack.removeLastOrNull() } },
7070
sceneStrategy = listDetailStrategy,
7171
entryProvider = entryProvider {
7272
entry<ProductList>(
@@ -76,10 +76,10 @@ class MaterialListDetailActivity : ComponentActivity() {
7676
}
7777
)
7878
) {
79-
ContentRed("Welcome to Nav3"){
79+
ContentRed("Welcome to Nav3") {
8080
Button(onClick = {
8181
backStack.add(ProductDetail("ABC"))
82-
} ) {
82+
}) {
8383
Text("View product")
8484
}
8585
}
@@ -108,4 +108,4 @@ class MaterialListDetailActivity : ComponentActivity() {
108108
}
109109
}
110110
}
111-
// [END android_compose_navigation3_scenes_material_1]
111+
// [END android_compose_navigation3_scenes_material_1]

compose/snippets/src/main/java/com/example/compose/snippets/ui/theme/Color.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,3 @@ val PastelBlue = Color(0xFF9BF6FF)
4040
val PastelMauve = Color(0xFFA0C4FF)
4141
val PastelPurple = Color(0xFFBDB2FF)
4242
val PastelPink = Color(0xFFFFC6FF)
43-

0 commit comments

Comments
 (0)