Skip to content

Commit f009e2b

Browse files
committed
run spotless again
1 parent 5db0fb4 commit f009e2b

3 files changed

Lines changed: 351 additions & 347 deletions

File tree

Jetsnack/app/build.gradle.kts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,22 @@ plugins {
2222
}
2323

2424
android {
25-
compileSdk = libs.versions.compileSdk.get().toInt()
25+
compileSdk =
26+
libs.versions.compileSdk
27+
.get()
28+
.toInt()
2629
namespace = "com.example.jetsnack"
2730

2831
defaultConfig {
2932
applicationId = "com.example.jetsnack"
30-
minSdk = libs.versions.minSdk.get().toInt()
31-
targetSdk = libs.versions.targetSdk.get().toInt()
33+
minSdk =
34+
libs.versions.minSdk
35+
.get()
36+
.toInt()
37+
targetSdk =
38+
libs.versions.targetSdk
39+
.get()
40+
.toInt()
3241
versionCode = 1
3342
versionName = "1.0"
3443
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
@@ -49,15 +58,14 @@ android {
4958

5059
buildTypes {
5160
getByName("debug") {
52-
5361
}
5462

5563
getByName("release") {
5664
isMinifyEnabled = true
5765
signingConfig = signingConfigs.getByName("release")
5866
proguardFiles(
5967
getDefaultProguardFile("proguard-android-optimize.txt"),
60-
"proguard-rules.pro"
68+
"proguard-rules.pro",
6169
)
6270
}
6371

@@ -67,7 +75,7 @@ android {
6775
matchingFallbacks.add("release")
6876
proguardFiles(
6977
getDefaultProguardFile("proguard-android-optimize.txt"),
70-
"proguard-benchmark-rules.pro"
78+
"proguard-benchmark-rules.pro",
7179
)
7280
isDebuggable = false
7381
}

Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/Home.kt

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -92,28 +92,28 @@ fun NavGraphBuilder.composableWithCompositionLocal(
9292
arguments: List<NamedNavArgument> = emptyList(),
9393
deepLinks: List<NavDeepLink> = emptyList(),
9494
enterTransition: (
95-
@JvmSuppressWildcards
96-
AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition?
95+
@JvmSuppressWildcards AnimatedContentTransitionScope<NavBackStackEntry>.()
96+
-> EnterTransition?
9797
)? = {
9898
fadeIn(nonSpatialExpressiveSpring())
9999
},
100100
exitTransition: (
101-
@JvmSuppressWildcards
102-
AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition?
101+
@JvmSuppressWildcards AnimatedContentTransitionScope<NavBackStackEntry>.()
102+
-> ExitTransition?
103103
)? = {
104104
fadeOut(nonSpatialExpressiveSpring())
105105
},
106106
popEnterTransition: (
107-
@JvmSuppressWildcards
108-
AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition?
107+
@JvmSuppressWildcards AnimatedContentTransitionScope<NavBackStackEntry>.()
108+
-> EnterTransition?
109109
)? =
110110
enterTransition,
111111
popExitTransition: (
112-
@JvmSuppressWildcards
113-
AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition?
112+
@JvmSuppressWildcards AnimatedContentTransitionScope<NavBackStackEntry>.()
113+
-> ExitTransition?
114114
)? =
115115
exitTransition,
116-
content: @Composable AnimatedContentScope.(NavBackStackEntry) -> Unit
116+
content: @Composable AnimatedContentScope.(NavBackStackEntry) -> Unit,
117117
) {
118118
composable(
119119
route,
@@ -134,7 +134,7 @@ fun NavGraphBuilder.composableWithCompositionLocal(
134134

135135
fun NavGraphBuilder.addHomeGraph(
136136
onSnackSelected: (Long, String, NavBackStackEntry) -> Unit,
137-
modifier: Modifier = Modifier
137+
modifier: Modifier = Modifier,
138138
) {
139139
composable(HomeSections.FEED.route) { from ->
140140
Feed(
@@ -151,7 +151,7 @@ fun NavGraphBuilder.addHomeGraph(
151151
composable(
152152
HomeSections.CART.route,
153153
deepLinks = listOf(
154-
navDeepLink { uriPattern = "https://jetsnack.example.com/home/cart"}
154+
navDeepLink { uriPattern = "https://jetsnack.example.com/home/cart" }
155155
)
156156
) { from ->
157157
Cart(
@@ -164,15 +164,11 @@ fun NavGraphBuilder.addHomeGraph(
164164
}
165165
}
166166

167-
enum class HomeSections(
168-
@StringRes val title: Int,
169-
val icon: ImageVector,
170-
val route: String
171-
) {
167+
enum class HomeSections(@StringRes val title: Int, val icon: ImageVector, val route: String) {
172168
FEED(R.string.home_feed, Icons.Outlined.Home, "home/feed"),
173169
SEARCH(R.string.home_search, Icons.Outlined.Search, "home/search"),
174170
CART(R.string.home_cart, Icons.Outlined.ShoppingCart, "home/cart"),
175-
PROFILE(R.string.home_profile, Icons.Outlined.AccountCircle, "home/profile")
171+
PROFILE(R.string.home_profile, Icons.Outlined.AccountCircle, "home/profile"),
176172
}
177173

178174
@Composable
@@ -182,7 +178,7 @@ fun JetsnackBottomBar(
182178
navigateToRoute: (String) -> Unit,
183179
modifier: Modifier = Modifier,
184180
color: Color = JetsnackTheme.colors.iconPrimary,
185-
contentColor: Color = JetsnackTheme.colors.iconInteractive
181+
contentColor: Color = JetsnackTheme.colors.iconInteractive,
186182
) {
187183
val routes = remember { tabs.map { it.route } }
188184
val currentSection = tabs.first { it.route == currentRoute }
@@ -251,7 +247,7 @@ private fun JetsnackBottomNavLayout(
251247
animSpec: AnimationSpec<Float>,
252248
indicator: @Composable BoxScope.() -> Unit,
253249
modifier: Modifier = Modifier,
254-
content: @Composable () -> Unit
250+
content: @Composable () -> Unit,
255251
) {
256252
// Track how "selected" each item is [0, 1]
257253
val selectionFractions = remember(itemCount) {
@@ -328,11 +324,12 @@ fun JetsnackBottomNavigationItem(
328324
selected: Boolean,
329325
onSelected: () -> Unit,
330326
animSpec: AnimationSpec<Float>,
331-
modifier: Modifier = Modifier
327+
modifier: Modifier = Modifier,
332328
) {
333329
// Animate the icon/text positions within the item based on selection
334330
val animationProgress by animateFloatAsState(
335-
if (selected) 1f else 0f, animSpec,
331+
if (selected) 1f else 0f,
332+
animSpec,
336333
label = "animation progress"
337334
)
338335
JetsnackBottomNavItemLayout(
@@ -350,7 +347,7 @@ private fun JetsnackBottomNavItemLayout(
350347
icon: @Composable BoxScope.() -> Unit,
351348
text: @Composable BoxScope.() -> Unit,
352349
@FloatRange(from = 0.0, to = 1.0) animationProgress: Float,
353-
modifier: Modifier = Modifier
350+
modifier: Modifier = Modifier,
354351
) {
355352
Layout(
356353
modifier = modifier,
@@ -394,7 +391,7 @@ private fun MeasureScope.placeTextAndIcon(
394391
iconPlaceable: Placeable,
395392
width: Int,
396393
height: Int,
397-
@FloatRange(from = 0.0, to = 1.0) animationProgress: Float
394+
@FloatRange(from = 0.0, to = 1.0) animationProgress: Float,
398395
): MeasureResult {
399396
val iconY = (height - iconPlaceable.height) / 2
400397
val textY = (height - textPlaceable.height) / 2
@@ -415,7 +412,7 @@ private fun MeasureScope.placeTextAndIcon(
415412
private fun JetsnackBottomNavIndicator(
416413
strokeWidth: Dp = 2.dp,
417414
color: Color = JetsnackTheme.colors.iconInteractive,
418-
shape: Shape = BottomNavIndicatorShape
415+
shape: Shape = BottomNavIndicatorShape,
419416
) {
420417
Spacer(
421418
modifier = Modifier

0 commit comments

Comments
 (0)