Skip to content

Update destinations to kotlin190 #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 30 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ plugins {
id 'org.jetbrains.kotlin.android'
id 'com.google.dagger.hilt.android'
id 'kotlin-kapt'
id "com.google.devtools.ksp" version "1.7.20-1.0.6"
// id "com.google.devtools.ksp" version "1.7.20-1.0.6"
id "com.google.devtools.ksp" version "1.9.0-1.0.13"
}

kotlin {
Expand All @@ -20,12 +21,14 @@ kotlin {

android {
namespace 'com.frontmatic.scrobbleview'
compileSdk 33
// compileSdk 33
compileSdk 34

defaultConfig {
applicationId "com.frontmatic.scrobbleview"
minSdk 24
targetSdk 33
// targetSdk 33
targetSdk 34
versionCode 1
versionName "1.0"

Expand Down Expand Up @@ -64,7 +67,8 @@ android {
buildConfig true
}
composeOptions {
kotlinCompilerExtensionVersion '1.3.2'
kotlinCompilerExtensionVersion '1.5.1'
// kotlinCompilerExtensionVersion '1.3.2'
}
packagingOptions {
resources {
Expand All @@ -77,6 +81,9 @@ dependencies {

def paging_version = "3.1.1"

// def destinations_version = "1.7.21-beta"
def destinations_version = "1.9.51"

implementation 'androidx.core:core-ktx:1.8.0'
implementation platform('org.jetbrains.kotlin:kotlin-bom:1.8.0')
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
Expand All @@ -102,31 +109,40 @@ dependencies {
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1'

// Paging
implementation "androidx.paging:paging-runtime:$paging_version"
implementation "androidx.paging:paging-compose:3.2.0-rc01"
implementation "androidx.paging:paging-runtime-ktx:$paging_version"
implementation "androidx.paging:paging-compose:3.2.0"

// Coil
implementation("io.coil-kt:coil-compose:2.2.2")

// Dagger - Hilt
implementation "com.google.dagger:hilt-android:2.44.2"
kapt "com.google.dagger:hilt-android-compiler:2.44"
implementation "com.google.dagger:hilt-android:2.47"
kapt 'com.google.dagger:hilt-compiler:2.47'
kapt "com.google.dagger:hilt-android-compiler:2.47"
kapt 'androidx.hilt:hilt-compiler:1.0.0'
implementation 'androidx.hilt:hilt-navigation-compose:1.0.0'

// DataStore Preferences
implementation("androidx.datastore:datastore-preferences:1.0.0")

// Room
implementation "androidx.room:room-runtime:2.4.2"
kapt "androidx.room:room-compiler:2.4.2"
implementation "androidx.room:room-ktx:2.4.2"
implementation "androidx.room:room-runtime:2.5.2"
// kapt "androidx.room:room-compiler:2.5.2"
ksp "androidx.room:room-compiler:2.5.2"
implementation "androidx.room:room-ktx:2.5.2"
// add room paging
implementation "androidx.room:room-paging:2.4.2"
implementation "androidx.room:room-paging:2.5.2"

// Compose Destinations
implementation 'io.github.raamcosta.compose-destinations:core:1.7.21-beta'
ksp 'io.github.raamcosta.compose-destinations:ksp:1.7.21-beta'
implementation "io.github.raamcosta.compose-destinations:core:$destinations_version"
implementation "io.github.raamcosta.compose-destinations:animations-core:$destinations_version"
ksp "io.github.raamcosta.compose-destinations:ksp:$destinations_version"

// Dropbox studio

// implementation "com.dropbox.mobile.store:store4:4.0.0-beta01"
implementation "org.mobilenativefoundation.store:store5:5.0.0-beta03"
implementation "org.jetbrains.kotlinx:atomicfu:0.18.5"

// def accompanist_version = "0.21.0"
// // Swipe Refresh - Accompanist
Expand Down
42 changes: 30 additions & 12 deletions app/src/main/java/com/frontmatic/scrobbleview/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,51 @@ package com.frontmatic.scrobbleview
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.navigation.compose.rememberNavController
import androidx.compose.ui.unit.dp
import androidx.navigation.plusAssign
import com.frontmatic.scrobbleview.ui.components.BottomNavBar
import com.frontmatic.scrobbleview.ui.components.RootScaffold
import com.frontmatic.scrobbleview.ui.components.TopBar
import com.frontmatic.scrobbleview.ui.screens.NavGraphs
import com.frontmatic.scrobbleview.ui.screens.destinations.Destination
import com.frontmatic.scrobbleview.ui.screens.destinations.SetupScreenDestination
import com.frontmatic.scrobbleview.ui.screens.destinations.SplashScreenDestination
import com.frontmatic.scrobbleview.ui.screens.destinations.TrackDetailScreenDestination
import com.frontmatic.scrobbleview.ui.theme.ScrobbleViewTheme
import com.google.accompanist.navigation.material.ExperimentalMaterialNavigationApi
import com.google.accompanist.navigation.material.ModalBottomSheetLayout
import com.google.accompanist.navigation.material.rememberBottomSheetNavigator
import com.ramcosta.composedestinations.DestinationsNavHost
import com.ramcosta.composedestinations.animations.rememberAnimatedNavHostEngine
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class MainActivity : ComponentActivity() {
@OptIn(ExperimentalMaterial3Api::class)
@OptIn(
ExperimentalAnimationApi::class,
ExperimentalMaterialNavigationApi::class,
)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
val navController = rememberNavController()
val engine = rememberAnimatedNavHostEngine()
val navController = engine.rememberNavController()
val bottomSheetNavigator = rememberBottomSheetNavigator()
navController.navigatorProvider += bottomSheetNavigator
val startRoute = NavGraphs.root.startRoute

ScrobbleViewTheme {
// A surface container using the 'background' color from the theme
ModalBottomSheetLayout(
bottomSheetNavigator = bottomSheetNavigator,
sheetShape = RoundedCornerShape(16.dp),
) {
RootScaffold(
navController = navController,
startRoute = startRoute,
Expand All @@ -52,11 +66,14 @@ class MainActivity : ComponentActivity() {
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
DestinationsNavHost(
navController = navController,
navGraph = NavGraphs.root
)
)
{
DestinationsNavHost(
navController = navController,
engine = engine,
navGraph = NavGraphs.root
)
}
}
}
}
Expand All @@ -68,5 +85,6 @@ private val Destination.shouldShowScaffoldElements get() =
when (this) {
is SplashScreenDestination -> false
is SetupScreenDestination -> false
is TrackDetailScreenDestination -> false
else -> true
}
Loading