From a559a24fa4158091540a239d592015441a2ed965 Mon Sep 17 00:00:00 2001 From: Thomas Andres Gomez Date: Mon, 2 Aug 2021 15:48:48 +0200 Subject: [PATCH] Compose migration from beta-07 to 1.0 --- app/build.gradle | 34 +++++++++---------- .../ui/viewmodel/book/BooksViewModel.kt | 8 ++--- build.gradle | 4 +-- gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 7f93f02..a02fcac 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -64,40 +64,40 @@ android { } composeOptions { - kotlinCompilerExtensionVersion '1.0.0-beta07' + kotlinCompilerExtensionVersion '1.0.0' } } dependencies { - implementation 'androidx.core:core-ktx:1.5.0' - implementation 'androidx.appcompat:appcompat:1.3.0' - implementation 'com.google.android.material:material:1.3.0' + implementation 'androidx.core:core-ktx:1.6.0' + implementation 'androidx.appcompat:appcompat:1.3.1' + implementation 'com.google.android.material:material:1.4.0' // Android compose - implementation "androidx.compose.ui:ui:1.0.0-beta07" + implementation "androidx.compose.ui:ui:1.0.0" // Tooling support (Previews, etc.) - implementation "androidx.compose.ui:ui-tooling:1.0.0-beta07" + implementation "androidx.compose.ui:ui-tooling:1.0.0" // Foundation (Border, Background, Box, Image, Scroll, shapes, animations, etc.) - implementation "androidx.compose.foundation:foundation:1.0.0-beta07" + implementation "androidx.compose.foundation:foundation:1.0.0" // Material Design - implementation "androidx.compose.material:material:1.0.0-beta07" + implementation "androidx.compose.material:material:1.0.0" // Material design icons - implementation "androidx.compose.material:material-icons-core:1.0.0-beta07" - implementation "androidx.compose.material:material-icons-extended:1.0.0-beta07" + implementation "androidx.compose.material:material-icons-core:1.0.0" + implementation "androidx.compose.material:material-icons-extended:1.0.0" // Integration with activities - implementation "androidx.activity:activity-compose:1.3.0-alpha08" + implementation "androidx.activity:activity-compose:1.3.0" // Integration with ViewModels - implementation "androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha05" + implementation "androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha07" // Integration with observables - implementation "androidx.compose.runtime:runtime-livedata:1.0.0-beta07" + implementation "androidx.compose.runtime:runtime-livedata:1.0.0" // ConstraintLayout - implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0-alpha07" + implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0-beta02" // Google sign in. - implementation "com.google.android.gms:play-services-auth:19.0.0" + implementation "com.google.android.gms:play-services-auth:19.2.0" // Paging - implementation "androidx.paging:paging-compose:1.0.0-alpha09" + implementation "androidx.paging:paging-compose:1.0.0-alpha12" // RetroFit & Gson for webservice call implementation 'com.squareup.retrofit2:retrofit:2.9.0' @@ -114,7 +114,7 @@ dependencies { // Test testImplementation 'junit:junit:4.13.2' - androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.0.0-beta07" + androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.0.0" } static def generateVersionCode() { diff --git a/app/src/main/java/com/pixelized/biblib/ui/viewmodel/book/BooksViewModel.kt b/app/src/main/java/com/pixelized/biblib/ui/viewmodel/book/BooksViewModel.kt index a3b48b1..c7e69b5 100644 --- a/app/src/main/java/com/pixelized/biblib/ui/viewmodel/book/BooksViewModel.kt +++ b/app/src/main/java/com/pixelized/biblib/ui/viewmodel/book/BooksViewModel.kt @@ -28,8 +28,8 @@ class BooksViewModel : ViewModel(), IBooksViewModel { private val client: IBibLibClient by inject() private val apiCache: IAPICacheRepository by inject() - private val formatter_long = SimpleDateFormat("MMMM yyyy", Locale.getDefault()) - private val formatter_short = SimpleDateFormat("MMM yyyy", Locale.getDefault()) + private val formatterLong = SimpleDateFormat("MMMM yyyy", Locale.getDefault()) + private val formatterShort = SimpleDateFormat("MMM yyyy", Locale.getDefault()) private val _state = MutableLiveData(IBooksViewModel.State.Initial) override val state: LiveData get() = _state @@ -112,7 +112,7 @@ class BooksViewModel : ViewModel(), IBooksViewModel { date = if (releaseDate.time < 0) { null } else { - formatter_long.format(releaseDate).capitalize(Locale.getDefault()) + formatterLong.format(releaseDate).capitalize(Locale.getDefault()) }, isNew = isNew, ) @@ -126,7 +126,7 @@ class BooksViewModel : ViewModel(), IBooksViewModel { date = if (releaseDate.time < 0) { null } else { - formatter_short.format(releaseDate).capitalize(Locale.getDefault()) + formatterShort.format(releaseDate).capitalize(Locale.getDefault()) }, series = series?.name, description = synopsis ?: "", diff --git a/build.gradle b/build.gradle index 670f547..1e66fd8 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,8 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.0-beta01' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.32" + classpath 'com.android.tools.build:gradle:7.0.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4c2ed26..158286b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed Apr 28 21:29:33 CEST 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME