Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize native forms v2 #522

Open
wants to merge 35 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
30df989
make number of contacts schedule displayed on summary configurable
bennsimon Apr 6, 2020
a500ed1
fix null GA
bennsimon Apr 8, 2020
45d6334
updated code to tests native forms performance improvement
bennsimon Apr 9, 2020
3063c0e
code cleanup
bennsimon Apr 12, 2020
2537fe1
fix gibberish text and crash in ct
bennsimon Apr 12, 2020
7deff81
update to local snapshot
bennsimon May 14, 2020
f430666
update code with latest optimization code
bennsimon May 21, 2020
0c8f1b6
update popStack
bennsimon May 29, 2020
dd5c4c3
add contact sequencing logic
bennsimon Jun 24, 2020
bdc4954
remove due check strategy config
bennsimon Jun 24, 2020
b72675e
make anc profile activity configurable
bennsimon Jun 24, 2020
3f54903
update snapshot version
bennsimon Jun 25, 2020
8c27ed4
Merge branch 'develop' of github.com:OpenSRP/opensrp-client-anc into …
bennsimon Jun 25, 2020
aa26c46
remove unneeded column
bennsimon Jun 25, 2020
7e088f6
update null check for event details
bennsimon Jun 26, 2020
1055065
fix next contact update
bennsimon Jun 29, 2020
d37270c
update/fix tests
bennsimon Jun 29, 2020
1f300bf
added tests
bennsimon Jun 29, 2020
30c223b
fix tests
bennsimon Jul 1, 2020
5932f3d
update opensrp url to anc
bennsimon Jul 14, 2020
645a680
add anc maternity transfer logic
bennsimon Jul 23, 2020
af330b4
update anc maternity transfer logic
bennsimon Jul 23, 2020
b6ef73d
update logic sor AncMaternityTransferProcessor
bennsimon Jul 23, 2020
4c5b152
update anc death processing & transfer processor
bennsimon Aug 20, 2020
918e77a
code cleanup
bennsimon Sep 2, 2020
c1b7010
fix tests
bennsimon Sep 2, 2020
0c2fb1b
add tests
bennsimon Sep 2, 2020
a6aac1d
fix codacy issue
bennsimon Sep 2, 2020
806543f
fix tests
bennsimon Sep 3, 2020
7496074
remove update of key in repeating grp
bennsimon Sep 4, 2020
0189abf
add test
bennsimon Sep 8, 2020
48b73d0
migrate to latest core
bennsimon Sep 8, 2020
96ae2c5
add 41 weeks limit
bennsimon Sep 11, 2020
1bfa21e
Merge pull request #540 from opensrp/migrate-to-oauth2
dubdabasoduba May 20, 2022
aaf0e65
Fix next page fragment being transacted from diskIO
ekigamba Mar 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'
classpath 'com.palantir:jacoco-coverage:0.4.0'
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.11.0"
Expand All @@ -21,7 +21,6 @@ buildscript {
}
}

apply plugin: 'com.palantir.jacoco-full-report'
apply plugin: 'com.github.kt3k.coveralls'

configure(allprojects) { project ->
Expand Down Expand Up @@ -85,9 +84,9 @@ task clean(type: Delete) {
delete rootProject.buildDir
}

jacocoFull {
excludeProject ":sample", ":opensrp-client-anc"
}
//jacocoFull {
// excludeProject ":sample", ":opensrp-client-anc"
//}

coveralls {
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoFullReport/jacocoFullReport.xml"
Expand Down
12 changes: 8 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
org.gradle.jvmargs=-Xmx1536m

android.debug.obsoleteApi=true

## PUBLISHING VARS
VERSION_NAME=2.0.1-SNAPSHOT
VERSION_NAME=2.0.3.40-LOCAL-SNAPSHOT
VERSION_CODE=1
GROUP=org.smartregister
POM_SETTING_DESCRIPTION=OpenSRP Client ANC Library
Expand All @@ -24,6 +26,8 @@ POM_SETTING_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_SETTING_LICENCE_DIST=repo
POM_SETTING_DEVELOPER_ID=opensrp
POM_SETTING_DEVELOPER_NAME=OpenSRP Onadev
android.enableUnitTestBinaryResources=true
android.enableSeparateAnnotationProcessing=true
android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true
#android.enableUnitTestBinaryResources=true
#android.enableSeparateAnnotationProcessing=true
android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true
android.useAndroidX=true
android.enableJetifier=true
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Nov 21 15:37:28 EAT 2019
#Tue Sep 08 12:33:01 EAT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
76 changes: 32 additions & 44 deletions opensrp-anc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.3'
classpath 'com.google.gms:google-services:4.3.3'
}
Expand Down Expand Up @@ -58,14 +58,15 @@ android {
versionCode 1
versionName "1.2.11"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

if (properties != null && properties.containsKey("store.file") && properties.containsKey("store.password") && properties.containsKey("key.password")) {
signingConfig signingConfigs.release
}

javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = true
arguments = [eventBusIndex: 'org.smartregister.anc.library.ANCEventBusIndex']
}
}
Expand Down Expand Up @@ -95,31 +96,8 @@ android {
}

packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude 'LICENSE.txt'

}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE.md'
exclude 'META-INF/NOTICE.md'
}

testOptions {
Expand All @@ -142,8 +120,8 @@ dependencies {
def powerMockVersion = '2.0.4'

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation('org.smartregister:opensrp-client-native-form:1.7.28-SNAPSHOT@aar') {
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation('org.smartregister:opensrp-client-native-form:2.0.0-PREVIEW-SNAPSHOT@aar') {
transitive = true
exclude group: 'com.android.support', module: 'recyclerview-v7'
exclude group: 'com.android.support', module: 'appcompat-v7'
Expand All @@ -154,7 +132,7 @@ dependencies {
exclude group: 'org.yaml', module: 'snakeyaml'
exclude group: 'io.ona.rdt-capture', module: 'lib'
}
implementation('org.smartregister:opensrp-client-core:1.9.4-SNAPSHOT@aar') {
implementation('org.smartregister:opensrp-client-core:2.0.8-SNAPSHOT@aar') {
transitive = true
exclude group: 'com.github.bmelnychuk', module: 'atv'
exclude group: 'com.google.guava', module: 'guava'
Expand Down Expand Up @@ -192,17 +170,17 @@ dependencies {
// explicitly depend on RxJava's latest version for bug fixes and new features.
implementation 'io.reactivex.rxjava2:rxjava:2.2.15'
implementation 'com.evernote:android-job:1.2.6'
implementation 'com.github.lecho:hellocharts-android:v1.5.8'
implementation 'id.zelory:compressor:2.1.0'
implementation('com.android.support:design:28.0.0') {
implementation 'com.github.lecho:hellocharts-android:1.5.8'
implementation 'id.zelory:compressor:2.1.1'
implementation('com.google.android.material:material:1.0.0') {
exclude group: 'com.android.support', module: 'recyclerview-v7'
exclude group: 'com.android.support', module: 'cardview-v7'
}

implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation group: 'org.yaml', name: 'snakeyaml', version: '1.25'
implementation 'de.hdodenhof:circleimageview:3.0.1'
implementation 'org.jeasy:easy-rules-core:3.3.0'
Expand All @@ -215,7 +193,7 @@ dependencies {
}
testImplementation 'org.robolectric:robolectric:4.3.1'
testImplementation 'org.robolectric:shadows-multidex:4.3.1'
testImplementation 'org.robolectric:shadows-support-v4:3.4-rc2'
// testImplementation 'org.robolectric:shadows-support-v4:3.4-rc2'
testImplementation "org.powermock:powermock-module-junit4:$powerMockVersion"
testImplementation "org.powermock:powermock-module-junit4-rule:$powerMockVersion"
testImplementation "org.powermock:powermock-api-mockito2:$powerMockVersion"
Expand All @@ -224,13 +202,14 @@ dependencies {
testImplementation 'org.apache.maven:maven-ant-tasks:2.1.3'
testImplementation 'org.skyscreamer:jsonassert:1.5.0'

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') {
exclude group: 'com.google.code.findbugs'
}
}

task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) {

reports {
xml.enabled = true
html.enabled = true
Expand All @@ -240,14 +219,23 @@ task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'crea
getReports().getHtml().setDestination(file("${buildDir}/reports/jacoco/jacocoRootReport/html"))

def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*', '**/*$ViewBinder*.*']
def debugTree = fileTree(dir: "$project.buildDir/intermediates/javac/debug/classes/", excludes: fileFilter)
def debugTree = fileTree(dir: "$project.buildDir/intermediates/javac/debug/classes", excludes: fileFilter)
def mainSrc = "$project.projectDir/src/main/java"

sourceDirectories = files([mainSrc])
classDirectories = files([debugTree])
executionData = fileTree(dir: project.buildDir, includes: [
sourceDirectories.setFrom(files([mainSrc]))
classDirectories.setFrom(([debugTree]))
executionData.setFrom(fileTree(dir: project.buildDir, includes: [
'jacoco/testDebugUnitTest.exec', 'outputs/code-coverage/connected/*coverage.ec'
])
]))
}

//coveralls {
// jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/merged.xml"
// sourceDirs = ["$project.projectDir/src/main/java"]
//}

coveralls {
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/merged.xml"
}

task printTasks {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.smartregister.anc.library;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.google.gson.Gson;
import com.vijay.jsonwizard.constants.JsonFormConstants;
Expand All @@ -25,6 +25,7 @@
import org.smartregister.anc.library.repository.PreviousContactRepository;
import org.smartregister.anc.library.repository.RegisterQueryProvider;
import org.smartregister.anc.library.util.AncMetadata;
import org.smartregister.anc.library.util.AppExecutors;
import org.smartregister.anc.library.util.ConstantsUtils;
import org.smartregister.anc.library.util.FilePathUtils;
import org.smartregister.configurableviews.helper.JsonSpecHelper;
Expand Down Expand Up @@ -70,6 +71,7 @@ public class AncLibrary {
private int databaseVersion;
private ActivityConfiguration activityConfiguration;
private AncMetadata ancMetadata = new AncMetadata();
private AppExecutors appExecutors;


private AncLibrary(@NonNull Context context, int dbVersion, @NonNull ActivityConfiguration activityConfiguration, @Nullable SubscriberInfoIndex subscriberInfoIndex, @Nullable RegisterQueryProvider registerQueryProvider) {
Expand Down Expand Up @@ -344,4 +346,11 @@ public void setRegisterQueryProvider(RegisterQueryProvider registerQueryProvider
public AncMetadata getAncMetadata() {
return ancMetadata;
}

public AppExecutors getAppExecutors() {
if (appExecutors == null) {
appExecutors = new AppExecutors();
}
return appExecutors;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.smartregister.anc.library.activity;

import android.app.Activity;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

/**
* Created by Ephraim Kigamba - [email protected] on 2019-07-17
Expand All @@ -12,12 +12,14 @@ public class ActivityConfiguration {
private Class<? extends BaseHomeRegisterActivity> homeRegisterActivityClass;
private Class<? extends Activity> landingPageActivityClass;
private Class<? extends Activity> mainContactActivityClass;
private Class<? extends Activity> profileActivityClass;


public ActivityConfiguration() {
setHomeRegisterActivityClass(BaseHomeRegisterActivity.class);
setLandingPageActivityClass(getHomeRegisterActivityClass());
setMainContactActivityClass(MainContactActivity.class);
setProfileActivityClass(ProfileActivity.class);
}

public Class<? extends BaseHomeRegisterActivity> getHomeRegisterActivityClass() {
Expand All @@ -43,4 +45,12 @@ public Class<? extends Activity> getMainContactActivityClass() {
public void setMainContactActivityClass(Class<? extends Activity> mainContactActivityClass) {
this.mainContactActivityClass = mainContactActivityClass;
}

public Class<? extends Activity> getProfileActivityClass() {
return profileActivityClass;
}

public void setProfileActivityClass(Class<? extends Activity> profileActivityClass) {
this.profileActivityClass = profileActivityClass;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;

import org.smartregister.anc.library.AncLibrary;
import org.smartregister.anc.library.R;
import org.smartregister.anc.library.contract.SiteCharacteristicsContract;
import org.smartregister.anc.library.util.ConstantsUtils;
import org.smartregister.anc.library.util.ANCJsonFormUtils;
import org.smartregister.anc.library.util.ConstantsUtils;

import java.util.Map;

Expand All @@ -33,7 +33,6 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == ANCJsonFormUtils.REQUEST_CODE_GET_JSON && resultCode == RESULT_OK) {
try {
String jsonString = data.getStringExtra("json");
Timber.d("JSONResult %s", jsonString);
presenter.saveSiteCharacteristics(jsonString);
} catch (Exception e) {
Timber.e(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.Toolbar;
import android.util.TypedValue;
import android.view.View;
import android.widget.TextView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import android.app.AlertDialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
Expand Down
Loading