diff --git a/app/build.gradle b/app/build.gradle
index f123956..00c2358 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -29,7 +29,7 @@ android {
targetSdkVersion 28
versionCode 1
versionName "1.0"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
@@ -47,18 +47,18 @@ ext {
dependencies {
// region Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
- kapt "android.arch.lifecycle:compiler:$archLifecycleVersion"
+ kapt 'androidx.lifecycle:lifecycle-compiler:2.1.0-alpha02'
// endregion
// region Support Library
- implementation 'com.android.support:appcompat-v7:28.0.0'
- implementation 'com.android.support:design:28.0.0'
- implementation 'com.android.support.constraint:constraint-layout:1.1.3'
+ implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
+ implementation 'com.google.android.material:material:1.1.0-alpha03'
+ implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
// endregion
// region ViewModel and LiveData
- implementation "android.arch.lifecycle:extensions:$archLifecycleVersion"
- kapt "android.arch.lifecycle:compiler:$archLifecycleVersion"
+ implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0-alpha02'
+ kapt 'androidx.lifecycle:lifecycle-compiler:2.1.0-alpha02'
// alternatively, just ViewModel
//implementation "android.arch.lifecycle:viewmodel:$archLifecycleVersion"
// alternatively, just LiveData
@@ -67,24 +67,24 @@ dependencies {
// region Jetpack / Developer Experience
// Room
- implementation "android.arch.persistence.room:runtime:$roomVersion"
- kapt "android.arch.persistence.room:compiler:$roomVersion"
+ implementation 'androidx.room:room-runtime:2.1.0-alpha04'
+ kapt 'androidx.room:room-compiler:2.1.0-alpha04'
// Paging
- implementation "android.arch.paging:runtime:1.0.1"
+ implementation "androidx.paging:paging-runtime:2.1.0"
- implementation 'androidx.core:core-ktx:1.0.1'
+ implementation 'androidx.core:core-ktx:1.1.0-alpha04'
// endregion
// region Tests
testImplementation 'junit:junit:4.12'
- androidTestImplementation 'com.android.support.test:runner:1.0.2'
- androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+ androidTestImplementation 'androidx.test:runner:1.1.2-alpha01'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.2-alpha01'
// Test helpers for LiveData
- testImplementation "android.arch.core:core-testing:1.1.1"
+ testImplementation "androidx.arch.core:core-testing:2.0.0"
// Test helpers for Room
- testImplementation "android.arch.persistence.room:testing:$roomVersion"
+ testImplementation 'androidx.room:room-testing:2.1.0-alpha04'
// endregion
}
diff --git a/app/src/androidTest/java/fr/plnech/lifelogger/ExampleInstrumentedTest.kt b/app/src/androidTest/java/fr/plnech/lifelogger/ExampleInstrumentedTest.kt
index 01a9b13..83c3d38 100644
--- a/app/src/androidTest/java/fr/plnech/lifelogger/ExampleInstrumentedTest.kt
+++ b/app/src/androidTest/java/fr/plnech/lifelogger/ExampleInstrumentedTest.kt
@@ -17,8 +17,8 @@
package fr.plnech.lifelogger
-import android.support.test.InstrumentationRegistry
-import android.support.test.runner.AndroidJUnit4
+import androidx.test.InstrumentationRegistry
+import androidx.test.runner.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
diff --git a/app/src/main/java/fr/plnech/lifelogger/model/LogViewModel.java b/app/src/main/java/fr/plnech/lifelogger/model/LogViewModel.java
index c2415a1..a98dec8 100644
--- a/app/src/main/java/fr/plnech/lifelogger/model/LogViewModel.java
+++ b/app/src/main/java/fr/plnech/lifelogger/model/LogViewModel.java
@@ -17,9 +17,9 @@
package fr.plnech.lifelogger.model;
-import android.arch.lifecycle.LiveData;
-import android.arch.lifecycle.MutableLiveData;
-import android.arch.lifecycle.ViewModel;
+import androidx.lifecycle.LiveData;
+import androidx.lifecycle.MutableLiveData;
+import androidx.lifecycle.ViewModel;
import java.util.List;
diff --git a/app/src/main/java/fr/plnech/lifelogger/ui/HomeActivity.kt b/app/src/main/java/fr/plnech/lifelogger/ui/HomeActivity.kt
index 9a63c48..e3f64c6 100644
--- a/app/src/main/java/fr/plnech/lifelogger/ui/HomeActivity.kt
+++ b/app/src/main/java/fr/plnech/lifelogger/ui/HomeActivity.kt
@@ -18,8 +18,8 @@
package fr.plnech.lifelogger.ui
import android.os.Bundle
-import android.support.design.widget.Snackbar
-import android.support.v7.app.AppCompatActivity
+import com.google.android.material.snackbar.Snackbar
+import androidx.appcompat.app.AppCompatActivity
import android.view.Menu
import android.view.MenuItem
import fr.plnech.lifelogger.R
@@ -41,7 +41,7 @@ class HomeActivity : AppCompatActivity() {
fab.setOnClickListener { view ->
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
- .setAction("Action", null).show()
+ .setAction("Action", null).show()
}
adapter = LogAdapter(this, generateDebugData())
diff --git a/app/src/main/res/layout/activity_home.xml b/app/src/main/res/layout/activity_home.xml
index 0982480..b855f43 100644
--- a/app/src/main/res/layout/activity_home.xml
+++ b/app/src/main/res/layout/activity_home.xml
@@ -16,7 +16,7 @@
~ along with this program. If not, see .
-->
-
-
-
-
+
-
-
+
diff --git a/app/src/main/res/layout/content_home.xml b/app/src/main/res/layout/content_home.xml
index 865a531..9da51ed 100644
--- a/app/src/main/res/layout/content_home.xml
+++ b/app/src/main/res/layout/content_home.xml
@@ -16,7 +16,7 @@
~ along with this program. If not, see .
-->
-
-
+
diff --git a/gradle.properties b/gradle.properties
index fdb29a4..2700d6c 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -32,3 +32,5 @@ org.gradle.jvmargs=-Xmx1536m
# 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
# org.gradle.parallel=true
+android.useAndroidX=true
+android.enableJetifier=true