Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.

Commit d9d9361

Browse files
authored
Merge pull request #61 from amardeshbd/46_migrate_to_androidx
Android X Migration.
2 parents de99504 + e0e8a06 commit d9d9361

27 files changed

+111
-84
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
# Our Android Docker images are currently tagged with the suffix -alpha.
1212
# This is to indicate the images are currently under development and
1313
# might change in backwards incompatible ways from week to week.
14-
- image: circleci/android:api-27-alpha
14+
- image: circleci/android:api-28-alpha
1515
environment:
1616
JVM_OPTS: -Xmx3200m
1717
steps:

.idea/encodings.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ android {
2222
buildConfigField "String", "GIT_SHA", "\"${gitSha()}\""
2323
buildConfigField "String", "BUILD_TIME", "\"${buildTime()}\""
2424

25-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
25+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2626
}
2727
buildTypes {
2828
release {
@@ -44,26 +44,26 @@ android {
4444
dependencies {
4545
implementation fileTree(dir: 'libs', include: ['*.jar'])
4646
// Kotlin support
47-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlinVersion"
47+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
4848

4949
// Android Support libs and Google Android libs
50-
implementation "com.android.support:support-v13:$rootProject.supportLibraryVersion"
51-
implementation "com.android.support:design:$rootProject.supportLibraryVersion"
52-
implementation "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
50+
implementation "androidx.legacy:legacy-support-v13:$rootProject.supportLibraryVersion"
51+
implementation "com.google.android.material:material:$rootProject.supportLibraryVersion"
52+
implementation "androidx.cardview:cardview:$rootProject.supportLibraryVersion"
5353

54-
implementation "com.android.support.constraint:constraint-layout:$rootProject.constraintLayoutVersion"
54+
implementation "androidx.constraintlayout:constraintlayout:$rootProject.constraintLayoutVersion"
5555

5656
// ViewModel and LiveData
5757
// https://developer.android.com/topic/libraries/architecture/adding-components
58-
implementation "android.arch.lifecycle:extensions:$rootProject.archComponentVersion"
58+
implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.archComponentVersion"
5959

6060
// https://developer.chrome.com/multidevice/android/customtabs
61-
implementation "com.android.support:customtabs:$rootProject.supportLibraryVersion"
61+
implementation "androidx.browser:browser:$rootProject.supportLibraryVersion"
6262

6363
// ========================================================
6464
// 3rd party libraries
6565
// ========================================================
66-
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
66+
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
6767
debugImplementation "com.squareup.leakcanary:leakcanary-android:$rootProject.leakcanaryLibraryVersion"
6868
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$rootProject.leakcanaryLibraryVersion"
6969

@@ -98,11 +98,11 @@ dependencies {
9898
// Mocking framework for unit tests written in Java
9999
testImplementation "org.mockito:mockito-core:$rootProject.mockitoVersion"
100100

101-
androidTestImplementation("com.android.support.test.espresso:espresso-core:$rootProject.espressoVersion", {
101+
androidTestImplementation("androidx.test.espresso:espresso-core:$rootProject.espressoVersion", {
102102
exclude group: 'com.android.support', module: 'support-annotations'
103103
})
104-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
105-
testImplementation "android.arch.core:core-testing:$rootProject.archComponentVersion"
104+
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
105+
testImplementation "androidx.arch.core:core-testing:$rootProject.archComponentVersion"
106106
}
107107

108108
// ADD THIS AT THE BOTTOM

app/src/androidTest/java/com/hossainkhan/android/demo/ExampleInstrumentedTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.hossainkhan.android.demo
22

3-
import android.support.test.InstrumentationRegistry
4-
import android.support.test.runner.AndroidJUnit4
3+
import androidx.test.InstrumentationRegistry
4+
import androidx.test.runner.AndroidJUnit4
55

66
import org.junit.Test
77
import org.junit.runner.RunWith

app/src/main/java/com/hossainkhan/android/demo/browse/LayoutBrowseActivity.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
package com.hossainkhan.android.demo.browse
1818

19-
import android.arch.lifecycle.ViewModelProviders
19+
import androidx.lifecycle.ViewModelProviders
2020
import android.os.Bundle
21-
import android.support.v7.app.AppCompatActivity
22-
import android.support.v7.widget.GridLayoutManager
23-
import android.support.v7.widget.RecyclerView
21+
import androidx.appcompat.app.AppCompatActivity
22+
import androidx.recyclerview.widget.GridLayoutManager
23+
import androidx.recyclerview.widget.RecyclerView
2424
import com.hossainkhan.android.demo.R
2525
import com.hossainkhan.android.demo.layoutpreview.LayoutChainStyleActivity
2626
import com.hossainkhan.android.demo.layoutpreview.LayoutPreviewBaseActivity

app/src/main/java/com/hossainkhan/android/demo/browse/LayoutBrowseAdapter.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
package com.hossainkhan.android.demo.browse
1818

19-
import android.arch.lifecycle.LifecycleOwner
20-
import android.arch.lifecycle.Observer
21-
import android.support.v7.widget.RecyclerView
19+
import androidx.lifecycle.LifecycleOwner
20+
import androidx.lifecycle.Observer
21+
import androidx.recyclerview.widget.RecyclerView
2222
import android.view.LayoutInflater
2323
import android.view.View
2424
import android.view.ViewGroup

app/src/main/java/com/hossainkhan/android/demo/browse/LayoutBrowseViewModel.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
package com.hossainkhan.android.demo.browse
1818

19-
import android.arch.lifecycle.LiveData
20-
import android.arch.lifecycle.MutableLiveData
21-
import android.arch.lifecycle.ViewModel
19+
import androidx.lifecycle.LiveData
20+
import androidx.lifecycle.MutableLiveData
21+
import androidx.lifecycle.ViewModel
2222
import com.hossainkhan.android.demo.data.AppDataStore
2323
import com.hossainkhan.android.demo.data.LayoutInformation
2424
import timber.log.Timber

app/src/main/java/com/hossainkhan/android/demo/data/LayoutDataStore.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package com.hossainkhan.android.demo.data
1818

1919
import android.content.res.Resources
20-
import android.support.annotation.LayoutRes
20+
import androidx.annotation.LayoutRes
2121
import com.hossainkhan.android.demo.R
2222
import com.hossainkhan.android.demo.base.AppConfig
2323
import javax.inject.Inject

app/src/main/java/com/hossainkhan/android/demo/data/LayoutInformation.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
package com.hossainkhan.android.demo.data
1818

19-
import android.support.annotation.DrawableRes
20-
import android.support.annotation.LayoutRes
19+
import androidx.annotation.DrawableRes
20+
import androidx.annotation.LayoutRes
2121

2222
/**
2323
* A simple data class containing layout resource ID and it's respective description.

0 commit comments

Comments
 (0)