From ca41948a7518a9bf8808102e4fb9d0f7be3c172d Mon Sep 17 00:00:00 2001 From: "Andres Gomez, Thomas (ITDV RL)" Date: Thu, 27 Jun 2024 11:50:24 +0200 Subject: [PATCH] Update dependencies / gradle etc. --- app/build.gradle | 79 ++++++++++--------- .../ui/screen/home/filter/FilterPage.kt | 31 ++++++-- build.gradle | 14 ++-- gradle.properties | 4 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 5 files changed, 73 insertions(+), 57 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index bc1d7f5..c5b2fe7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -24,7 +24,7 @@ android { defaultConfig { applicationId "com.pixelized.biblib" minSdk 26 - targetSdk 33 + targetSdk 34 versionCode generateVersionCode() versionName "0.1.6" @@ -59,20 +59,21 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = "17" } buildFeatures { compose true + buildConfig = true } composeOptions { - kotlinCompilerExtensionVersion '1.4.4' + kotlinCompilerExtensionVersion = "1.5.11" } packagingOptions { @@ -89,42 +90,42 @@ android { dependencies { // Android core - implementation 'androidx.core:core-ktx:1.9.0' - implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' - implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.6.1" + implementation 'androidx.core:core-ktx:1.13.1' + implementation 'androidx.appcompat:appcompat:1.7.0' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.2' + implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.8.2" // Android Compose - implementation "androidx.compose.ui:ui:1.4.0" - implementation "androidx.compose.ui:ui-util:1.4.0" - implementation "androidx.compose.foundation:foundation:1.4.0" - implementation "androidx.compose.material:material:1.4.0" - implementation "androidx.compose.runtime:runtime-livedata:1.4.0" - implementation "androidx.compose.ui:ui-tooling-preview:1.4.0" - debugImplementation "androidx.compose.ui:ui-tooling:1.4.0" + implementation "androidx.compose.ui:ui:1.6.8" + implementation "androidx.compose.ui:ui-util:1.6.8" + implementation "androidx.compose.foundation:foundation:1.6.8" + implementation "androidx.compose.material:material:1.6.8" + implementation "androidx.compose.runtime:runtime-livedata:1.6.8" + implementation "androidx.compose.ui:ui-tooling-preview:1.6.8" + debugImplementation "androidx.compose.ui:ui-tooling:1.6.8" // Android Compose extension implementation "androidx.constraintlayout:constraintlayout-compose:1.0.1" - implementation 'androidx.activity:activity-compose:1.7.0' - implementation "androidx.paging:paging-compose:1.0.0-alpha18" + implementation 'androidx.activity:activity-compose:1.9.0' + implementation "androidx.paging:paging-compose:3.3.0" // Material design - implementation 'com.google.android.material:material:1.8.0' - implementation "androidx.compose.material:material-icons-core:1.4.0" - implementation "androidx.compose.material:material-icons-extended:1.4.0" + implementation 'com.google.android.material:material:1.12.0' + implementation "androidx.compose.material:material-icons-core:1.6.8" + implementation "androidx.compose.material:material-icons-extended:1.6.8" // Injection - implementation 'androidx.hilt:hilt-navigation-compose:1.0.0' - implementation "com.google.dagger:hilt-android:2.43.2" - kapt "com.google.dagger:hilt-compiler:2.43.2" + implementation 'androidx.hilt:hilt-navigation-compose:1.2.0' + implementation "com.google.dagger:hilt-android:2.51.1" + kapt "com.google.dagger:hilt-compiler:2.51.1" // Accompanist - implementation "com.google.accompanist:accompanist-navigation-material:0.30.1" - implementation "com.google.accompanist:accompanist-systemuicontroller:0.30.1" - implementation "com.google.accompanist:accompanist-pager-indicators:0.30.1" - implementation "com.google.accompanist:accompanist-drawablepainter:0.30.1" - implementation "com.google.accompanist:accompanist-placeholder-material:0.30.1" - implementation "com.google.accompanist:accompanist-swiperefresh:0.30.1" + implementation "com.google.accompanist:accompanist-navigation-material:0.34.0" + implementation "com.google.accompanist:accompanist-systemuicontroller:0.34.0" + implementation "com.google.accompanist:accompanist-pager-indicators:0.34.0" + implementation "com.google.accompanist:accompanist-drawablepainter:0.34.0" + implementation "com.google.accompanist:accompanist-placeholder-material:0.34.0" + implementation "com.google.accompanist:accompanist-swiperefresh:0.34.0" // Landscapist implementation "com.github.skydoves:landscapist-glide:1.5.2" @@ -134,30 +135,30 @@ dependencies { implementation "org.burnoutcrew.composereorderable:reorderable:0.9.6" // Navigation - implementation "androidx.navigation:navigation-compose:2.5.3" + implementation "androidx.navigation:navigation-compose:2.7.7" // Splash Screen support prior to Android 12 - implementation "androidx.core:core-splashscreen:1.0.0" + implementation "androidx.core:core-splashscreen:1.0.1" // Google sign in. - implementation "com.google.android.gms:play-services-auth:20.4.1" + implementation "com.google.android.gms:play-services-auth:21.2.0" // Firebase - implementation platform('com.google.firebase:firebase-bom:31.3.0') + implementation platform('com.google.firebase:firebase-bom:33.1.1') implementation 'com.google.firebase:firebase-crashlytics' // RetroFit & Gson for webservice call implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.retrofit2:converter-gson:2.9.0' - implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.google.code.gson:gson:2.10.1' // Logging Network Calls - implementation "com.squareup.okhttp3:logging-interceptor:4.8.1" + implementation "com.squareup.okhttp3:logging-interceptor:4.11.0" // Room - implementation "androidx.room:room-runtime:2.5.1" - implementation "androidx.room:room-ktx:2.5.1" - kapt "androidx.room:room-compiler:2.5.1" + implementation "androidx.room:room-runtime:2.6.1" + implementation "androidx.room:room-ktx:2.6.1" + kapt "androidx.room:room-compiler:2.6.1" } static def generateVersionCode() { diff --git a/app/src/main/java/com/pixelized/biblib/ui/screen/home/filter/FilterPage.kt b/app/src/main/java/com/pixelized/biblib/ui/screen/home/filter/FilterPage.kt index 5e7bfc3..deeef67 100644 --- a/app/src/main/java/com/pixelized/biblib/ui/screen/home/filter/FilterPage.kt +++ b/app/src/main/java/com/pixelized/biblib/ui/screen/home/filter/FilterPage.kt @@ -6,15 +6,29 @@ import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.compose.foundation.clickable -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.text.KeyboardActionScope import androidx.compose.foundation.text.KeyboardActions import androidx.compose.foundation.text.KeyboardOptions -import androidx.compose.material.* +import androidx.compose.material.Icon +import androidx.compose.material.IconButton +import androidx.compose.material.MaterialTheme +import androidx.compose.material.Text +import androidx.compose.material.TextField +import androidx.compose.material.TextFieldDefaults import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Clear -import androidx.compose.runtime.* +import androidx.compose.runtime.Composable +import androidx.compose.runtime.Immutable +import androidx.compose.runtime.Stable +import androidx.compose.runtime.State +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.focus.FocusRequester @@ -26,7 +40,6 @@ import androidx.compose.ui.unit.max import androidx.paging.PagingData import androidx.paging.compose.LazyPagingItems import androidx.paging.compose.collectAsLazyPagingItems -import androidx.paging.compose.items import com.pixelized.biblib.model.search.FilterType import com.pixelized.biblib.ui.composable.Handle import com.pixelized.biblib.ui.theme.BibLibTheme @@ -132,15 +145,19 @@ private fun FilterPageContent( modifier = Modifier.fillMaxSize(), contentPadding = paddingValues, ) { - items(items = filters, key = { it.filterId }) { + items( + count = filters.itemCount, + key = { filters[it]?.filterId ?: -1 }, + ) { + val item = filters[it] Text( modifier = Modifier - .clickable { it?.let { onFilter(it) } } + .clickable { item?.let(onFilter) } .fillMaxWidth() .padding(all = MaterialTheme.bibLib.dimen.thumbnail.padding), style = MaterialTheme.typography.body1, color = MaterialTheme.colors.onSurface, - text = it?.filterLabel ?: "" + text = item?.filterLabel ?: "" ) } } diff --git a/build.gradle b/build.gradle index 976caea..8808837 100644 --- a/build.gradle +++ b/build.gradle @@ -5,14 +5,10 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' - classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10' - classpath "com.google.dagger:hilt-android-gradle-plugin:2.43.2" - classpath 'com.google.gms:google-services:4.3.15' - classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.4' + classpath 'com.android.tools.build:gradle:8.5.0' + classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23' + classpath "com.google.dagger:hilt-android-gradle-plugin:2.51" + classpath 'com.google.gms:google-services:4.4.2' + classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.2' } -} - -task clean(type: Delete) { - delete rootProject.buildDir } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index dbc9506..8b07d1d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,4 +18,6 @@ android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX android.enableJetifier=false # Kotlin code style for this project: "official" or "obsolete": -kotlin.code.style=official \ No newline at end of file +kotlin.code.style=official +android.nonTransitiveRClass=false +android.nonFinalResIds=false \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c30efcb..29692df 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sat Oct 15 11:40:37 CEST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME