refactor: Migrate to AndroidX

parent df453a19
...@@ -29,7 +29,7 @@ android { ...@@ -29,7 +29,7 @@ android {
targetSdkVersion 28 targetSdkVersion 28
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
buildTypes { buildTypes {
release { release {
...@@ -47,18 +47,18 @@ ext { ...@@ -47,18 +47,18 @@ ext {
dependencies { dependencies {
// region Kotlin // region Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
kapt "android.arch.lifecycle:compiler:$archLifecycleVersion" kapt 'androidx.lifecycle:lifecycle-compiler:2.1.0-alpha02'
// endregion // endregion
// region Support Library // region Support Library
implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
implementation 'com.android.support:design:28.0.0' implementation 'com.google.android.material:material:1.1.0-alpha03'
implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
// endregion // endregion
// region ViewModel and LiveData // region ViewModel and LiveData
implementation "android.arch.lifecycle:extensions:$archLifecycleVersion" implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0-alpha02'
kapt "android.arch.lifecycle:compiler:$archLifecycleVersion" kapt 'androidx.lifecycle:lifecycle-compiler:2.1.0-alpha02'
// alternatively, just ViewModel // alternatively, just ViewModel
//implementation "android.arch.lifecycle:viewmodel:$archLifecycleVersion" //implementation "android.arch.lifecycle:viewmodel:$archLifecycleVersion"
// alternatively, just LiveData // alternatively, just LiveData
...@@ -67,24 +67,24 @@ dependencies { ...@@ -67,24 +67,24 @@ dependencies {
// region Jetpack / Developer Experience // region Jetpack / Developer Experience
// Room // Room
implementation "android.arch.persistence.room:runtime:$roomVersion" implementation 'androidx.room:room-runtime:2.1.0-alpha04'
kapt "android.arch.persistence.room:compiler:$roomVersion" kapt 'androidx.room:room-compiler:2.1.0-alpha04'
// Paging // 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 // endregion
// region Tests // region Tests
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'androidx.test:runner:1.1.2-alpha01'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.2-alpha01'
// Test helpers for LiveData // 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 // Test helpers for Room
testImplementation "android.arch.persistence.room:testing:$roomVersion" testImplementation 'androidx.room:room-testing:2.1.0-alpha04'
// endregion // endregion
} }
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
package fr.plnech.lifelogger package fr.plnech.lifelogger
import android.support.test.InstrumentationRegistry import androidx.test.InstrumentationRegistry
import android.support.test.runner.AndroidJUnit4 import androidx.test.runner.AndroidJUnit4
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
package fr.plnech.lifelogger.model; package fr.plnech.lifelogger.model;
import android.arch.lifecycle.LiveData; import androidx.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData; import androidx.lifecycle.MutableLiveData;
import android.arch.lifecycle.ViewModel; import androidx.lifecycle.ViewModel;
import java.util.List; import java.util.List;
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
package fr.plnech.lifelogger.ui package fr.plnech.lifelogger.ui
import android.os.Bundle import android.os.Bundle
import android.support.design.widget.Snackbar import com.google.android.material.snackbar.Snackbar
import android.support.v7.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import fr.plnech.lifelogger.R import fr.plnech.lifelogger.R
...@@ -41,7 +41,7 @@ class HomeActivity : AppCompatActivity() { ...@@ -41,7 +41,7 @@ class HomeActivity : AppCompatActivity() {
fab.setOnClickListener { view -> fab.setOnClickListener { view ->
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show() .setAction("Action", null).show()
} }
adapter = LogAdapter(this, generateDebugData()) adapter = LogAdapter(this, generateDebugData())
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
~ along with this program. If not, see <http://www.gnu.org/licenses/>. ~ along with this program. If not, see <http://www.gnu.org/licenses/>.
--> -->
<android.support.design.widget.CoordinatorLayout <androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
...@@ -24,23 +24,23 @@ ...@@ -24,23 +24,23 @@
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context="fr.plnech.lifelogger.ui.HomeActivity"> tools:context="fr.plnech.lifelogger.ui.HomeActivity">
<android.support.design.widget.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar <androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/> app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_home"/> <include layout="@layout/content_home"/>
<android.support.design.widget.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab" android:id="@+id/fab"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -48,4 +48,4 @@ ...@@ -48,4 +48,4 @@
android:layout_margin="@dimen/fab_margin" android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_dialer"/> app:srcCompat="@android:drawable/ic_dialog_dialer"/>
</android.support.design.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
~ along with this program. If not, see <http://www.gnu.org/licenses/>. ~ along with this program. If not, see <http://www.gnu.org/licenses/>.
--> -->
<android.support.constraint.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
...@@ -38,4 +38,4 @@ ...@@ -38,4 +38,4 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/> app:layout_constraintTop_toTopOf="parent"/>
</android.support.constraint.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
...@@ -32,3 +32,5 @@ org.gradle.jvmargs=-Xmx1536m ...@@ -32,3 +32,5 @@ org.gradle.jvmargs=-Xmx1536m
# This option should only be used with decoupled projects. More details, visit # 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 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true # org.gradle.parallel=true
android.useAndroidX=true
android.enableJetifier=true
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment