From cb3178f642baa3282cb061a3eb91d8d7e73d2d5d Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Wed, 31 Oct 2018 08:55:55 -0600 Subject: [PATCH] Update project to use the new AndroidX libraries. --- app/build.gradle | 29 ++++++------------- .../ExampleInstrumentedTest.kt | 4 +-- .../activities/MainActivity.kt | 12 ++++---- .../activities/ReceiveTransactionActivity.kt | 2 +- .../activities/SendTransactionActivity.kt | 2 +- .../activities/SettingsActivity.kt | 2 +- .../fragments/BalancesFragment.kt | 6 ++-- .../fragments/MerchantsFragment.kt | 6 ++-- .../fragments/TransactionsFragment.kt | 6 ++-- .../viewmodels/BalancesViewModel.kt | 2 +- .../viewmodels/MerchantsViewModel.kt | 2 +- .../viewmodels/TransactionsViewModel.kt | 2 +- app/src/main/res/layout/activity_main.xml | 16 +++++----- .../layout/activity_receive_transaction.xml | 4 +-- .../res/layout/activity_send_transaction.xml | 4 +-- gradle.properties | 2 ++ 16 files changed, 46 insertions(+), 55 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5547e3b..d742184 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,7 +12,7 @@ android { targetSdkVersion 28 versionCode 1 versionName "0.1" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { @@ -26,25 +26,14 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation project(':graphenejlib:graphenej') implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.android.support:appcompat-v7:28.0.0' - implementation 'com.android.support.constraint:constraint-layout:1.1.3' - implementation 'com.android.support:design:28.0.0' - implementation 'com.android.support:support-v4:28.0.0' - implementation 'android.arch.lifecycle:runtime:1.1.1' - implementation 'android.arch.lifecycle:extensions:1.1.1' - implementation 'android.arch.persistence.room:runtime:1.1.0' - - kapt 'android.arch.persistence.room:runtime:1.1.0' - annotationProcessor 'android.arch.lifecycle:compiler:1.1.1' - kapt 'android.arch.lifecycle:compiler:1.1.1' - annotationProcessor 'android.arch.lifecycle:compiler:1.1.1' - kapt 'android.arch.persistence.room:compiler:1.1.0' - annotationProcessor 'android.arch.persistence.room:compiler:1.1.0' - - kapt "android.arch.lifecycle:compiler:1.1.1" - kapt "android.arch.persistence.room:compiler:1.1.0" + implementation 'androidx.appcompat:appcompat:1.0.0' + implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2' + implementation 'com.google.android.material:material:1.0.0' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'androidx.lifecycle:lifecycle-runtime:2.0.0' + implementation 'androidx.lifecycle:lifecycle-extensions:2.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/app/src/androidTest/java/cy/agorise/bitsybitshareswallet/ExampleInstrumentedTest.kt b/app/src/androidTest/java/cy/agorise/bitsybitshareswallet/ExampleInstrumentedTest.kt index c4aebfd..a452fc9 100644 --- a/app/src/androidTest/java/cy/agorise/bitsybitshareswallet/ExampleInstrumentedTest.kt +++ b/app/src/androidTest/java/cy/agorise/bitsybitshareswallet/ExampleInstrumentedTest.kt @@ -1,7 +1,7 @@ package cy.agorise.bitsybitshareswallet -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/cy/agorise/bitsybitshareswallet/activities/MainActivity.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/activities/MainActivity.kt index 6974b68..593b3e4 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/activities/MainActivity.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/activities/MainActivity.kt @@ -1,11 +1,11 @@ package cy.agorise.bitsybitshareswallet.activities import android.content.Intent -import android.support.v7.app.AppCompatActivity +import androidx.appcompat.app.AppCompatActivity -import android.support.v4.app.Fragment -import android.support.v4.app.FragmentManager -import android.support.v4.app.FragmentPagerAdapter +import androidx.fragment.app.Fragment +import androidx.fragment.app.FragmentManager +import androidx.fragment.app.FragmentPagerAdapter import android.os.Bundle import cy.agorise.bitsybitshareswallet.BuildConfig import cy.agorise.bitsybitshareswallet.R @@ -64,9 +64,9 @@ class MainActivity : AppCompatActivity() { * A [FragmentPagerAdapter] that returns a fragment corresponding to * one of the sections/tabs/pages. */ - inner class SectionsPagerAdapter(fm: FragmentManager) : FragmentPagerAdapter(fm) { + inner class SectionsPagerAdapter(fm: androidx.fragment.app.FragmentManager) : androidx.fragment.app.FragmentPagerAdapter(fm) { - override fun getItem(position: Int): Fragment { + override fun getItem(position: Int): androidx.fragment.app.Fragment { return when (position) { 0 -> BalancesFragment() 1 -> TransactionsFragment() diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/activities/ReceiveTransactionActivity.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/activities/ReceiveTransactionActivity.kt index 40d651d..841493c 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/activities/ReceiveTransactionActivity.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/activities/ReceiveTransactionActivity.kt @@ -1,6 +1,6 @@ package cy.agorise.bitsybitshareswallet.activities -import android.support.v7.app.AppCompatActivity +import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import cy.agorise.bitsybitshareswallet.R diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/activities/SendTransactionActivity.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/activities/SendTransactionActivity.kt index b8b12c0..a6969d6 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/activities/SendTransactionActivity.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/activities/SendTransactionActivity.kt @@ -1,6 +1,6 @@ package cy.agorise.bitsybitshareswallet.activities -import android.support.v7.app.AppCompatActivity +import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import cy.agorise.bitsybitshareswallet.R diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/activities/SettingsActivity.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/activities/SettingsActivity.kt index 83d5d21..173bc70 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/activities/SettingsActivity.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/activities/SettingsActivity.kt @@ -3,7 +3,7 @@ package cy.agorise.bitsybitshareswallet.activities import android.os.Bundle import android.preference.PreferenceManager import android.view.MenuItem -import android.support.v7.app.AppCompatActivity +import androidx.appcompat.app.AppCompatActivity import cy.agorise.bitsybitshareswallet.R import cy.agorise.bitsybitshareswallet.utils.Constants import kotlinx.android.synthetic.main.activity_settings.* diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/BalancesFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/BalancesFragment.kt index 7d093b8..5e72956 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/BalancesFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/BalancesFragment.kt @@ -1,9 +1,9 @@ package cy.agorise.bitsybitshareswallet.fragments -import android.arch.lifecycle.ViewModelProviders +import androidx.lifecycle.ViewModelProviders import android.content.Intent import android.os.Bundle -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -14,7 +14,7 @@ import cy.agorise.bitsybitshareswallet.activities.SendTransactionActivity import cy.agorise.bitsybitshareswallet.viewmodels.BalancesViewModel import kotlinx.android.synthetic.main.fragment_balances.* -class BalancesFragment : Fragment() { +class BalancesFragment : androidx.fragment.app.Fragment() { companion object { fun newInstance() = BalancesFragment() diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/MerchantsFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/MerchantsFragment.kt index ad65a31..ff37dc0 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/MerchantsFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/MerchantsFragment.kt @@ -1,8 +1,8 @@ package cy.agorise.bitsybitshareswallet.fragments -import android.arch.lifecycle.ViewModelProviders +import androidx.lifecycle.ViewModelProviders import android.os.Bundle -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -10,7 +10,7 @@ import android.view.ViewGroup import cy.agorise.bitsybitshareswallet.R import cy.agorise.bitsybitshareswallet.viewmodels.MerchantsViewModel -class MerchantsFragment : Fragment() { +class MerchantsFragment : androidx.fragment.app.Fragment() { companion object { fun newInstance() = MerchantsFragment() diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/TransactionsFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/TransactionsFragment.kt index c31728c..be9d905 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/TransactionsFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/TransactionsFragment.kt @@ -1,8 +1,8 @@ package cy.agorise.bitsybitshareswallet.fragments -import android.arch.lifecycle.ViewModelProviders +import androidx.lifecycle.ViewModelProviders import android.os.Bundle -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -10,7 +10,7 @@ import android.view.ViewGroup import cy.agorise.bitsybitshareswallet.R import cy.agorise.bitsybitshareswallet.viewmodels.TransactionsViewModel -class TransactionsFragment : Fragment() { +class TransactionsFragment : androidx.fragment.app.Fragment() { companion object { fun newInstance() = TransactionsFragment() diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/viewmodels/BalancesViewModel.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/viewmodels/BalancesViewModel.kt index ca17066..788d761 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/viewmodels/BalancesViewModel.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/viewmodels/BalancesViewModel.kt @@ -1,6 +1,6 @@ package cy.agorise.bitsybitshareswallet.viewmodels -import android.arch.lifecycle.ViewModel +import androidx.lifecycle.ViewModel class BalancesViewModel : ViewModel() { // TODO: Implement the ViewModel diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/viewmodels/MerchantsViewModel.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/viewmodels/MerchantsViewModel.kt index 870444d..662dbe7 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/viewmodels/MerchantsViewModel.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/viewmodels/MerchantsViewModel.kt @@ -1,6 +1,6 @@ package cy.agorise.bitsybitshareswallet.viewmodels -import android.arch.lifecycle.ViewModel; +import androidx.lifecycle.ViewModel; class MerchantsViewModel : ViewModel() { // TODO: Implement the ViewModel diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/viewmodels/TransactionsViewModel.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/viewmodels/TransactionsViewModel.kt index 0ec12f3..12df4e4 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/viewmodels/TransactionsViewModel.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/viewmodels/TransactionsViewModel.kt @@ -1,6 +1,6 @@ package cy.agorise.bitsybitshareswallet.viewmodels -import android.arch.lifecycle.ViewModel; +import androidx.lifecycle.ViewModel; class TransactionsViewModel : ViewModel() { // TODO: Implement the ViewModel diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 60e5cb1..efd102d 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/activity_receive_transaction.xml b/app/src/main/res/layout/activity_receive_transaction.xml index 9baac7b..d1b31e3 100644 --- a/app/src/main/res/layout/activity_receive_transaction.xml +++ b/app/src/main/res/layout/activity_receive_transaction.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/activity_send_transaction.xml b/app/src/main/res/layout/activity_send_transaction.xml index 09f4e4c..5500336 100644 --- a/app/src/main/res/layout/activity_send_transaction.xml +++ b/app/src/main/res/layout/activity_send_transaction.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 85be9ea..3d8ce0c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,3 +13,5 @@ org.gradle.jvmargs=-Xmx1536m # org.gradle.parallel=true # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official +android.useAndroidX=true +android.enableJetifier=true