diff --git a/app/build.gradle b/app/build.gradle index 1b8ff0a..409e1d8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,7 +8,7 @@ android { targetSdkVersion 28 versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { @@ -23,10 +23,11 @@ dependencies { implementation project(':emptyrecyclerview') - implementation 'com.android.support:appcompat-v7:28.0.0' - implementation 'com.android.support:recyclerview-v7:28.0.0' - implementation 'com.android.support.constraint:constraint-layout:1.1.3' + implementation 'androidx.appcompat:appcompat:1.0.0' + implementation 'androidx.recyclerview:recyclerview:1.0.0' + implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2' + 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.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' } diff --git a/app/src/androidTest/java/com/app/dr1009/emptyrecyclerviewdemo/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/app/dr1009/emptyrecyclerviewdemo/ExampleInstrumentedTest.java index e7620f9..3ef6d5d 100644 --- a/app/src/androidTest/java/com/app/dr1009/emptyrecyclerviewdemo/ExampleInstrumentedTest.java +++ b/app/src/androidTest/java/com/app/dr1009/emptyrecyclerviewdemo/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package com.app.dr1009.emptyrecyclerviewdemo; import android.content.Context; -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/com/app/dr1009/emptyrecyclerviewdemo/MainActivity.java b/app/src/main/java/com/app/dr1009/emptyrecyclerviewdemo/MainActivity.java index 6e46377..e774255 100644 --- a/app/src/main/java/com/app/dr1009/emptyrecyclerviewdemo/MainActivity.java +++ b/app/src/main/java/com/app/dr1009/emptyrecyclerviewdemo/MainActivity.java @@ -1,8 +1,6 @@ package com.app.dr1009.emptyrecyclerviewdemo; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.LinearLayoutManager; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; @@ -12,6 +10,9 @@ import java.util.ArrayList; import java.util.List; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.LinearLayoutManager; + public class MainActivity extends AppCompatActivity { private final RecyclerAdapter mAdapter = new RecyclerAdapter(); diff --git a/app/src/main/java/com/app/dr1009/emptyrecyclerviewdemo/RecyclerAdapter.java b/app/src/main/java/com/app/dr1009/emptyrecyclerviewdemo/RecyclerAdapter.java index 0b1b7ba..76956d4 100644 --- a/app/src/main/java/com/app/dr1009/emptyrecyclerviewdemo/RecyclerAdapter.java +++ b/app/src/main/java/com/app/dr1009/emptyrecyclerviewdemo/RecyclerAdapter.java @@ -1,15 +1,16 @@ package com.app.dr1009.emptyrecyclerviewdemo; -import android.support.annotation.NonNull; -import android.support.v7.recyclerview.extensions.ListAdapter; -import android.support.v7.util.DiffUtil; -import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.DiffUtil; +import androidx.recyclerview.widget.ListAdapter; +import androidx.recyclerview.widget.RecyclerView; + public class RecyclerAdapter extends ListAdapter { RecyclerAdapter() { diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index f3d239f..b5fcf42 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/list_item.xml b/app/src/main/res/layout/list_item.xml index 983092a..52124b1 100644 --- a/app/src/main/res/layout/list_item.xml +++ b/app/src/main/res/layout/list_item.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/sample_empty_view.xml b/app/src/main/res/layout/sample_empty_view.xml index 50d60ce..a41ea2d 100644 --- a/app/src/main/res/layout/sample_empty_view.xml +++ b/app/src/main/res/layout/sample_empty_view.xml @@ -1,5 +1,5 @@ - @@ -19,4 +19,4 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - \ No newline at end of file + \ No newline at end of file diff --git a/emptyrecyclerview/build.gradle b/emptyrecyclerview/build.gradle index 2ce92ed..7583619 100644 --- a/emptyrecyclerview/build.gradle +++ b/emptyrecyclerview/build.gradle @@ -1,23 +1,23 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 27 + compileSdkVersion 28 defaultConfig { minSdkVersion 16 targetSdkVersion 28 - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.android.support:appcompat-v7:27.1.1' - implementation 'com.android.support:recyclerview-v7:27.1.1' + implementation 'androidx.appcompat:appcompat:1.0.0' + implementation 'androidx.recyclerview:recyclerview:1.0.0' 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.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' } diff --git a/emptyrecyclerview/src/androidTest/java/com/app/dr1009/emptyrecyclerview/ExampleInstrumentedTest.java b/emptyrecyclerview/src/androidTest/java/com/app/dr1009/emptyrecyclerview/ExampleInstrumentedTest.java index 3f7927f..bd50f96 100644 --- a/emptyrecyclerview/src/androidTest/java/com/app/dr1009/emptyrecyclerview/ExampleInstrumentedTest.java +++ b/emptyrecyclerview/src/androidTest/java/com/app/dr1009/emptyrecyclerview/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package com.app.dr1009.emptyrecyclerview; import android.content.Context; -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/emptyrecyclerview/src/main/java/com/app/dr1009/emptyrecyclerview/EmptyRecyclerView.java b/emptyrecyclerview/src/main/java/com/app/dr1009/emptyrecyclerview/EmptyRecyclerView.java index 587899f..eb174ed 100644 --- a/emptyrecyclerview/src/main/java/com/app/dr1009/emptyrecyclerview/EmptyRecyclerView.java +++ b/emptyrecyclerview/src/main/java/com/app/dr1009/emptyrecyclerview/EmptyRecyclerView.java @@ -2,12 +2,13 @@ import android.content.Context; import android.graphics.Canvas; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; import android.view.View; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.RecyclerView; + public class EmptyRecyclerView extends RecyclerView { @Nullable diff --git a/gradle.properties b/gradle.properties index 82618ce..d546dea 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,6 +6,8 @@ # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. +android.enableJetifier=true +android.useAndroidX=true org.gradle.jvmargs=-Xmx1536m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit