Skip to content

Commit 81f4d23

Browse files
committed
Spotless apply
1 parent 0974143 commit 81f4d23

20 files changed

+468
-725
lines changed

Jetcaster/gradle/libs.versions.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ gradle-versions = "0.52.0"
3838
hilt = "2.56.2"
3939
hiltExt = "1.2.0"
4040
horologist = "0.7.14-beta"
41-
# @pin When updating to AGP 7.4.0-alpha10 and up we can update this https://developer.android.com/studio/write/java8-support#library-desugaring-versions
4241
jdkDesugar = "2.1.5"
4342
junit = "4.13.2"
4443
kotlin = "2.1.20"
@@ -60,8 +59,6 @@ spotless = "7.0.3"
6059
# @keep
6160
targetSdk = "33"
6261
version-catalog-update = "1.0.0"
63-
material3Android = "1.3.1"
64-
media3CommonKtx = "1.7.1"
6562

6663
[libraries]
6764
accompanist-adaptive = { module = "com.google.accompanist:accompanist-adaptive", version.ref = "accompanist" }
@@ -170,8 +167,7 @@ rometools-modules = { module = "com.rometools:rome-modules", version.ref = "rome
170167
rometools-rome = { module = "com.rometools:rome", version.ref = "rome" }
171168
androidx-media3-session = {module = "androidx.media3:media3-session",version.ref = "media3"}
172169
androidx-media3-exoplayer = {module = "androidx.media3:media3-exoplayer", version.ref = "media3"}
173-
androidx-material3-android = { group = "androidx.compose.material3", name = "material3-android", version.ref = "material3Android" }
174-
androidx-media3-common-ktx = { group = "androidx.media3", name = "media3-common-ktx", version.ref = "media3CommonKtx" }
170+
androidx-media3-common-ktx = { group = "androidx.media3", name = "media3-common-ktx", version.ref = "media3" }
175171

176172
[plugins]
177173
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }

Jetcaster/wear/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ plugins {
2020
alias(libs.plugins.ksp)
2121
alias(libs.plugins.hilt)
2222
alias(libs.plugins.compose)
23-
alias(libs.plugins.kotlin.serialization)
2423
}
2524

2625
android {
@@ -75,7 +74,6 @@ android {
7574

7675
dependencies {
7776

78-
implementation libs.androidx.media3.common.ktx
7977
def composeBom = platform(libs.androidx.compose.bom)
8078

8179
// General compose dependencies
@@ -92,7 +90,7 @@ dependencies {
9290
implementation libs.androidx.wear.compose.material
9391

9492
// For using the phone Typography
95-
implementation libs.androidx.material3.android
93+
implementation libs.androidx.compose.material3
9694

9795
implementation(libs.kotlinx.collections.immutable)
9896

@@ -104,6 +102,7 @@ dependencies {
104102
implementation(libs.androidx.media3.exoplayer)
105103
implementation(libs.androidx.media3.ui.compose)
106104
implementation(libs.androidx.media3.session)
105+
implementation libs.androidx.media3.common.ktx
107106

108107
// Horologist for correct Compose layout
109108
implementation libs.horologist.compose.layout

Jetcaster/wear/src/main/java/com/example/jetcaster/MainActivity.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package com.example.jetcaster
1919
import android.os.Bundle
2020
import androidx.activity.ComponentActivity
2121
import androidx.activity.compose.setContent
22-
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
2322
import androidx.navigation.NavHostController
2423
import androidx.wear.compose.navigation.rememberSwipeDismissableNavController
2524
import dagger.hilt.android.AndroidEntryPoint

Jetcaster/wear/src/main/java/com/example/jetcaster/WearApp.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ import androidx.compose.ui.graphics.Color
2525
import androidx.lifecycle.compose.collectAsStateWithLifecycle
2626
import androidx.lifecycle.viewmodel.compose.viewModel
2727
import androidx.navigation.NavHostController
28-
import androidx.wear.compose.navigation.SwipeDismissableNavHost
29-
import androidx.wear.compose.navigation.composable
3028
import androidx.wear.compose.foundation.pager.rememberPagerState
3129
import androidx.wear.compose.material3.AppScaffold
3230
import androidx.wear.compose.material3.ScreenScaffold
31+
import androidx.wear.compose.navigation.SwipeDismissableNavHost
32+
import androidx.wear.compose.navigation.composable
3333
import androidx.wear.compose.navigation.rememberSwipeDismissableNavHostState
3434
import com.example.jetcaster.theme.WearAppTheme
3535
import com.example.jetcaster.ui.Episode
@@ -49,8 +49,8 @@ import com.example.jetcaster.ui.player.PlayerScreen
4949
import com.example.jetcaster.ui.podcast.PodcastDetailsScreen
5050
import com.example.jetcaster.ui.podcasts.PodcastsScreen
5151
import com.example.jetcaster.ui.queue.QueueScreen
52-
import com.google.android.horologist.audio.ui.material3.VolumeScreen
5352
import com.google.android.horologist.audio.ui.VolumeViewModel
53+
import com.google.android.horologist.audio.ui.material3.VolumeScreen
5454
import com.google.android.horologist.media.ui.material3.navigation.MediaNavController.navigateToPlayer
5555
import com.google.android.horologist.media.ui.material3.navigation.MediaNavController.navigateToVolume
5656
import com.google.android.horologist.media.ui.material3.navigation.NavigationScreens

Jetcaster/wear/src/main/java/com/example/jetcaster/theme/ColorScheme.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import com.example.jetcaster.designsystem.theme.tertiaryDark
4444

4545
internal val wearColorPalette: ColorScheme = ColorScheme(
4646
primary = primaryDark,
47-
primaryDim= primaryDark,
47+
primaryDim = primaryDark,
4848
onPrimary = Color(0xFF542104),
4949
primaryContainer = primaryContainerDark,
5050
onPrimaryContainer = onPrimaryContainerDark,
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 The Android Open Source Project
2+
* Copyright 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.
@@ -14,14 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.example.jetcaster.ui.components
17+
package com.example.jetcaster.theme
1818

1919
import androidx.compose.foundation.shape.RoundedCornerShape
20-
import androidx.compose.runtime.Composable
2120
import androidx.compose.ui.unit.dp
22-
import androidx.wear.compose.material3.IconButtonShapes
21+
import androidx.wear.compose.material3.Shapes
2322

24-
@Composable
25-
fun PlayIconShape(): IconButtonShapes {
26-
return IconButtonShapes(RoundedCornerShape(16.dp))
27-
}
23+
val Shapes = Shapes(
24+
medium = RoundedCornerShape(16.dp),
25+
)

Jetcaster/wear/src/main/java/com/example/jetcaster/theme/WearAppTheme.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ fun WearAppTheme(content: @Composable () -> Unit) {
2424
MaterialTheme(
2525
colorScheme = wearColorPalette,
2626
typography = Typography,
27-
// For shapes, we generally recommend using the default Material Wear shapes which are
28-
// optimized for round devices.
29-
content = content
27+
shapes = Shapes,
28+
content = content,
3029
)
3130
}

Jetcaster/wear/src/main/java/com/example/jetcaster/ui/JetcasterNavController.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ import androidx.navigation.NamedNavArgument
2121
import androidx.navigation.NavController
2222
import androidx.navigation.NavType
2323
import androidx.navigation.navArgument
24-
import com.google.android.horologist.media.ui.material3.navigation.MediaNavController.navigateToPlayer
25-
import com.google.android.horologist.media.ui.material3.navigation.MediaNavController.navigateToVolume
2624
import com.google.android.horologist.media.ui.material3.navigation.NavigationScreens
27-
import com.google.android.horologist.media.ui.material3.screens.playerlibrarypager.PlayerLibraryPagerScreen
2825

2926
/**
3027
* NavController extensions that links to the screens of the Jetcaster app.
@@ -92,4 +89,4 @@ public object Episode : NavigationScreens("episode?episodeUri={episodeUri}") {
9289

9390
public object UpNext : NavigationScreens("upNext") {
9491
public fun destination(): String = navRoute
95-
}
92+
}

Jetcaster/wear/src/main/java/com/example/jetcaster/ui/components/MediaContent.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import androidx.compose.foundation.shape.CircleShape
2424
import androidx.compose.runtime.Composable
2525
import androidx.compose.ui.Modifier
2626
import androidx.compose.ui.draw.clip
27-
import androidx.compose.ui.graphics.Color
2827
import androidx.compose.ui.graphics.painter.Painter
2928
import androidx.compose.ui.layout.ContentScale
3029
import androidx.compose.ui.res.painterResource
@@ -50,9 +49,9 @@ import java.time.format.FormatStyle
5049
@Composable
5150
fun MediaContent(
5251
episode: PlayerEpisode,
53-
episodeArtworkPlaceholder: Painter = painterResource(id = R.drawable.music),
5452
onItemClick: (PlayerEpisode) -> Unit,
5553
modifier: Modifier = Modifier,
54+
episodeArtworkPlaceholder: Painter = painterResource(id = R.drawable.music),
5655
) {
5756
val mediaTitle = episode.title
5857
val duration = episode.duration
@@ -76,15 +75,15 @@ fun MediaContent(
7675
Text(
7776
mediaTitle,
7877
maxLines = 1,
79-
overflow = TextOverflow.Ellipsis
78+
overflow = TextOverflow.Ellipsis,
8079
)
8180
},
8281
onClick = { onItemClick(episode) },
8382
secondaryLabel = {
8483
Text(
8584
secondaryLabel,
8685
maxLines = 1,
87-
overflow = TextOverflow.Ellipsis
86+
overflow = TextOverflow.Ellipsis,
8887
)
8988
},
9089
icon = {
@@ -96,13 +95,13 @@ fun MediaContent(
9695
contentScale = ContentScale.Crop,
9796
modifier = Modifier
9897
.size(
99-
ButtonDefaults.LargeIconSize
98+
ButtonDefaults.LargeIconSize,
10099
)
101-
.clip(CircleShape)
100+
.clip(CircleShape),
102101

103102
)
104103
},
105-
modifier = modifier.fillMaxWidth()
104+
modifier = modifier.fillMaxWidth(),
106105
)
107106
}
108107

@@ -111,21 +110,22 @@ fun MediaContent(
111110
@Composable
112111
fun MediaContentPreview(
113112
@PreviewParameter(WearPreviewEpisodes::class)
114-
episode: PlayerEpisode
113+
episode: PlayerEpisode,
114+
modifier: Modifier = Modifier,
115115
) {
116-
AppScaffold {
116+
AppScaffold(modifier = modifier) {
117117
val contentPadding = rememberResponsiveColumnPadding(
118-
first = ColumnItemType.Button
118+
first = ColumnItemType.Button,
119119
)
120120

121121
ScreenScaffold(contentPadding = contentPadding) {
122122
Box(
123123
modifier = Modifier
124124
.fillMaxWidth()
125-
.padding(contentPadding)
125+
.padding(contentPadding),
126126
) {
127127
MediaContent(
128-
episode, onItemClick = { null }
128+
episode, onItemClick = { null },
129129
)
130130
}
131131
}

Jetcaster/wear/src/main/java/com/example/jetcaster/ui/components/PlaceholderButton.kt

Lines changed: 0 additions & 108 deletions
This file was deleted.

Jetcaster/wear/src/main/java/com/example/jetcaster/ui/components/SettingsButtons.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import com.google.android.horologist.audio.ui.material3.components.actions.Setti
3535
import com.google.android.horologist.audio.ui.material3.components.actions.VolumeButtonWithBadge
3636
import com.google.android.horologist.audio.ui.material3.components.toAudioOutputUi
3737

38-
3938
/**
4039
* Settings buttons for the Jetcaster media app.
4140
* Add to queue and Set Volume.
@@ -59,7 +58,7 @@ fun SettingsButtons(
5958
onOutputClick = onVolumeClick,
6059
audioOutputUi = AudioOutput.BluetoothHeadset(id = "id", name = "name")
6160
.toAudioOutputUi(),
62-
volumeUiState = volumeUiState
61+
volumeUiState = volumeUiState,
6362
)
6463
}
6564

@@ -68,10 +67,9 @@ fun SettingsButtons(
6867
currentPlayerSpeed = playerUiState.episodePlayerState
6968
.playbackSpeed.toMillis().toFloat() / 1000,
7069
onPlaybackSpeedChange = onPlaybackSpeedChange,
71-
enabled = enabled
70+
enabled = enabled,
7271
)
7372
}
74-
7573
}
7674
}
7775

0 commit comments

Comments
 (0)