From 7887875f1e9f06581eb304c19d3b14f4153f74a1 Mon Sep 17 00:00:00 2001 From: digitapex Date: Tue, 9 Jun 2020 20:22:22 +0200 Subject: [PATCH] Migrate to AndroidX --- app/build.gradle | 12 ++++++------ .../ukpetitions/ExampleInstrumentedTest.java | 4 ++-- .../com/spitslide/ukpetitions/MainActivity.java | 16 ++++++++-------- .../ukpetitions/PetitionItemActivity.java | 8 ++++---- .../spitslide/ukpetitions/PetitionsAdapter.java | 4 ++-- .../spitslide/ukpetitions/PetitionsFragment.java | 12 ++++++------ app/src/main/res/layout/activity_main.xml | 8 ++++---- .../main/res/layout/activity_petitions_item.xml | 2 +- app/src/main/res/layout/fragment_petitions.xml | 2 +- app/src/main/res/menu/menu.xml | 2 +- build.gradle | 2 +- gradle.properties | 2 ++ gradle/wrapper/gradle-wrapper.properties | 2 +- 13 files changed, 39 insertions(+), 37 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d1b7e16..2a6b59a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,7 +9,7 @@ android { targetSdkVersion 28 versionCode 3 versionName "1.02" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { @@ -21,13 +21,13 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.android.support:appcompat-v7:28.0.0' - implementation 'com.android.support:design:28.0.0' - implementation 'com.android.support:recyclerview-v7:28.0.0' + implementation 'androidx.appcompat:appcompat:1.0.0' + implementation 'com.google.android.material:material:1.0.0' + implementation 'androidx.recyclerview:recyclerview:1.0.0' implementation 'com.squareup.retrofit2:retrofit:2.4.0' implementation 'com.squareup.retrofit2:converter-gson:2.4.0' implementation 'com.google.android.gms:play-services-auth:16.0.1' 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.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' } diff --git a/app/src/androidTest/java/com/spitslide/ukpetitions/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/spitslide/ukpetitions/ExampleInstrumentedTest.java index 1cc886a..8ae3364 100644 --- a/app/src/androidTest/java/com/spitslide/ukpetitions/ExampleInstrumentedTest.java +++ b/app/src/androidTest/java/com/spitslide/ukpetitions/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package com.spitslide.ukpetitions; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/app/src/main/java/com/spitslide/ukpetitions/MainActivity.java b/app/src/main/java/com/spitslide/ukpetitions/MainActivity.java index 2fb42a9..411cc36 100644 --- a/app/src/main/java/com/spitslide/ukpetitions/MainActivity.java +++ b/app/src/main/java/com/spitslide/ukpetitions/MainActivity.java @@ -6,14 +6,14 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; -import android.support.design.widget.NavigationView; -import android.support.v4.view.GravityCompat; -import android.support.v4.widget.DrawerLayout; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.SearchView; -import android.support.v7.widget.Toolbar; +import com.google.android.material.navigation.NavigationView; +import androidx.core.view.GravityCompat; +import androidx.drawerlayout.widget.DrawerLayout; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.SearchView; +import androidx.appcompat.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; diff --git a/app/src/main/java/com/spitslide/ukpetitions/PetitionItemActivity.java b/app/src/main/java/com/spitslide/ukpetitions/PetitionItemActivity.java index 8ef65ed..24b7b74 100644 --- a/app/src/main/java/com/spitslide/ukpetitions/PetitionItemActivity.java +++ b/app/src/main/java/com/spitslide/ukpetitions/PetitionItemActivity.java @@ -1,10 +1,10 @@ package com.spitslide.ukpetitions; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import android.view.MenuItem; import android.widget.TextView; diff --git a/app/src/main/java/com/spitslide/ukpetitions/PetitionsAdapter.java b/app/src/main/java/com/spitslide/ukpetitions/PetitionsAdapter.java index fa236fa..cdbff41 100644 --- a/app/src/main/java/com/spitslide/ukpetitions/PetitionsAdapter.java +++ b/app/src/main/java/com/spitslide/ukpetitions/PetitionsAdapter.java @@ -2,8 +2,8 @@ import android.content.Context; import android.content.Intent; -import android.support.annotation.NonNull; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/com/spitslide/ukpetitions/PetitionsFragment.java b/app/src/main/java/com/spitslide/ukpetitions/PetitionsFragment.java index 8b94d9b..ba27f03 100644 --- a/app/src/main/java/com/spitslide/ukpetitions/PetitionsFragment.java +++ b/app/src/main/java/com/spitslide/ukpetitions/PetitionsFragment.java @@ -2,12 +2,12 @@ import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index cfd8383..bd22f52 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,5 +1,5 @@ - - - - + diff --git a/app/src/main/res/layout/activity_petitions_item.xml b/app/src/main/res/layout/activity_petitions_item.xml index db49ffc..1676a3c 100644 --- a/app/src/main/res/layout/activity_petitions_item.xml +++ b/app/src/main/res/layout/activity_petitions_item.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - -