Skip to content

Commit dc29a5e

Browse files
committed
run spotless
1 parent b91a965 commit dc29a5e

File tree

18 files changed

+21
-66
lines changed

18 files changed

+21
-66
lines changed

app/src/main/kotlin/com/google/samples/apps/nowinandroid/MainActivity.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ import kotlinx.coroutines.flow.map
5555
import kotlinx.coroutines.flow.onEach
5656
import kotlinx.coroutines.launch
5757
import javax.inject.Inject
58-
import javax.inject.Provider
5958

6059
@AndroidEntryPoint
6160
class MainActivity : ComponentActivity() {
@@ -166,7 +165,7 @@ class MainActivity : ComponentActivity() {
166165
) {
167166
NiaApp(
168167
appState,
169-
entryProviderBuilders = entryProviderBuilders
168+
entryProviderBuilders = entryProviderBuilders,
170169
)
171170
}
172171
}

app/src/main/kotlin/com/google/samples/apps/nowinandroid/di/NiaNavigatorProvider.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,16 @@
1616

1717
package com.google.samples.apps.nowinandroid.di
1818

19-
import androidx.navigation3.runtime.EntryProviderScope
20-
import com.google.samples.apps.nowinandroid.core.navigation.NiaNavigator
2119
import com.google.samples.apps.nowinandroid.core.navigation.NiaNavKey
2220
import com.google.samples.apps.nowinandroid.core.navigation.NiaNavigatorState
2321
import com.google.samples.apps.nowinandroid.navigation.TopLevelDestination
2422
import dagger.Module
2523
import dagger.Provides
2624
import dagger.hilt.InstallIn
27-
import dagger.hilt.android.components.ActivityComponent
28-
import dagger.hilt.android.scopes.ActivityRetainedScoped
2925
import dagger.hilt.components.SingletonComponent
3026
import kotlinx.serialization.modules.PolymorphicModuleBuilder
3127
import kotlinx.serialization.modules.SerializersModule
3228
import kotlinx.serialization.modules.polymorphic
33-
import javax.inject.Provider
3429
import javax.inject.Singleton
3530

3631
@Module
@@ -50,8 +45,6 @@ object NiaNavigatorProvider {
5045
// ): NiaNavigator =
5146
// NiaNavigator(state)
5247

53-
54-
5548
/**
5649
* Registers feature modules' polymorphic serializers to support
5750
* feature keys' save and restore by savedstate

app/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/NiaNavDisplay.kt

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,11 @@ package com.google.samples.apps.nowinandroid.navigation
1919
import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi
2020
import androidx.compose.material3.adaptive.navigation3.rememberListDetailSceneStrategy
2121
import androidx.compose.runtime.Composable
22-
import androidx.compose.runtime.LaunchedEffect
23-
import androidx.compose.runtime.key
24-
import androidx.compose.runtime.remember
25-
import androidx.compose.runtime.snapshots.SnapshotStateList
26-
import androidx.lifecycle.viewmodel.navigation3.rememberViewModelStoreNavEntryDecorator
2722
import androidx.navigation3.runtime.EntryProviderScope
28-
import androidx.navigation3.runtime.NavEntry
29-
import androidx.navigation3.runtime.NavEntryDecorator
30-
import androidx.navigation3.runtime.entryProvider
31-
import androidx.navigation3.runtime.rememberDecoratedNavEntries
3223
import androidx.navigation3.ui.NavDisplay
33-
import com.google.samples.apps.nowinandroid.core.navigation.NiaNavigator
3424
import com.google.samples.apps.nowinandroid.core.navigation.NiaNavKey
25+
import com.google.samples.apps.nowinandroid.core.navigation.NiaNavigator
3526
import com.google.samples.apps.nowinandroid.core.navigation.getEntries
36-
import com.google.samples.apps.nowinandroid.feature.bookmarks.api.navigation.BookmarksRoute
37-
import com.google.samples.apps.nowinandroid.feature.foryou.api.navigation.ForYouRoute
38-
import com.google.samples.apps.nowinandroid.feature.interests.api.navigation.InterestsRoute
39-
import kotlin.collections.forEach
4027
import kotlin.collections.plus
4128

4229
@OptIn(ExperimentalMaterial3AdaptiveApi::class)

app/src/testDemo/kotlin/com/google/samples/apps/nowinandroid/ui/TestUtil.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
package com.google.samples.apps.nowinandroid.ui
1818

1919
import androidx.navigation3.runtime.EntryProviderScope
20-
import com.google.samples.apps.nowinandroid.core.navigation.NiaNavigator
2120
import com.google.samples.apps.nowinandroid.core.navigation.NiaNavKey
21+
import com.google.samples.apps.nowinandroid.core.navigation.NiaNavigator
2222
import com.google.samples.apps.nowinandroid.feature.foryou.api.navigation.ForYouRoute
2323
import com.google.samples.apps.nowinandroid.feature.foryou.impl.ForYouScreen
2424

benchmarks/README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<<<<<<< HEAD
21
# `:benchmarks`
32

43
## Module dependency graph
@@ -133,8 +132,3 @@ classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;
133132

134133
</details>
135134
<!--endregion-->
136-
=======
137-
# :benchmarks module
138-
## Dependency graph
139-
![Dependency graph](../docs/images/graphs/dep_graph_benchmarks.svg)
140-
>>>>>>> a059e426 (Update readme and build dependency graph)

core/navigation/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/navigation/NiaBackStackViewModelTest.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616

1717
package com.google.samples.apps.nowinandroid.core.navigation
1818

19-
import androidx.compose.runtime.mutableStateListOf
2019
import androidx.compose.runtime.remember
21-
import androidx.compose.runtime.snapshots.SnapshotStateList
2220
import androidx.compose.ui.test.junit4.createComposeRule
2321
import androidx.lifecycle.SavedStateHandle
2422
import androidx.lifecycle.createSavedStateHandle
@@ -69,7 +67,7 @@ class NiaBackStackViewModelTest {
6967
fun testNonTopLevelKeySaved() {
7068
val viewModel = createViewModel()
7169
rule.setContent {
72-
val navigator = remember { NiaNavigator( viewModel.niaNavigatorState) }
70+
val navigator = remember { NiaNavigator(viewModel.niaNavigatorState) }
7371
navigator.navigate(TestKeyFirst)
7472
}
7573
assertThat(viewModel.backStackMap.size).isEqualTo(1)
@@ -82,7 +80,7 @@ class NiaBackStackViewModelTest {
8280
fun testTopLevelKeySaved() {
8381
val viewModel = createViewModel()
8482
rule.setContent {
85-
val navigator = remember { NiaNavigator( viewModel.niaNavigatorState) }
83+
val navigator = remember { NiaNavigator(viewModel.niaNavigatorState) }
8684

8785
navigator.navigate(TestKeyFirst)
8886
navigator.navigate(TestTopLevelKeyFirst)
@@ -103,7 +101,7 @@ class NiaBackStackViewModelTest {
103101
fun testMultiStacksSaved() {
104102
val viewModel = createViewModel()
105103
rule.setContent {
106-
val navigator = remember { NiaNavigator( viewModel.niaNavigatorState) }
104+
val navigator = remember { NiaNavigator(viewModel.niaNavigatorState) }
107105
navigator.navigate(TestKeyFirst)
108106
navigator.navigate(TestTopLevelKeyFirst)
109107
navigator.navigate(TestKeySecond)
@@ -124,7 +122,7 @@ class NiaBackStackViewModelTest {
124122
fun testPopSaved() {
125123
val viewModel = createViewModel()
126124
rule.setContent {
127-
val navigator = remember { NiaNavigator( viewModel.niaNavigatorState) }
125+
val navigator = remember { NiaNavigator(viewModel.niaNavigatorState) }
128126

129127
navigator.navigate(TestKeyFirst)
130128

core/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/core/navigation/NiaBackStackViewModel.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class NiaBackStackViewModel @Inject constructor(
4646
internal var backStackMap by savedStateHandle.saved(
4747
serializer = MapSerializer(
4848
serializer<NiaNavKey>(),
49-
serializer<List<NiaNavKey>>()
49+
serializer<List<NiaNavKey>>(),
5050
),
5151
configuration = config,
5252
) {
@@ -63,7 +63,7 @@ class NiaBackStackViewModel @Inject constructor(
6363

6464
init {
6565
if (backStackMap.isNotEmpty()) {
66-
// Restore backstack from saved state handle if not emtpy
66+
// Restore backstack from saved state handle if not emtpy
6767
@Suppress("UNCHECKED_CAST")
6868
niaNavigatorState.restore(
6969
activeTopLeveLKeys,
@@ -79,4 +79,4 @@ class NiaBackStackViewModel @Inject constructor(
7979
}.collect()
8080
}
8181
}
82-
}
82+
}

core/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/core/navigation/NiaNavigator.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class NiaNavigatorState(
7878

7979
// https://github.com/android/nowinandroid/issues/1934
8080
class NiaNavigator @Inject constructor(
81-
val navigatorState: NiaNavigatorState
81+
val navigatorState: NiaNavigatorState,
8282
) {
8383
fun navigate(key: NiaNavKey) {
8484
val currentActiveSubStacks = linkedSetOf<NiaNavKey>()
@@ -117,8 +117,6 @@ class NiaNavigator @Inject constructor(
117117
}
118118
updateActiveTopLevelKeys(currentActiveSubStacks.toList())
119119
}
120-
121-
122120
}
123121

124122
fun pop() {
@@ -148,7 +146,7 @@ public fun NiaNavigatorState.getEntries(
148146
val decorated = key(topLevelKey) {
149147
val decorators = listOf(
150148
rememberSaveableStateHolderNavEntryDecorator(),
151-
rememberViewModelStoreNavEntryDecorator<NiaNavKey>()
149+
rememberViewModelStoreNavEntryDecorator<NiaNavKey>(),
152150
)
153151
rememberDecoratedNavEntries(
154152
backStack = backStacks[topLevelKey]!!,
@@ -161,4 +159,4 @@ public fun NiaNavigatorState.getEntries(
161159
)
162160
}
163161
entries + decorated
164-
}
162+
}

feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/navigation/BookmarksEntryProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import androidx.compose.material3.SnackbarHostState
2121
import androidx.compose.material3.SnackbarResult.ActionPerformed
2222
import androidx.compose.runtime.compositionLocalOf
2323
import androidx.navigation3.runtime.EntryProviderScope
24-
import com.google.samples.apps.nowinandroid.core.navigation.NiaNavigator
2524
import com.google.samples.apps.nowinandroid.core.navigation.NiaNavKey
25+
import com.google.samples.apps.nowinandroid.core.navigation.NiaNavigator
2626
import com.google.samples.apps.nowinandroid.feature.bookmarks.api.navigation.BookmarksRoute
2727
import com.google.samples.apps.nowinandroid.feature.bookmarks.impl.BookmarksScreen
2828
import com.google.samples.apps.nowinandroid.feature.topic.api.navigation.navigateToTopic

feature/foryou/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/navigation/ForYouEntryProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
package com.google.samples.apps.nowinandroid.feature.foryou.impl.navigation
1818

1919
import androidx.navigation3.runtime.EntryProviderScope
20-
import com.google.samples.apps.nowinandroid.core.navigation.NiaNavigator
2120
import com.google.samples.apps.nowinandroid.core.navigation.NiaNavKey
21+
import com.google.samples.apps.nowinandroid.core.navigation.NiaNavigator
2222
import com.google.samples.apps.nowinandroid.feature.foryou.api.navigation.ForYouRoute
2323
import com.google.samples.apps.nowinandroid.feature.foryou.impl.ForYouScreen
2424
import com.google.samples.apps.nowinandroid.feature.topic.api.navigation.navigateToTopic

0 commit comments

Comments
 (0)