Skip to content

Commit 5132a05

Browse files
authored
Merge pull request #570 from OpenSRP/android_x_support
Android x Migration
2 parents 298d9a4 + c5d6317 commit 5132a05

File tree

175 files changed

+708
-388
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+708
-388
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ before_script:
4949
- chmod +x gradlew
5050

5151
script:
52-
- ./gradlew opensrp-app:clean opensrp-app:jacocoTestReport --stacktrace
52+
- ./gradlew opensrp-app:clean opensrp-app:jacocoTestReport --stacktrace
5353

5454
after_success:
5555
- ./gradlew opensrp-app:coveralls --stacktrace

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ buildscript {
99

1010
dependencies {
1111
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.11.0"
12+
classpath 'com.android.tools.build:gradle:4.0.0'
1213
classpath 'gradle.plugin.org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.10.1'
1314
classpath 'org.smartregister:gradle-jarjar-plugin:1.0.0-SNAPSHOT'
1415
}

gradle.properties

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION_NAME=2.2.7-SNAPSHOT
1+
VERSION_NAME=3.0.0-SNAPSHOT
22
VERSION_CODE=1
33
GROUP=org.smartregister
44
POM_SETTING_DESCRIPTION=OpenSRP Client Core Application
@@ -11,5 +11,7 @@ POM_SETTING_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
1111
POM_SETTING_LICENCE_DIST=repo
1212
POM_SETTING_DEVELOPER_ID=opensrp
1313
POM_SETTING_DEVELOPER_NAME=OpenSRP Onadev
14+
android.useAndroidX=true
15+
android.enableJetifier=true
1416

1517
org.gradle.jvmargs=-Xmx2048m
+7-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
#Tue May 15 18:45:24 EAT 2018
2-
org.gradle.daemon=true
3-
zipStorePath=wrapper/dists
4-
org.gradle.parallel=true
1+
#Wed Jun 24 12:56:07 EAT 2020
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
54
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
org.gradle.daemon=true
67
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
78
org.gradle.configureondemand=true
8-
distributionPath=wrapper/dists
9-
distributionBase=GRADLE_USER_HOME
9+
org.gradle.parallel=true
10+
org.gradle.jvmargs=-Xmx2048m

opensrp-app/build.gradle

+35-25
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ buildscript {
77
maven { url 'https://maven.fabric.io/public' }
88
}
99
dependencies {
10-
1110
classpath "com.android.tools.build:gradle:$androidToolsBuildGradle"
12-
classpath 'org.apache.commons:commons-lang3:3.3.2'
13-
classpath 'io.fabric.tools:gradle:1.30.0'
11+
classpath 'org.apache.commons:commons-lang3:3.10'
12+
classpath 'io.fabric.tools:gradle:1.31.2'
1413
}
1514
}
1615

@@ -53,7 +52,6 @@ android {
5352
sourceCompatibility JavaVersion.VERSION_1_8
5453
targetCompatibility JavaVersion.VERSION_1_8
5554
coreLibraryDesugaringEnabled true
56-
5755
}
5856

5957
buildTypes {
@@ -159,21 +157,26 @@ configurations.all {
159157

160158
dependencies {
161159
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.5'
162-
implementation 'net.zetetic:android-database-sqlcipher:4.1.3'
163-
implementation 'com.android.support:multidex:1.0.3'
160+
implementation 'net.zetetic:android-database-sqlcipher:4.2.0'
161+
implementation 'androidx.multidex:multidex:2.0.1'
164162
implementation 'org.codehaus.jackson:jackson-core-asl:1.9.13'
165-
implementation 'com.android.support:appcompat-v7:28.0.0'
166-
implementation 'com.android.support:support-v4:28.0.0'
167-
implementation "org.apache.httpcomponents:httpmime:4.2.3"
163+
implementation 'androidx.appcompat:appcompat:1.1.0'
164+
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
165+
implementation "org.apache.httpcomponents:httpmime:4.5.6"
168166
implementation group: 'commons-codec', name: 'commons-codec', version: '1.10'
169-
implementation group: 'com.google.guava', name: 'guava', version: '20.0'
167+
implementation group: 'com.google.guava', name: 'guava', version: '24.1-jre'
170168
implementation group: 'commons-io', name: 'commons-io', version: '2.4'
171-
implementation 'org.apache.commons:commons-lang3:3.2'
169+
implementation 'org.apache.commons:commons-lang3:3.9'
172170
implementation 'org.mozilla:rhino:1.7R4'
173171
implementation 'com.ocpsoft:ocpsoft-pretty-time:1.0.7'
174-
api 'joda-time:joda-time:2.10.3'
175-
implementation 'com.github.bmelnychuk:atv:1.2.9'
176-
implementation 'com.github.johnkil.print:print:1.2.3'
172+
api 'joda-time:joda-time:2.10.5'
173+
implementation ('com.github.bmelnychuk:atv:1.2.9'){
174+
exclude group: 'com.google.android', module: 'android'
175+
}
176+
177+
implementation ('com.github.johnkil.print:print:1.3.1'){
178+
exclude group: 'com.google.android', module: 'android'
179+
}
177180

178181
implementation('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') {
179182
transitive = true
@@ -183,29 +186,35 @@ dependencies {
183186
exclude group: 'org.json', module: 'json'
184187
}
185188

186-
implementation 'com.github.ybq:Android-SpinKit:1.2.0'
189+
implementation 'com.github.ybq:Android-SpinKit:1.4.0'
187190
implementation 'com.mcxiaoke.volley:library:1.0.19'
188191

189192
implementation fileTree(include: ['*.jar'], dir: 'libs')
190193
annotationProcessor fileTree(include: ['butterknife*.jar'], dir: 'libs')
191194

192195
implementation 'com.cloudant:cloudant-http:2.7.0'
193-
implementation 'com.android.support:recyclerview-v7:28.0.0'
196+
implementation 'androidx.recyclerview:recyclerview:1.1.0'
194197

195-
implementation('com.android.support:design:28.0.0') {
198+
implementation('com.google.android.material:material:1.1.0') {
196199
exclude group: 'com.android.support', module: 'recyclerview-v7'
197200
}
198201

199-
implementation 'com.evernote:android-job:1.2.6'
202+
implementation ('com.evernote:android-job:1.2.6'){
203+
exclude group: 'com.google.android', module: 'android'
204+
}
205+
200206
implementation group: 'commons-validator', name: 'commons-validator', version: '1.6'
201-
implementation 'de.hdodenhof:circleimageview:2.2.0'
207+
implementation ('de.hdodenhof:circleimageview:3.1.0'){
208+
exclude group: 'com.google.android', module: 'android'
209+
}
202210

203211
implementation('org.smartregister:android-p2p-sync:0.3.7-SNAPSHOT') {
204212
exclude group: 'com.android.support', module: 'support-v4'
205213
exclude group: 'com.android.support', module: 'appcompat-v7'
206214
exclude group: 'android.arch.core', module: 'runtime'
207215
}
208216

217+
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
209218
compileOnly 'org.projectlombok:lombok:1.18.12'
210219
annotationProcessor 'org.projectlombok:lombok:1.18.12'
211220

@@ -239,25 +248,24 @@ dependencies {
239248

240249
implementation fileTree(include: ['*.jar'], dir: 'libs')
241250

242-
androidTestImplementation 'junit:junit:4.12'
251+
androidTestImplementation 'junit:junit:4.13'
243252

244-
testImplementation group: 'com.google.android', name: 'android-test', version: '4.1.1.4'
245253
testImplementation 'org.apache.maven:maven-ant-tasks:2.1.3'
246-
testImplementation 'org.mockito:mockito-core:1.9.5'
254+
testImplementation 'org.mockito:mockito-core:3.1.0'
247255
testAnnotationProcessor fileTree(include: ['butterknife*.jar'], dir: 'libs')
248256

249-
testImplementation('org.robolectric:robolectric:4.0') {
257+
testImplementation('org.robolectric:robolectric:4.3.1') {
250258
exclude group: 'com.google.guava', module: 'guava'
251259
exclude group: 'org.apache.maven', module: 'maven-model'
252260
exclude group: 'com.android.support'
253261
exclude group: 'androidx.test'
254262
exclude group: 'com.thoughtworks.xstream', module: 'xstream'
255263
}
256-
testImplementation('org.robolectric:shadows-multidex:4.0') {
264+
265+
testImplementation('org.robolectric:shadows-multidex:4.3.1') {
257266
exclude group: 'com.google.guava', module: 'guava'
258267
}
259268

260-
testImplementation "org.robolectric:shadows-support-v4:3.3.2"
261269
// PowerMock
262270
def powerMockVersion = '2.0.4'
263271
testImplementation "org.powermock:powermock-module-junit4:$powerMockVersion"
@@ -266,6 +274,8 @@ dependencies {
266274
testImplementation "org.powermock:powermock-api-mockito2:$powerMockVersion"
267275
testImplementation("org.powermock:powermock-classloading-xstream:$powerMockVersion")
268276

277+
def fragmentVersion = "1.2.5"
278+
testImplementation "androidx.fragment:fragment-testing:$fragmentVersion"
269279
}
270280

271281
task clearJar(type: Delete) {

opensrp-app/gradle.properties

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
POM_SETTING_NAME=OpenSRP Client Core
22
POM_SETTING_ARTIFACT_ID=opensrp-client-core
3-
POM_SETTING_PACKAGING=aar
3+
POM_SETTING_PACKAGING=aar
4+
5+
android.useAndroidX=true
6+
android.enableJetifier=true
7+
android.jetifier.blacklist=shadows

opensrp-app/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

opensrp-app/res/layout/activity_base_profile.xml

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
77
tools:context=".view.activity.BaseProfileActivity">
88

9-
<android.support.design.widget.AppBarLayout
9+
<com.google.android.material.appbar.AppBarLayout
1010
android:id="@+id/collapsing_toolbar_appbarlayout"
1111
android:layout_width="match_parent"
1212
android:layout_height="wrap_content"
1313
android:background="@color/customAppThemeBlue">
1414

15-
<android.support.design.widget.CollapsingToolbarLayout
15+
<com.google.android.material.appbar.CollapsingToolbarLayout
1616
android:id="@+id/collapsing_toolbar_layout"
1717
android:layout_width="match_parent"
1818
android:layout_height="match_parent"
@@ -122,16 +122,16 @@
122122
tools:text="Registration info" />
123123
</LinearLayout>
124124

125-
<android.support.v7.widget.Toolbar
125+
<androidx.appcompat.widget.Toolbar
126126
android:id="@+id/collapsing_toolbar"
127127
android:layout_width="match_parent"
128128
android:layout_height="?attr/actionBarSize"
129129
app:layout_collapseMode="pin" />
130130

131-
</android.support.design.widget.CollapsingToolbarLayout>
131+
</com.google.android.material.appbar.CollapsingToolbarLayout>
132132

133133

134-
<android.support.design.widget.TabLayout
134+
<com.google.android.material.tabs.TabLayout
135135
android:id="@+id/tabs"
136136
android:layout_width="fill_parent"
137137
android:layout_height="wrap_content"
@@ -143,8 +143,8 @@
143143
app:tabSelectedTextColor="@color/white"
144144
app:tabTextAppearance="@style/CustomFontTextViewStyle.tabIndicator.sub.white" />
145145

146-
</android.support.design.widget.AppBarLayout>
146+
</com.google.android.material.appbar.AppBarLayout>
147147

148148
<include layout="@layout/content_base_profile" />
149149

150-
</android.support.design.widget.CoordinatorLayout>
150+
</androidx.coordinatorlayout.widget.CoordinatorLayout>

opensrp-app/res/layout/activity_base_register.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
android:layout_width="match_parent"
1212
android:layout_height="match_parent" />
1313

14-
<android.support.design.widget.BottomNavigationView
14+
<com.google.android.material.bottomnavigation.BottomNavigationView
1515
android:id="@+id/bottom_navigation"
1616
android:layout_width="match_parent"
1717
android:layout_height="wrap_content"
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
@@ -8,11 +8,11 @@
88
tools:context=".view.activity.BaseProfileActivity"
99
tools:showIn="@layout/activity_base_register">
1010

11-
<android.support.v4.view.ViewPager
11+
<androidx.viewpager.widget.ViewPager
1212
android:id="@+id/viewpager"
1313
android:layout_width="match_parent"
1414
android:layout_height="match_parent"
1515
android:textAlignment="center"
1616
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
1717

18-
</android.support.constraint.ConstraintLayout>
18+
</androidx.constraintlayout.widget.ConstraintLayout>

opensrp-app/res/layout/dialog_reset_progress.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
android:layout_width="match_parent"
44
android:layout_height="match_parent"
55
xmlns:tools="http://schemas.android.com/tools"
@@ -16,4 +16,4 @@
1616
android:textSize="16sp"
1717
android:layout_height="wrap_content"/>
1818

19-
</android.support.constraint.ConstraintLayout>
19+
</androidx.constraintlayout.widget.ConstraintLayout>

opensrp-app/res/layout/fragment_base_register.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
android:layout_weight="1"
3434
android:background="@drawable/listview_background_rounded">
3535

36-
<android.support.v7.widget.RecyclerView
36+
<androidx.recyclerview.widget.RecyclerView
3737
android:id="@+id/recycler_view"
3838
android:layout_width="match_parent"
3939
android:layout_height="match_parent"

opensrp-app/res/layout/smart_register_rv_activity.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
android:layout_weight="1"
5050
android:background="@drawable/listview_background_rounded">
5151

52-
<android.support.v7.widget.RecyclerView
52+
<androidx.recyclerview.widget.RecyclerView
5353
android:id="@+id/recycler_view"
5454
android:layout_width="fill_parent"
5555
android:layout_height="fill_parent"

opensrp-app/res/layout/toolbar_barcode_scan.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
android:layout_height="wrap_content"
77
android:orientation="horizontal">
88

9-
<android.support.design.widget.AppBarLayout
9+
<com.google.android.material.appbar.AppBarLayout
1010
android:layout_width="match_parent"
1111
android:layout_height="wrap_content"
1212
android:theme="@style/AppTheme.AppBarOverlay">
1313

14-
<android.support.v7.widget.Toolbar
14+
<androidx.appcompat.widget.Toolbar
1515
android:id="@+id/barcode_toolbar"
1616
android:layout_width="match_parent"
1717
android:layout_height="?attr/actionBarSize"
@@ -38,8 +38,8 @@
3838

3939
</RelativeLayout>
4040

41-
</android.support.v7.widget.Toolbar>
41+
</androidx.appcompat.widget.Toolbar>
4242

43-
</android.support.design.widget.AppBarLayout>
43+
</com.google.android.material.appbar.AppBarLayout>
4444

4545
</LinearLayout>

opensrp-app/res/layout/toolbar_base_register.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
android:layout_height="wrap_content"
77
android:orientation="horizontal">
88

9-
<android.support.design.widget.AppBarLayout
9+
<com.google.android.material.appbar.AppBarLayout
1010
android:layout_width="match_parent"
1111
android:layout_height="wrap_content"
1212
app:popupTheme="@style/AppTheme.PopupOverlay"
1313
android:theme="@style/AppTheme.AppBarOverlay">
1414

15-
<android.support.v7.widget.Toolbar
15+
<androidx.appcompat.widget.Toolbar
1616
android:id="@+id/register_toolbar"
1717
android:layout_width="match_parent"
1818
android:layout_height="?attr/actionBarSize"
@@ -23,8 +23,8 @@
2323
app:popupTheme="@style/AppTheme.PopupOverlay">
2424

2525
<include layout="@layout/top_base_register_bar" />
26-
</android.support.v7.widget.Toolbar>
26+
</androidx.appcompat.widget.Toolbar>
2727

28-
</android.support.design.widget.AppBarLayout>
28+
</com.google.android.material.appbar.AppBarLayout>
2929

3030
</LinearLayout>

opensrp-app/src/main/java/atv/holder/SelectableItemHolder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
5656
view.findViewById(R.id.bot_line).setVisibility(View.INVISIBLE);
5757
if (node.isLeaf()) {
5858
((PrintView) view.findViewById(R.id.arrowview))
59-
.setIconText(R.string.ic_check_circle_blank);
59+
.setIconText(view.getContext().getString(R.string.ic_check_circle_blank));
6060
}
6161
// if(node.isFirstChild()){
6262
// view.findViewById(R.id.top_line).setVisibility(View.INVISIBLE);

0 commit comments

Comments
 (0)