From 4587bac2807a845ec0cd8944578997ef49a96ce9 Mon Sep 17 00:00:00 2001 From: BoD Date: Sun, 23 Dec 2018 18:08:27 +0100 Subject: [PATCH] Use AndroidX in the sample app --- README.md | 4 ++-- gradle.properties | 3 +++ sample/build.gradle | 6 +++--- .../org/jraf/android/prefs/sample/app/MainActivity.kt | 4 ++-- .../main/kotlin/org/jraf/android/prefs/sample/prefs/Main.kt | 2 +- .../kotlin/org/jraf/android/prefs/sample/prefs/Settings.kt | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6eab9cf..a29fdd9 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,8 @@ Usage ```groovy dependencies { /* ... */ - annotationProcessor 'org.jraf:prefs-compiler:1.3.0' // or kapt if you use Kotlin - implementation 'org.jraf:prefs:1.3.0' + annotationProcessor 'org.jraf:prefs-compiler:1.4.0' // or kapt if you use Kotlin + implementation 'org.jraf:prefs:1.4.0' } ``` diff --git a/gradle.properties b/gradle.properties index 55f9bbc..ee63581 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,3 +18,6 @@ org.gradle.parallel=true # Enable build cache org.gradle.caching=true +# Use AndroidX +android.useAndroidX=true +android.enableJetifier=true diff --git a/sample/build.gradle b/sample/build.gradle index a06fe05..0a88a6d 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -27,9 +27,9 @@ android { dependencies { implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.10' - implementation "com.android.support:appcompat-v7:28.0.0" - implementation 'com.android.support:support-annotations:28.0.0' - implementation 'android.arch.lifecycle:livedata:1.1.1' + implementation 'androidx.appcompat:appcompat:1.0.0' + implementation 'androidx.annotation:annotation:1.0.0' + implementation 'androidx.lifecycle:lifecycle-livedata:2.0.0' kapt project(':prefs-compiler') implementation project(':prefs') diff --git a/sample/src/main/kotlin/org/jraf/android/prefs/sample/app/MainActivity.kt b/sample/src/main/kotlin/org/jraf/android/prefs/sample/app/MainActivity.kt index 8ec7527..6f6e223 100644 --- a/sample/src/main/kotlin/org/jraf/android/prefs/sample/app/MainActivity.kt +++ b/sample/src/main/kotlin/org/jraf/android/prefs/sample/app/MainActivity.kt @@ -23,10 +23,10 @@ */ package org.jraf.android.prefs.sample.app -import android.arch.lifecycle.Observer import android.os.Bundle -import android.support.v7.app.AppCompatActivity import android.util.Log +import androidx.appcompat.app.AppCompatActivity +import androidx.lifecycle.Observer import org.jraf.android.prefs.sample.R import org.jraf.android.prefs.sample.prefs.MainPrefs import org.jraf.android.prefs.sample.prefs.SettingsPrefs diff --git a/sample/src/main/kotlin/org/jraf/android/prefs/sample/prefs/Main.kt b/sample/src/main/kotlin/org/jraf/android/prefs/sample/prefs/Main.kt index 9a42c25..6e33505 100644 --- a/sample/src/main/kotlin/org/jraf/android/prefs/sample/prefs/Main.kt +++ b/sample/src/main/kotlin/org/jraf/android/prefs/sample/prefs/Main.kt @@ -32,7 +32,7 @@ import org.jraf.android.prefs.Prefs */ @Prefs( generateGetLiveData = true, - useAndroidX = false + useAndroidX = true ) class Main { diff --git a/sample/src/main/kotlin/org/jraf/android/prefs/sample/prefs/Settings.kt b/sample/src/main/kotlin/org/jraf/android/prefs/sample/prefs/Settings.kt index ee9e603..a6e7d65 100644 --- a/sample/src/main/kotlin/org/jraf/android/prefs/sample/prefs/Settings.kt +++ b/sample/src/main/kotlin/org/jraf/android/prefs/sample/prefs/Settings.kt @@ -34,7 +34,7 @@ import org.jraf.android.prefs.Prefs @Prefs( fileName = "settings", fileMode = Context.MODE_PRIVATE, - useAndroidX = false + useAndroidX = true ) class Settings { @DefaultInt(-0x44ff23)