Skip to content

Commit 96a29e2

Browse files
committed
Spotless fixes
Change-Id: I6aad30ec69137b902465b8d409fb77782bbdc7df
1 parent a1fd2b0 commit 96a29e2

File tree

11 files changed

+88
-69
lines changed

11 files changed

+88
-69
lines changed

Jetcaster/core/domain-testing/build.gradle.kts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ plugins {
55

66
android {
77
namespace = "com.example.jetcaster.core.domain.testing"
8-
compileSdk = libs.versions.compileSdk.get().toInt()
8+
compileSdk =
9+
libs.versions.compileSdk
10+
.get()
11+
.toInt()
912

1013
defaultConfig {
11-
minSdk = libs.versions.minSdk.get().toInt()
14+
minSdk =
15+
libs.versions.minSdk
16+
.get()
17+
.toInt()
1218

1319
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
1420
consumerProguardFiles("consumer-rules.pro")
@@ -19,7 +25,7 @@ android {
1925
isMinifyEnabled = false
2026
proguardFiles(
2127
getDefaultProguardFile("proguard-android-optimize.txt"),
22-
"proguard-rules.pro"
28+
"proguard-rules.pro",
2329
)
2430
}
2531
}

Jetcaster/core/domain/build.gradle.kts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@ plugins {
66
}
77

88
android {
9-
compileSdk = libs.versions.compileSdk.get().toInt()
9+
compileSdk =
10+
libs.versions.compileSdk
11+
.get()
12+
.toInt()
1013
namespace = "com.example.jetcaster.core.domain"
1114

1215
defaultConfig {
13-
minSdk = libs.versions.minSdk.get().toInt()
16+
minSdk =
17+
libs.versions.minSdk
18+
.get()
19+
.toInt()
1420

1521
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
1622
consumerProguardFiles("consumer-rules.pro")
@@ -21,7 +27,7 @@ android {
2127
isMinifyEnabled = false
2228
proguardFiles(
2329
getDefaultProguardFile("proguard-android-optimize.txt"),
24-
"proguard-rules.pro"
30+
"proguard-rules.pro",
2531
)
2632
}
2733
}

Jetcaster/glancewidget/build.gradle.kts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@ plugins {
66

77
android {
88
namespace = "com.example.jetcaster.glancewidget"
9-
compileSdk = libs.versions.compileSdk.get().toInt()
9+
compileSdk =
10+
libs.versions.compileSdk
11+
.get()
12+
.toInt()
1013

1114
defaultConfig {
12-
minSdk = libs.versions.minSdk.get().toInt()
15+
minSdk =
16+
libs.versions.minSdk
17+
.get()
18+
.toInt()
1319
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
1420
}
1521

Jetcaster/glancewidget/src/main/java/com/example/jetcaster/glancewidget/JetcasterAppWidget.kt

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 The Android Open Source Project
2+
* Copyright 2024-2025 The Android Open Source Project
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -117,7 +117,6 @@ class JetcasterAppWidget : GlanceAppWidget() {
117117
get() = SizeMode.Exact
118118

119119
override suspend fun provideGlance(context: Context, id: GlanceId) {
120-
121120
val testState = JetcasterAppWidgetViewState(
122121
episodeTitle =
123122
"100 - Android 15 DP 1, Stable Studio Iguana, Cloud Photo Picker, and more!",
@@ -176,10 +175,10 @@ private fun WidgetUiNormal(
176175
playPauseIcon: PlayPauseIcon,
177176
iconSize: Dp,
178177
) {
179-
180178
Scaffold {
181179
Row(
182-
GlanceModifier.fillMaxSize(), verticalAlignment = Alignment.Vertical.CenterVertically
180+
GlanceModifier.fillMaxSize(),
181+
verticalAlignment = Alignment.Vertical.CenterVertically
183182
) {
184183
AlbumArt(imageUri, GlanceModifier.size(iconSize))
185184
PodcastText(title, subtitle, modifier = GlanceModifier.padding(16.dp).defaultWeight())
@@ -189,12 +188,9 @@ private fun WidgetUiNormal(
189188
}
190189

191190
@Composable
192-
private fun Widget(
193-
iconSize: Dp,
194-
imageUri: Uri,
195-
playPauseIcon: PlayPauseIcon,
196-
) {
197-
Scaffold(titleBar = {} /* title bar will be optional in scaffold in glance 1.1.0-beta3*/) {
191+
private fun Widget(iconSize: Dp, imageUri: Uri, playPauseIcon: PlayPauseIcon) {
192+
/* title bar will be optional in scaffold in glance 1.1.0-beta3*/
193+
Scaffold(titleBar = {}) {
198194
Row(
199195
modifier = GlanceModifier.fillMaxSize(),
200196
verticalAlignment = Alignment.Vertical.CenterVertically
@@ -214,10 +210,7 @@ private fun WidgetUiInvalidSize() {
214210
}
215211

216212
@Composable
217-
private fun AlbumArt(
218-
imageUri: Uri,
219-
modifier: GlanceModifier = GlanceModifier
220-
) {
213+
private fun AlbumArt(imageUri: Uri, modifier: GlanceModifier = GlanceModifier) {
221214
WidgetAsyncImage(uri = imageUri, contentDescription = null, modifier = modifier)
222215
}
223216

@@ -234,12 +227,12 @@ fun PodcastText(title: String, subtitle: String, modifier: GlanceModifier = Glan
234227
fontWeight = FontWeight.Medium,
235228
color = fgColor
236229
),
237-
maxLines = 2,
230+
maxLines = 2
238231
)
239232
Text(
240233
text = subtitle,
241234
style = TextStyle(fontSize = 14.sp, color = fgColor),
242-
maxLines = 2,
235+
maxLines = 2
243236
)
244237
}
245238
else -> Column(modifier) {
@@ -250,7 +243,7 @@ fun PodcastText(title: String, subtitle: String, modifier: GlanceModifier = Glan
250243
fontWeight = FontWeight.Medium,
251244
color = fgColor
252245
),
253-
maxLines = 1,
246+
maxLines = 1
254247
)
255248
}
256249
}
@@ -260,7 +253,7 @@ fun PodcastText(title: String, subtitle: String, modifier: GlanceModifier = Glan
260253
private fun PlayPauseButton(
261254
modifier: GlanceModifier = GlanceModifier.size(Sizes.normal),
262255
state: PlayPauseIcon,
263-
onClick: () -> Unit
256+
onClick: () -> Unit,
264257
) {
265258
val (iconRes: Int, description: Int) = when (state) {
266259
PlayPauseIcon.Play -> R.drawable.outline_play_arrow_24 to R.string.content_description_play
@@ -287,7 +280,7 @@ enum class PlayPauseIcon { Play, Pause }
287280
private fun WidgetAsyncImage(
288281
uri: Uri,
289282
contentDescription: String?,
290-
modifier: GlanceModifier = GlanceModifier
283+
modifier: GlanceModifier = GlanceModifier,
291284
) {
292285
var bitmap by remember { mutableStateOf<Bitmap?>(null) }
293286
val context = LocalContext.current

Jetcaster/glancewidget/src/main/java/com/example/jetcaster/glancewidget/JetcasterAppWidgetPreview.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 The Android Open Source Project
2+
* Copyright 2024-2025 The Android Open Source Project
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -56,7 +56,6 @@ private object SizesPreview {
5656
* In a real application, this would be called whenever the widget's state changes.
5757
*/
5858
fun updateWidgetPreview(context: Context) {
59-
6059
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
6160
CoroutineScope(Dispatchers.IO).launch {
6261
try {
@@ -68,7 +67,7 @@ fun updateWidgetPreview(context: Context) {
6867
JetcasterAppWidgetPreview().compose(
6968
context,
7069
size = DpSize(160.dp, 64.dp)
71-
),
70+
)
7271
)
7372
} catch (e: Exception) {
7473
Log.e(TAG, e.message, e)
@@ -82,7 +81,6 @@ class JetcasterAppWidgetPreview : GlanceAppWidget() {
8281
get() = SizeMode.Exact
8382

8483
override suspend fun provideGlance(context: Context, id: GlanceId) {
85-
8684
provideContent {
8785
GlanceTheme {
8886
Widget()
@@ -93,7 +91,6 @@ class JetcasterAppWidgetPreview : GlanceAppWidget() {
9391

9492
@Composable
9593
private fun Widget() {
96-
9794
Scaffold {
9895
Row(
9996
modifier = GlanceModifier.fillMaxSize(),

Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/JetcasterApp.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 The Android Open Source Project
2+
* Copyright 2020-2025 The Android Open Source Project
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,10 +19,10 @@
1919
package com.example.jetcaster.ui
2020

2121
import androidx.compose.animation.AnimatedVisibilityScope
22+
import androidx.compose.animation.EnterTransition
2223
import androidx.compose.animation.ExperimentalSharedTransitionApi
2324
import androidx.compose.animation.SharedTransitionLayout
2425
import androidx.compose.animation.SharedTransitionScope
25-
import androidx.compose.animation.EnterTransition
2626
import androidx.compose.animation.scaleOut
2727
import androidx.compose.material3.AlertDialog
2828
import androidx.compose.material3.Text
@@ -43,7 +43,7 @@ import com.example.jetcaster.ui.player.PlayerScreen
4343
@OptIn(ExperimentalSharedTransitionApi::class)
4444
fun JetcasterApp(
4545
displayFeatures: List<DisplayFeature>,
46-
appState: JetcasterAppState = rememberJetcasterAppState()
46+
appState: JetcasterAppState = rememberJetcasterAppState(),
4747
) {
4848
val adaptiveInfo = currentWindowAdaptiveInfo()
4949
if (appState.isOnline) {
@@ -65,7 +65,7 @@ fun JetcasterApp(
6565
windowSizeClass = adaptiveInfo.windowSizeClass,
6666
navigateToPlayer = { episode ->
6767
appState.navigateToPlayer(episode.uri, backStackEntry)
68-
},
68+
}
6969
)
7070
}
7171
}
@@ -76,7 +76,7 @@ fun JetcasterApp(
7676
PlayerScreen(
7777
windowSizeClass = adaptiveInfo.windowSizeClass,
7878
displayFeatures = displayFeatures,
79-
onBackPress = appState::navigateBack,
79+
onBackPress = appState::navigateBack
8080
)
8181
}
8282
}

Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 The Android Open Source Project
2+
* Copyright 2020-2025 The Android Open Source Project
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/home/Home.kt

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@ import com.example.jetcaster.util.fullWidthItem
119119
import com.example.jetcaster.util.isCompact
120120
import com.example.jetcaster.util.quantityStringResource
121121
import com.example.jetcaster.util.radialGradientScrim
122-
import kotlinx.collections.immutable.PersistentList
123-
import kotlinx.collections.immutable.toPersistentList
124-
import kotlinx.coroutines.launch
125122
import java.time.Duration
126123
import java.time.LocalDateTime
127124
import java.time.OffsetDateTime
125+
import kotlinx.collections.immutable.PersistentList
126+
import kotlinx.collections.immutable.toPersistentList
127+
import kotlinx.coroutines.launch
128128

129129
@OptIn(ExperimentalMaterial3AdaptiveApi::class)
130130
private fun <T> ThreePaneScaffoldNavigator<T>.isMainPaneHidden(): Boolean =
@@ -188,14 +188,13 @@ fun calculateScaffoldDirective(
188188
/**
189189
* Copied from `getExcludedVerticalBounds()` in [PaneScaffoldDirective] since it is private.
190190
*/
191-
private fun getExcludedVerticalBounds(posture: Posture, hingePolicy: HingePolicy): List<Rect> {
192-
return when (hingePolicy) {
191+
private fun getExcludedVerticalBounds(posture: Posture, hingePolicy: HingePolicy): List<Rect> =
192+
when (hingePolicy) {
193193
HingePolicy.AvoidSeparating -> posture.separatingVerticalHingeBounds
194194
HingePolicy.AvoidOccluding -> posture.occludingVerticalHingeBounds
195195
HingePolicy.AlwaysAvoid -> posture.allVerticalHingeBounds
196196
else -> emptyList()
197197
}
198-
}
199198

200199
@Composable
201200
fun MainScreen(
@@ -468,15 +467,15 @@ private fun HomeScreen(
468467
fun PillToolbar(
469468
selectedHomeCategory: HomeCategory,
470469
onHomeAction: (HomeAction) -> Unit,
471-
modifier: Modifier = Modifier
470+
modifier: Modifier = Modifier,
472471
) {
473472
HorizontalFloatingToolbar(
474473
modifier = modifier,
475474
colors = FloatingToolbarColors(
476475
toolbarContainerColor = MaterialTheme.colorScheme.surfaceContainerHighest,
477476
toolbarContentColor = MaterialTheme.colorScheme.onSurfaceVariant,
478477
fabContainerColor = MaterialTheme.colorScheme.tertiary,
479-
fabContentColor = MaterialTheme.colorScheme.onTertiary,
478+
fabContentColor = MaterialTheme.colorScheme.onTertiary
480479
),
481480
expanded = true,
482481
content = {
@@ -507,7 +506,9 @@ fun PillToolbar(
507506
Icon(
508507
Icons.Filled.LibraryMusic,
509508
modifier = Modifier.padding(end = 8.dp),
510-
contentDescription = stringResource(R.string.library_toolbar_content_description)
509+
contentDescription = stringResource(
510+
R.string.library_toolbar_content_description
511+
)
511512
)
512513
Text(stringResource(R.string.library_toolbar))
513514
}
@@ -540,13 +541,14 @@ fun PillToolbar(
540541
Icon(
541542
painterResource(R.drawable.genres),
542543
modifier = Modifier.padding(end = 8.dp),
543-
contentDescription = stringResource(R.string.discover_toolbar_content_description)
544+
contentDescription = stringResource(
545+
R.string.discover_toolbar_content_description
546+
)
544547
)
545548
Text(stringResource(R.string.discover_toolbar))
546549
}
547550
}
548-
549-
},
551+
}
550552
)
551553
}
552554

@@ -606,7 +608,9 @@ private fun HomeContentGrid(
606608
fullWidthItem {
607609
FollowedPodcastItem(
608610
items = featuredPodcasts,
609-
onPodcastUnfollowed = { onHomeAction(HomeAction.PodcastUnfollowed(it)) },
611+
onPodcastUnfollowed = {
612+
onHomeAction(HomeAction.PodcastUnfollowed(it))
613+
},
610614
navigateToPodcastDetails = navigateToPodcastDetails,
611615
modifier = Modifier
612616
.fillMaxWidth()
@@ -618,7 +622,7 @@ private fun HomeContentGrid(
618622
library = library,
619623
navigateToPlayer = navigateToPlayer,
620624
onQueueEpisode = { onHomeAction(HomeAction.QueueEpisode(it)) },
621-
removeFromQueue = { onHomeAction(HomeAction.RemoveEpisode(it)) },
625+
removeFromQueue = { onHomeAction(HomeAction.RemoveEpisode(it)) }
622626
)
623627
}
624628

@@ -633,7 +637,7 @@ private fun HomeContentGrid(
633637
onHomeAction(HomeAction.TogglePodcastFollowed(it))
634638
},
635639
onQueueEpisode = { onHomeAction(HomeAction.QueueEpisode(it)) },
636-
removeFromQueue = { onHomeAction(HomeAction.RemoveEpisode(it)) },
640+
removeFromQueue = { onHomeAction(HomeAction.RemoveEpisode(it)) }
637641
)
638642
}
639643
}
@@ -654,7 +658,7 @@ private fun FollowedPodcastItem(
654658
items = items,
655659
onPodcastUnfollowed = onPodcastUnfollowed,
656660
navigateToPodcastDetails = navigateToPodcastDetails,
657-
modifier = Modifier.fillMaxWidth(),
661+
modifier = Modifier.fillMaxWidth()
658662
)
659663

660664
Spacer(Modifier.height(16.dp))
@@ -720,7 +724,7 @@ private fun FollowedPodcastCarouselItem(
720724
contentDescription = podcastTitle,
721725
modifier = Modifier
722726
.fillMaxSize()
723-
.clip(MaterialTheme.shapes.medium),
727+
.clip(MaterialTheme.shapes.medium)
724728
)
725729
ToggleFollowPodcastIconButton(
726730
onClick = onUnfollowedClick,

0 commit comments

Comments
 (0)