diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94e5f39..ba52346 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,10 +11,10 @@ jobs: steps: - uses: actions/checkout@v2.4.2 - - name: set up JDK 11 + - name: set up JDK 17 uses: actions/setup-java@v2 with: - java-version: '11' + java-version: '17' distribution: 'adopt' cache: gradle @@ -33,7 +33,7 @@ jobs: with: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} - files: "app/build/reports/jacoco/createDebugCoverage/createDebugCoverage.xml,data/build/reports/jacoco/createDebugCoverage/createDebugCoverage.xml,features/player/presentation/build/reports/jacoco/createDebugCoverage/createDebugCoverage.xml,core/design/build/reports/jacoco/createDebugCoverage/createDebugCoverage.xml,app/build/reports/coverage/androidTest/debug/connected/report.xml,core/design/build/reports/coverage/androidTest/debug/connected/report.xml,feature/player/presentation/build/reports/coverage/androidTest/debug/connected/report.xml,data/build/reports/coverage/androidTest/debug/connected/report.xml" + files: "feature/playlist/presentation/build/reports/jacoco/createDebugCoverage/createDebugCoverage.xml,feature/catalog/presentation/build/reports/jacoco/createDebugCoverage/createDebugCoverage.xml,data/build/reports/jacoco/createDebugCoverage/createDebugCoverage.xml,features/player/presentation/build/reports/jacoco/createDebugCoverage/createDebugCoverage.xml,core/design/build/reports/jacoco/createDebugCoverage/createDebugCoverage.xml,core/design/build/reports/coverage/androidTest/debug/connected/report.xml,feature/player/presentation/build/reports/coverage/androidTest/debug/connected/report.xml,data/build/reports/coverage/androidTest/debug/connected/report.xml" - name: Upload test report artifact if: ${{ failure() }} uses: actions/upload-artifact@v3 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8e506ab..c9f6e81 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,10 +11,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.4.2 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Create google-services.json run: | echo '${{ secrets.FIREBASE_GOOGLE_SERVICES_JSON }}' > app/google-services.json @@ -27,10 +27,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.4.2 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Create keystore run: | echo "${{ secrets.RELEASE_KEYSTORE }}" > release.keystore.asc diff --git a/.idea/androidTestResultsUserPreferences.xml b/.idea/androidTestResultsUserPreferences.xml index 8639777..97ee659 100644 --- a/.idea/androidTestResultsUserPreferences.xml +++ b/.idea/androidTestResultsUserPreferences.xml @@ -16,6 +16,19 @@ + + + + + + + diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 0335bea..f01c18b 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -27,9 +27,9 @@ - - - + + + diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index ff9696e..f8467b4 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index e8f98fe..beb4f00 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -38,6 +38,10 @@ android { versionName = "1.2.2" } + buildFeatures { + buildConfig = true + } + buildTypes { release { signingConfig = signingConfigs.getByName("release") diff --git a/app/src/androidTest/java/dev/marcocattaneo/sleep/di/SleepifyApplicationTest.kt b/app/src/androidTest/java/dev/marcocattaneo/sleep/di/SleepifyApplicationTest.kt new file mode 100644 index 0000000..662361c --- /dev/null +++ b/app/src/androidTest/java/dev/marcocattaneo/sleep/di/SleepifyApplicationTest.kt @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Marco Cattaneo + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dev.marcocattaneo.sleep.di + +import androidx.test.ext.junit.rules.ActivityScenarioRule +import dev.marcocattaneo.sleep.MainActivity +import org.junit.Assert.* +import org.junit.Rule +import org.junit.Test + + +internal class SleepifyApplicationTest { + + @get:Rule + var rule: ActivityScenarioRule = ActivityScenarioRule(MainActivity::class.java) + + @Test + fun testOnCreate() { + // Given + val scenario = rule.scenario + + // When + scenario.onActivity { activity -> + // then + assertEquals(SleepifyApplication::class.java, activity.application::class.java) + } + } + +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 39a7075..b667fe6 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -17,6 +17,7 @@ + diff --git a/app/src/main/java/dev/marcocattaneo/sleep/ui/notification/PlayerNotificationManager.kt b/app/src/main/java/dev/marcocattaneo/sleep/ui/notification/PlayerNotificationManager.kt index 952fe0c..c594a2e 100644 --- a/app/src/main/java/dev/marcocattaneo/sleep/ui/notification/PlayerNotificationManager.kt +++ b/app/src/main/java/dev/marcocattaneo/sleep/ui/notification/PlayerNotificationManager.kt @@ -16,18 +16,22 @@ package dev.marcocattaneo.sleep.ui.notification +import android.Manifest import android.app.Notification import android.app.NotificationChannel import android.app.NotificationManager import android.app.PendingIntent import android.content.Context import android.content.Intent +import android.content.pm.PackageManager import android.os.Build +import androidx.core.app.ActivityCompat import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat import androidx.media.app.NotificationCompat.MediaStyle import dagger.hilt.android.qualifiers.ApplicationContext -import dev.marcocattaneo.sleep.R +import dev.marcocattaneo.sleep.player.presentation.R as PlayerR +import dev.marcocattaneo.sleep.R as AppR import dev.marcocattaneo.sleep.player.presentation.AudioPlayer import javax.inject.Inject @@ -51,18 +55,19 @@ class PlayerNotificationManager @Inject constructor( private val stopPendingIntent: PendingIntent get() = createPendingIntent(PlayerNotificationService.Action.STOP) - private fun createPendingIntent(action: PlayerNotificationService.Action) = PendingIntent.getService( - context, - 0, - Intent(context, PlayerNotificationService::class.java).setAction(action.key), - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) PendingIntent.FLAG_IMMUTABLE else 0 - ) + private fun createPendingIntent(action: PlayerNotificationService.Action) = + PendingIntent.getService( + context, + 0, + Intent(context, PlayerNotificationService::class.java).setAction(action.key), + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) PendingIntent.FLAG_IMMUTABLE else 0 + ) init { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { val channel = NotificationChannel( CHANNEL_ID, - context.getString(R.string.app_name), + context.getString(AppR.string.app_name), NotificationManager.IMPORTANCE_LOW ).apply { description = "Audio Player" @@ -75,17 +80,24 @@ class PlayerNotificationManager @Inject constructor( } } - private fun NotificationCompat.Builder.show() = - NotificationManagerCompat.from(context).notify(NOTIFICATION_ID, build()) + private fun NotificationCompat.Builder.show() = if ( + Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU && + ActivityCompat.checkSelfPermission( + context, + Manifest.permission.POST_NOTIFICATIONS + ) != PackageManager.PERMISSION_GRANTED + ) { + throw IllegalStateException("You need to add the permission ${Manifest.permission.POST_NOTIFICATIONS} to your AndroidManifest.xml") + } else NotificationManagerCompat.from(context).notify(NOTIFICATION_ID, build()) private fun baseNotification( cancelable: Boolean ) = NotificationCompat.Builder(context, CHANNEL_ID) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) - .setContentTitle(context.getString(R.string.app_name)) + .setContentTitle(context.getString(AppR.string.app_name)) .setContentIntent(audioPlayer.controller.sessionActivity) .setDeleteIntent(createPendingIntent(PlayerNotificationService.Action.STOP)) - .setSmallIcon(R.mipmap.ic_launcher) + .setSmallIcon(AppR.mipmap.ic_launcher) .setAutoCancel(cancelable) @@ -93,14 +105,34 @@ class PlayerNotificationManager @Inject constructor( isPlaying: Boolean, ) = baseNotification(cancelable = !isPlaying) .apply { - addAction(NotificationCompat.Action.Builder(R.drawable.ic_baseline_close_24, "Stop", stopPendingIntent).build()) + addAction( + NotificationCompat.Action.Builder( + PlayerR.drawable.ic_baseline_close_24, + "Stop", + stopPendingIntent + ).build() + ) if (isPlaying) { - addAction(NotificationCompat.Action.Builder(R.drawable.ic_baseline_pause_24, "Pause", pausePendingIntent).build()) + addAction( + NotificationCompat.Action.Builder( + PlayerR.drawable.ic_baseline_pause_24, + "Pause", + pausePendingIntent + ).build() + ) } else { - addAction(NotificationCompat.Action.Builder(R.drawable.ic_baseline_play_arrow_24, "Play", playPendingIntent).build()) + addAction( + NotificationCompat.Action.Builder( + PlayerR.drawable.ic_baseline_play_arrow_24, + "Play", + playPendingIntent + ).build() + ) } } - .setStyle(MediaStyle().setShowActionsInCompactView(1).setMediaSession(audioPlayer.sessionToken)) + .setStyle( + MediaStyle().setShowActionsInCompactView(1).setMediaSession(audioPlayer.sessionToken) + ) .show() fun removeNotification() = NotificationManagerCompat.from(context).cancel(NOTIFICATION_ID) diff --git a/app/src/main/java/dev/marcocattaneo/sleep/ui/notification/PlayerNotificationService.kt b/app/src/main/java/dev/marcocattaneo/sleep/ui/notification/PlayerNotificationService.kt index d4e5390..c60de1d 100644 --- a/app/src/main/java/dev/marcocattaneo/sleep/ui/notification/PlayerNotificationService.kt +++ b/app/src/main/java/dev/marcocattaneo/sleep/ui/notification/PlayerNotificationService.kt @@ -32,11 +32,11 @@ import javax.inject.Inject class PlayerNotificationService : Service() { sealed class Action(val key: String) { - object PLAY : Action("dev.marcocattaneo.sleep.PlayerNotificationService.PLAY") + data object PLAY : Action("dev.marcocattaneo.sleep.PlayerNotificationService.PLAY") - object PAUSE : Action("dev.marcocattaneo.sleep.PlayerNotificationService.PAUSE") + data object PAUSE : Action("dev.marcocattaneo.sleep.PlayerNotificationService.PAUSE") - object STOP : Action("dev.marcocattaneo.sleep.PlayerNotificationService.STOP") + data object STOP : Action("dev.marcocattaneo.sleep.PlayerNotificationService.STOP") } @Inject diff --git a/build-tools/android/src/main/kotlin/sleep/buildtools/android/AndroidConfig.kt b/build-tools/android/src/main/kotlin/sleep/buildtools/android/AndroidConfig.kt index e76c0ae..90e3e40 100644 --- a/build-tools/android/src/main/kotlin/sleep/buildtools/android/AndroidConfig.kt +++ b/build-tools/android/src/main/kotlin/sleep/buildtools/android/AndroidConfig.kt @@ -20,7 +20,7 @@ package sleep.buildtools.android * Defines the shared configuration for Android targets. */ internal object AndroidConfigs { - const val COMPILE_SDK: Int = 33 + const val COMPILE_SDK: Int = 34 const val MIN_SDK: Int = 24 const val TARGET_SDK: Int = 33 diff --git a/build-tools/android/src/main/kotlin/sleep/buildtools/android/convention/AndroidAppConvention.kt b/build-tools/android/src/main/kotlin/sleep/buildtools/android/convention/AndroidAppConvention.kt index b75e41a..e61748a 100644 --- a/build-tools/android/src/main/kotlin/sleep/buildtools/android/convention/AndroidAppConvention.kt +++ b/build-tools/android/src/main/kotlin/sleep/buildtools/android/convention/AndroidAppConvention.kt @@ -44,7 +44,7 @@ internal class AndroidAppConvention : BuildConvention { ext.compileSdk = AndroidConfigs.COMPILE_SDK - ext.packagingOptions { + ext.packaging { resources { excludes += "/META-INF/{AL2.0,LGPL2.1}" } diff --git a/build-tools/android/src/main/kotlin/sleep/buildtools/android/convention/AndroidComposeConvention.kt b/build-tools/android/src/main/kotlin/sleep/buildtools/android/convention/AndroidComposeConvention.kt index dd195a5..6e198bd 100644 --- a/build-tools/android/src/main/kotlin/sleep/buildtools/android/convention/AndroidComposeConvention.kt +++ b/build-tools/android/src/main/kotlin/sleep/buildtools/android/convention/AndroidComposeConvention.kt @@ -24,7 +24,7 @@ import sleep.buildtools.utils.libsCatalog internal class AndroidComposeConvention : BuildConvention { override fun apply(target: Project) { - target.extensions.configure> { ext -> + target.extensions.configure> { ext -> ext.buildFeatures { compose = true } diff --git a/build-tools/android/src/main/kotlin/sleep/buildtools/android/convention/AndroidConvention.kt b/build-tools/android/src/main/kotlin/sleep/buildtools/android/convention/AndroidConvention.kt index 8cf78ca..ec53d68 100644 --- a/build-tools/android/src/main/kotlin/sleep/buildtools/android/convention/AndroidConvention.kt +++ b/build-tools/android/src/main/kotlin/sleep/buildtools/android/convention/AndroidConvention.kt @@ -38,7 +38,7 @@ internal class AndroidConvention : BuildConvention { } } - target.extensions.configure> { ext -> + target.extensions.configure> { ext -> ext.compileSdk = AndroidConfigs.COMPILE_SDK ext.defaultConfig { diff --git a/build-tools/android/src/main/kotlin/sleep/buildtools/android/convention/AndroidLibraryConvention.kt b/build-tools/android/src/main/kotlin/sleep/buildtools/android/convention/AndroidLibraryConvention.kt index 40d0bb3..4b8b142 100644 --- a/build-tools/android/src/main/kotlin/sleep/buildtools/android/convention/AndroidLibraryConvention.kt +++ b/build-tools/android/src/main/kotlin/sleep/buildtools/android/convention/AndroidLibraryConvention.kt @@ -38,7 +38,6 @@ internal class AndroidLibraryConvention : BuildConvention { } ext.defaultConfig { - targetSdk = AndroidConfigs.TARGET_SDK minSdk = AndroidConfigs.MIN_SDK testInstrumentationRunner = AndroidConfigs.TEST_INSTRUMENTATION_RUNNER vectorDrawables.useSupportLibrary = true diff --git a/build-tools/jacoco/src/main/kotlin/sleep/buildtools/jacoco/JacocoOptions.kt b/build-tools/jacoco/src/main/kotlin/sleep/buildtools/jacoco/JacocoOptions.kt index d1d6b3d..681ea65 100644 --- a/build-tools/jacoco/src/main/kotlin/sleep/buildtools/jacoco/JacocoOptions.kt +++ b/build-tools/jacoco/src/main/kotlin/sleep/buildtools/jacoco/JacocoOptions.kt @@ -16,7 +16,7 @@ package sleep.buildtools.jacoco -object JacocoOptions { +internal object JacocoOptions { val EXCLUDED_FILES = listOf( // data binding "android/databinding/**/*.class", diff --git a/core/testing/src/main/kotlin/dev/marcocattaneo/core/testing/MockkUtils.kt b/core/testing/src/main/kotlin/dev/marcocattaneo/core/testing/MockkUtils.kt index 7456d40..53f6ee1 100644 --- a/core/testing/src/main/kotlin/dev/marcocattaneo/core/testing/MockkUtils.kt +++ b/core/testing/src/main/kotlin/dev/marcocattaneo/core/testing/MockkUtils.kt @@ -41,7 +41,4 @@ inline fun MockKMatcherScope.anyInline(): T = this.isAccessible = true val valueType = parameters[0].type.classifier as KClass<*> call(match(ConstantMatcher(true), valueType)) - } - -fun MockKMatcherScope.match(matcher: Matcher, type: KClass): T = - (getProperty("callRecorder") as MockKGateway.CallRecorder).matcher(matcher, type) + } \ No newline at end of file diff --git a/data/build.gradle b/data/build.gradle index 35b153a..aaadcab 100644 --- a/data/build.gradle +++ b/data/build.gradle @@ -23,6 +23,10 @@ plugins { android { namespace 'dev.marcocattaneo.sleep.data' + buildFeatures { + buildConfig = true + } + defaultConfig { buildConfigField("String", "BASE_URL", "\"https://europe-west2-sleep-app-mobile.cloudfunctions.net/\"") } diff --git a/data/src/main/java/dev/marcocattaneo/sleep/data/repository/MediaRepositoryImpl.kt b/data/src/main/java/dev/marcocattaneo/sleep/data/repository/MediaRepositoryImpl.kt index e3ea704..1584424 100644 --- a/data/src/main/java/dev/marcocattaneo/sleep/data/repository/MediaRepositoryImpl.kt +++ b/data/src/main/java/dev/marcocattaneo/sleep/data/repository/MediaRepositoryImpl.kt @@ -17,7 +17,7 @@ package dev.marcocattaneo.sleep.data.repository import arrow.core.Either -import arrow.core.computations.either +import arrow.core.raise.either import dev.marcocattaneo.sleep.data.auth.AuthDataSource import dev.marcocattaneo.sleep.data.http.SleepService import dev.marcocattaneo.sleep.data.mapper.MediaFileMapper diff --git a/data/src/test/java/dev/marcocattaneo/sleep/data/repository/MediaRepositoryImplTest.kt b/data/src/test/java/dev/marcocattaneo/sleep/data/repository/MediaRepositoryImplTest.kt index 9a47ec9..7078b01 100644 --- a/data/src/test/java/dev/marcocattaneo/sleep/data/repository/MediaRepositoryImplTest.kt +++ b/data/src/test/java/dev/marcocattaneo/sleep/data/repository/MediaRepositoryImplTest.kt @@ -23,6 +23,7 @@ import dev.marcocattaneo.sleep.data.mapper.MediaFileMapper import dev.marcocattaneo.sleep.data.model.MediaFile import dev.marcocattaneo.sleep.data.model.MediaUrl import dev.marcocattaneo.sleep.domain.AppException +import dev.marcocattaneo.sleep.domain.cache.CachePolicy import dev.marcocattaneo.sleep.domain.cache.CacheService import dev.marcocattaneo.sleep.domain.model.MediaFileEntity import dev.marcocattaneo.sleep.domain.repository.MediaRepository @@ -54,7 +55,7 @@ internal class MediaRepositoryImplTest { fun setup() { MockKAnnotations.init(this) - coEvery { mediaFileCache.getValue(any(), any()) } returns null + coEvery { mediaFileCache.getValue(any(), any()) } returns null coEvery { mediaFileCache.setValue(any(), any(), any()) } just Runs coEvery { authDataSource.getAuthToken() } returns Either.Right("token") diff --git a/features/catalog/presentation/src/main/kotlin/dev/marcocattaneo/sleep/catalog/presentation/screen/CatalogScreen.kt b/features/catalog/presentation/src/main/kotlin/dev/marcocattaneo/sleep/catalog/presentation/screen/CatalogScreen.kt index 86745e6..df2e018 100644 --- a/features/catalog/presentation/src/main/kotlin/dev/marcocattaneo/sleep/catalog/presentation/screen/CatalogScreen.kt +++ b/features/catalog/presentation/src/main/kotlin/dev/marcocattaneo/sleep/catalog/presentation/screen/CatalogScreen.kt @@ -41,6 +41,7 @@ import dev.marcocattaneo.sleep.catalog.presentation.composables.Illustration import dev.marcocattaneo.sleep.catalog.presentation.composables.InfoBox import dev.marcocattaneo.sleep.domain.model.MediaFileEntity import dev.marcocattaneo.sleep.catalog.presentation.R +import dev.marcocattaneo.sleep.core.design.R as DesignR /** * Register the composable function into the NavGraphBuilder @@ -137,7 +138,7 @@ private fun MediaItem( val selected = mediaFile?.selected == true Icon( modifier = modifierBaseOnMedia(mediaFile), - painter = painterResource(id = if (selected) R.drawable.ic_baseline_play_circle_filled_24 else R.drawable.ic_baseline_play_circle_outline_24), + painter = painterResource(id = if (selected) R.drawable.ic_baseline_play_circle_filled_24 else DesignR.drawable.ic_baseline_play_circle_outline_24), contentDescription = mediaFile?.name ?: "Undefined", tint = if (selected) MaterialTheme.colors.primary else MaterialTheme.colors.secondary ) diff --git a/features/player/presentation/src/main/kotlin/dev/marcocattaneo/sleep/player/presentation/ui/Player.kt b/features/player/presentation/src/main/kotlin/dev/marcocattaneo/sleep/player/presentation/ui/Player.kt index c128097..688e5b8 100644 --- a/features/player/presentation/src/main/kotlin/dev/marcocattaneo/sleep/player/presentation/ui/Player.kt +++ b/features/player/presentation/src/main/kotlin/dev/marcocattaneo/sleep/player/presentation/ui/Player.kt @@ -35,7 +35,8 @@ import dev.marcocattaneo.core.design.composables.* import dev.marcocattaneo.core.design.theme.Dimen.Margin16 import dev.marcocattaneo.core.design.theme.Dimen.Margin32 import dev.marcocattaneo.core.design.theme.Dimen.Margin8 -import dev.marcocattaneo.sleep.player.presentation.R +import dev.marcocattaneo.sleep.player.presentation.R as PlayerR +import dev.marcocattaneo.sleep.core.design.R as DesignR import kotlin.math.max import kotlin.time.Duration import kotlin.time.Duration.Companion.minutes @@ -85,7 +86,7 @@ fun BottomPlayerBar( if (description.isNotEmpty()) { Row(modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) { Icon( - painter = painterResource(id = R.drawable.ic_baseline_play_circle_outline_24), + painter = painterResource(id = DesignR.drawable.ic_baseline_play_circle_outline_24), contentDescription = description, modifier = Modifier.size(Margin16), tint = MaterialTheme.colors.primary @@ -108,7 +109,7 @@ fun BottomPlayerBar( verticalAlignment = Alignment.CenterVertically ) { ActionButton( - painter = painterResource(id = R.drawable.ic_baseline_replay_30_24), + painter = painterResource(id = PlayerR.drawable.ic_baseline_replay_30_24), internalMargin = 4.dp, onClick = onClickReplay ) @@ -119,7 +120,7 @@ fun BottomPlayerBar( ) Spacer8() ActionButton( - painter = painterResource(id = R.drawable.ic_baseline_forward_30_24), + painter = painterResource(id = PlayerR.drawable.ic_baseline_forward_30_24), internalMargin = 4.dp, onClick = onClickForward ) @@ -139,7 +140,7 @@ fun BottomPlayerBar( ) } ActionButton( - painter = painterResource(id = R.drawable.ic_baseline_access_alarm_24), + painter = painterResource(id = PlayerR.drawable.ic_baseline_access_alarm_24), modifier = Modifier.semantics { contentDescription = "Change timer" }, onClick = { timerVisible = !timerVisible } ) @@ -150,7 +151,7 @@ fun BottomPlayerBar( .align(Alignment.CenterStart) ) { ActionButton( - painter = painterResource(id = R.drawable.ic_baseline_close_24), + painter = painterResource(id = PlayerR.drawable.ic_baseline_close_24), onClick = onClickStop ) } @@ -206,7 +207,7 @@ private fun PlayButton( .size(48.dp) .padding(Margin8), tint = MaterialTheme.colors.background, - painter = painterResource(id = if (isPlaying) R.drawable.ic_baseline_pause_24 else R.drawable.ic_baseline_play_arrow_24), + painter = painterResource(id = if (isPlaying) PlayerR.drawable.ic_baseline_pause_24 else PlayerR.drawable.ic_baseline_play_arrow_24), contentDescription = null ) } diff --git a/gradle.properties b/gradle.properties index 6f8fb08..241688d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,7 +22,7 @@ # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx4608m -Dfile.encoding=UTF-8 # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects @@ -40,5 +40,5 @@ org.gradle.parallel=true org.gradle.daemon=true org.gradle.caching=true # Config -sleep.jvm.version=11 +sleep.jvm.version=17 sleep.jvm.warning-as-error=false \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2352880..a56d397 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,27 +1,26 @@ [versions] -compose = "1.2.0" -composeNavigation = "2.5.1" +compose = "1.5.3" +composeNavigation = "2.7.4" composeNavigationHilt = "1.0.0" -activity = "1.5.0" -kotlin = "1.7.0" -hilt = "2.44" -coroutine = "1.6.4" +kotlin = "1.9.10" +hilt = "2.48.1" +coroutine = "1.7.3" detekt = "1.21.0" -mockk = "1.12.5" +mockk = "1.13.8" accompanist = "0.25.1" -androidGradlePlugin = "7.4.2" +androidGradlePlugin = "8.1.2" jacoco = "0.8.8" [libraries] -bom-compose = { group = "androidx.compose", name = "compose-bom", version = "2022.12.00" } -bom-firebase = { group = "com.google.firebase", name = "firebase-bom", version = "31.2.3" } +bom-compose = { group = "androidx.compose", name = "compose-bom", version = "2023.10.00" } +bom-firebase = { group = "com.google.firebase", name = "firebase-bom", version = "32.3.1" } -androidx-appCompat = { module = "androidx.appcompat:appcompat", version.ref = "activity" } -androidx-core = { module = "androidx.core:core-ktx", version.ref = "activity" } -androidx-lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version = "2.5.1" } -androidx-media = { module = "androidx.media:media", version = "1.5.0" } -androidx-material = { module = "com.google.android.material:material", version = "1.6.1" } -androidx-junit = { module = "androidx.test.ext:junit", version = "1.1.3" } +androidx-appCompat = { module = "androidx.appcompat:appcompat", version = "1.6.1" } +androidx-core = { module = "androidx.core:core-ktx", version = "1.12.0" } +androidx-lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version = "2.6.2" } +androidx-media = { module = "androidx.media:media", version = "1.6.0" } +androidx-material = { module = "com.google.android.material:material", version = "1.10.0" } +androidx-junit = { module = "androidx.test.ext:junit", version = "1.1.5" } compose-ui = { group = "androidx.compose.ui", name = "ui" } compose-material = { group = "androidx.compose.material", name = "material" } @@ -50,12 +49,12 @@ firebase-analytics = { group = "com.google.firebase", name = "firebase-analytics firebase-auth = { group = "com.google.firebase", name = "firebase-auth-ktx" } firebase-crashlytics = { group = "com.google.firebase", name = "firebase-crashlytics-ktx" } -arrow = { module = "io.arrow-kt:arrow-core", version = "1.0.1" } +arrow = { module = "io.arrow-kt:arrow-core", version = "1.2.1" } timber = { module = "com.jakewharton.timber:timber", version = "5.0.1" } retrofit-client = { module = "com.squareup.retrofit2:retrofit", version = "2.9.0" } retrofit-gson = { module = "com.squareup.retrofit2:converter-gson", version = "2.9.0" } -retrofit-logger = { module = "com.squareup.okhttp3:logging-interceptor", version = "4.10.0" } -turbine = { module = "app.cash.turbine:turbine", version = "0.11.0" } +retrofit-logger = { module = "com.squareup.okhttp3:logging-interceptor", version = "4.11.0" } +turbine = { module = "app.cash.turbine:turbine", version = "1.0.0" } roboeletric = { module = "org.robolectric:robolectric", version = "4.8" } kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" } @@ -69,7 +68,7 @@ polpetta = { module = "dev.mcatta:polpetta", version = "0.0.6" } gradle-android-api = { module = "com.android.tools.build:gradle-api", version.ref = "androidGradlePlugin" } gradle-detekt = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" } -gradle-firebase = { module = "com.google.firebase:firebase-crashlytics-gradle", version = "2.9.4" } +gradle-firebase = { module = "com.google.firebase:firebase-crashlytics-gradle", version = "2.9.9" } gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } [bundles] diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index ccebba7..c1962a7 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 42defcc..0c85a1f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 79a61d4..aeb74cb 100755 --- a/gradlew +++ b/gradlew @@ -85,9 +85,6 @@ done APP_BASE_NAME=${0##*/} APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then done fi + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Collect all arguments for the java command; # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in