Update project to use the new AndroidX libraries.

This commit is contained in:
Severiano Jaramillo 2018-10-31 08:55:55 -06:00
parent 75a4f601c1
commit cb3178f642
16 changed files with 46 additions and 55 deletions

View file

@ -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'
}

View file

@ -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

View file

@ -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()

View file

@ -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

View file

@ -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

View file

@ -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.*

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
@ -9,7 +9,7 @@
android:fitsSystemWindows="true"
tools:context=".activities.MainActivity">
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -28,22 +28,22 @@
<!--</android.support.v7.widget.Toolbar>-->
<android.support.design.widget.TabLayout
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabIndicatorHeight="0dp"
app:tabMode="scrollable"/>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<android.support.v4.view.ViewPager
<androidx.viewpager.widget.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_gravity="bottom"
@ -95,6 +95,6 @@
app:layout_constraintTop_toTopOf="parent"
android:contentDescription="@string/title_settings"/>
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
@ -7,4 +7,4 @@
android:layout_height="match_parent"
tools:context=".activities.ReceiveTransactionActivity">
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
@ -7,4 +7,4 @@
android:layout_height="match_parent"
tools:context=".activities.SendTransactionActivity">
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -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