Skip to content

Commit

Permalink
Merge pull request #515 from OpenSRP/issue283
Browse files Browse the repository at this point in the history
Issue283
  • Loading branch information
ndegwamartin authored Sep 1, 2020
2 parents b140a92 + f5df6c4 commit ae8f7ba
Show file tree
Hide file tree
Showing 109 changed files with 5,265 additions and 1,750 deletions.
6 changes: 6 additions & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
engines:
duplication:
exclude_paths:
- '**/test/**'
- '**/androidTest/**'

6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ before_install:
- mkdir -p $HOME/.android && touch $HOME/.android/repositories.cfg
install:
# accept licenses for all available packages that have not already been accepted
- yes | sdkmanager "platforms;android-28"
- yes | sdkmanager "platforms;android-27"
- yes | sdkmanager --licenses >/dev/null
- yes | sdkmanager "platforms;android-28"
- yes | sdkmanager "platforms;android-27"
before_script:
- echo "Travis branch is $TRAVIS_BRANCH"
- echo "Travis branch is in pull request $TRAVIS_PULL+REQUEST"
Expand Down Expand Up @@ -70,4 +70,4 @@ deploy:
provider: script
script: ./gradlew :opensrp-app:uploadArchives -PmavenLocal=false
on:
tags: true
tags: true
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ By placing a file named `app.properties` in your implementation assets folder (S

### Configurable Settings

| Configuration | Type | Default | Description |
| ----------------------------------- | ------- | ------- | ----------------------------------------------|
| `system.toaster.centered` | Boolean | false | Position toaster(s) at the center of the view(s) |
| `disable.location.picker.view` | Boolean | false | Disables LocationPicker View |
| Configuration | Type | Default | Description |
| ----------------------------------- | ------- | -------- | -------------------------------------------------------------------------|
| `system.toaster.centered` | Boolean | false | Position toaster(s) at the center of the view(s) |
| `disable.location.picker.view` | Boolean | false | Disables LocationPicker View |
| `location.picker.tag.shown` | Boolean | false | Hides/Shows the location tag in the location picker tree view |
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=1.15.5.0-SNAPSHOT
VERSION_NAME=2.0.6-SNAPSHOT
VERSION_CODE=1
GROUP=org.smartregister
POM_SETTING_DESCRIPTION=OpenSRP Client Core Application
Expand All @@ -12,5 +12,4 @@ POM_SETTING_LICENCE_DIST=repo
POM_SETTING_DEVELOPER_ID=opensrp
POM_SETTING_DEVELOPER_NAME=OpenSRP Onadev


org.gradle.jvmargs=-Xmx2048m
106 changes: 77 additions & 29 deletions opensrp-app/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,108 +1,156 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.smartregister"
android:installLocation="auto"
android:versionCode="32"
android:versionName="3.0.1"
android:installLocation="auto">
android:versionName="3.0.1">

<uses-feature android:name="android.hardware.camera.autofocus" />

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission
android:name="android.permission.GET_ACCOUNTS"
android:maxSdkVersion="22" />

<uses-feature
android:name="android.hardware.camera"
android:required="false" />

<application
android:label="@string/app_name"
android:clearTaskOnLaunch="true"
android:label="@string/app_name"
android:largeHeap="true">
<service
android:name=".service.ImageUploadSyncService"
android:description="@string/component_desc_image_upload_service"
android:enabled="true"
android:name=".service.ImageUploadSyncService" />
android:exported="false" />

<service
android:name=".account.AccountService"
android:description="@string/component_desc_account_service"
android:exported="false">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data
android:name="android.accounts.AccountAuthenticator"
android:resource="@xml/authenticator" />
</service>

<activity
android:name=".view.activity.ReportsActivity"
android:theme="@style/AppThemeNoTitle"
android:screenOrientation="landscape" />
android:exported="false"
android:screenOrientation="landscape"
android:theme="@style/AppThemeNoTitle" />
<activity
android:name=".view.activity.VideosActivity"
android:theme="@style/AppThemeNoTitle"
android:screenOrientation="landscape" />
android:exported="false"
android:screenOrientation="landscape"
android:theme="@style/AppThemeNoTitle" />
<activity
android:name=".view.activity.ReportIndicatorListViewActivity"
android:theme="@style/AppThemeNoTitle"
android:screenOrientation="landscape" />
android:exported="false"
android:screenOrientation="landscape"
android:theme="@style/AppThemeNoTitle" />
<activity
android:name=".view.activity.ReportIndicatorDetailActivity"
android:theme="@style/AppThemeNoTitle"
android:screenOrientation="landscape" />
android:exported="false"
android:screenOrientation="landscape"
android:theme="@style/AppThemeNoTitle" />
<activity
android:name=".view.activity.ReportIndicatorCaseListActivity"
android:theme="@style/AppThemeNoTitle"
android:screenOrientation="landscape" />
android:exported="false"
android:screenOrientation="landscape"
android:theme="@style/AppThemeNoTitle" />
<activity
android:name=".view.activity.EligibleCoupleDetailActivity"
android:theme="@style/AppThemeNoTitle"
android:screenOrientation="landscape" />
android:exported="false"
android:screenOrientation="landscape"
android:theme="@style/AppThemeNoTitle" />
<activity
android:name=".view.activity.CameraLaunchActivity"
android:theme="@android:style/Theme.Holo.NoActionBar"
android:screenOrientation="landscape" />
android:exported="false"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.Holo.NoActionBar" />
<activity
android:name=".view.activity.FormActivity"
android:theme="@style/AppThemeNoTitle"
android:screenOrientation="portrait" />
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/AppThemeNoTitle" />
<activity
android:name=".view.activity.MicroFormActivity"
android:theme="@android:style/Theme.Holo.Dialog.NoActionBar"
android:screenOrientation="landscape" />
android:exported="false"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.Holo.Dialog.NoActionBar" />
<activity
android:name=".view.activity.NativeECSmartRegisterActivity"
android:exported="false"
android:screenOrientation="landscape"
android:theme="@style/AppThemeNoTitle" />
<activity
android:name=".view.activity.BarcodeScanActivity"
android:configChanges="keyboardHidden|orientation"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name=".view.activity.NativeHomeActivity"
android:exported="false"
android:screenOrientation="landscape" />

<activity
android:name=".view.activity.SettingsActivity"
android:exported="false"
android:launchMode="singleTask"
android:screenOrientation="portrait" />

<receiver android:name=".view.receiver.SyncBroadcastReceiver" />
<receiver android:name=".view.receiver.ConnectivityChangeReceiver">
<receiver
android:name=".view.receiver.SyncBroadcastReceiver"
android:exported="false" />

<receiver
android:name=".view.receiver.ConnectivityChangeReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
</receiver>
<receiver android:name=".view.receiver.TimeChangedBroadcastReceiver">

<receiver
android:name=".view.receiver.TimeChangedBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.TIME_SET" />
<action android:name="android.intent.action.TIMEZONE_CHANGED" />
</intent-filter>
</receiver>

<service android:name=".service.intentservices.ReplicationIntentService" />
<service
android:name=".service.intentservices.ReplicationIntentService"
android:exported="false" />

<service android:name=".sync.intent.P2pProcessRecordsService"/>
<service
android:name=".sync.intent.P2pProcessRecordsService"
android:description="@string/component_desc_p2p_process_records_service"
android:exported="false" />

<meta-data
android:name="com.google.android.gms.vision.Dependencies"
android:value="barcode" />

<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />


</application>
Expand Down
25 changes: 22 additions & 3 deletions opensrp-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ android {
versionName project.VERSION_NAME
testInstrumentationRunner "android.test.InstrumentationTestRunner"
buildConfigField "long", "BUILD_TIMESTAMP", System.currentTimeMillis() + "L"
buildConfigField "int", "DB_ENCRYPTION_VERSION", '1'
}

sourceSets {
Expand Down Expand Up @@ -207,12 +208,30 @@ dependencies {

implementation 'org.smartregister:opensrp-plan-evaluator:0.1.0-SNAPSHOT'

implementation 'xerces:xercesImpl:2.12.0'
}
implementation('ch.acra:acra:4.5.0') {
exclude group: 'org.json', module: 'json'
}

dependencies {
implementation 'com.github.ybq:Android-SpinKit:1.2.0'
implementation 'com.mcxiaoke.volley:library:1.0.19'

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

implementation 'com.cloudant:cloudant-http:2.7.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'

implementation('com.android.support:design:28.0.0') {
exclude group: 'com.android.support', module: 'recyclerview-v7'
}

implementation 'com.evernote:android-job:1.2.6'
implementation group: 'commons-validator', name: 'commons-validator', version: '1.6'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'xerces:xercesImpl:2.12.0'

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

androidTestImplementation 'junit:junit:4.12'

testImplementation group: 'com.google.android', name: 'android-test', version: '4.1.1.4'
Expand Down
5 changes: 3 additions & 2 deletions opensrp-app/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
<string name="settings_logout_confirm_dialog_message">هل أنت متأكد أنك تريد تسجيل الخروج؟ سيتم مسح جميع البيانات</string>
<string name="unsynced_forms_count_message">استمارات غير متزامنة </string>

<string name="str_next">التالي &gt;&gt;</string>
<string name="str_previous">&gt;&gt;سابق</string>
<string name="str_next"> التالية&gt;&gt;</string>
<string name="str_previous">&gt;&gt;السابقة </string>
<string name="str_page_info">صفحة {0} من {1}</string>

<string name="header_name">الاسم</string>
Expand Down Expand Up @@ -415,4 +415,5 @@
<string name="x_years_months">%1$dس
%2$dش</string>

<string name="account_removed">لقد تم تسجيل خروجك لأنه تم حذف حسابك من مدير الحساب</string>
</resources>
5 changes: 3 additions & 2 deletions opensrp-app/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
<string name="settings_logout_confirm_dialog_message">Êtes-vous certain de vouloir se déconnecter? Tous les données seront effacées.</string>
<string name="unsynced_forms_count_message">Formulaires non-synchronisés</string>

<string name="str_next">Prochain &gt;&gt;</string>
<string name="str_previous">&lt;&lt; Dernier</string>
<string name="str_next">Suivante &gt;&gt;</string>
<string name="str_previous">&lt;&lt; Précédente</string>
<string name="str_page_info">Page {0} de {1}</string>

<string name="header_name">Nom</string>
Expand Down Expand Up @@ -412,5 +412,6 @@
<string name="msg_empty_url">l\'addresse URL ne peut pas être vide.</string>
<string name="sync_failed_malformed_url">Synchronisation échouée. Vérifier configuration URL.</string>
<string name="sync_failed_timeout_error">Synchronisation échouée. Impossible de connecter au serveur.</string>
<string name="account_removed">Vous avez été déconnecté car votre compte a été supprimé du gestionnaire de compte.</string>

</resources>
16 changes: 13 additions & 3 deletions opensrp-app/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
<string name="settings_logout_confirm_dialog_message">Are you sure you want to log out? All the data will be cleared.</string>
<string name="unsynced_forms_count_message">Forms Unsynced</string>

<string name="str_next">"Next &gt;&gt;"</string>
<string name="str_previous">"&lt;&lt; Previous"</string>
<string name="str_next">Next &gt;&gt;</string>
<string name="str_previous">&lt;&lt; Previous</string>
<string name="str_page_info">Page {0} of {1}</string>

<string name="header_name">NAME</string>
Expand Down Expand Up @@ -425,5 +425,15 @@
<string name="clear_data_dialog_title">Do you want to clear data to login with a different team/location</string>
<string name="clear_data_dialog_message">You are trying to login with a user in a different team/location. Upload of pending data and clearing of data for user %s in Team %s is required. Do you want to continue?</string>
<string name="replication_error_occurred">Replication error occurred</string>

<string name="form_update_title">Form Update</string>
<string name="form_update_message">This form has content updates</string>
<string name="current_corrupted_form">(Current Corrupted Form)</string>
<string name="rollback_dialog_title">Select a rollback form</string>
<string name="cannot_select_corrupted_form_rollback">You cannot select this form because it\'s corrupted!</string>
<string name="form_changed_reopen_to_take_effect">Form has been successfully selected! Reopen this form for the changes to take effect</string>
<string name="component_desc_image_upload_service">Uploads images to the OpenSRP server</string>
<string name="component_desc_account_service"> Manages user authentication and authorization</string>
<string name="component_desc_p2p_process_records_service">Processes the records when using peer to peer for file sharing</string>
<string name="new_db_encryption_version_migration">You have been logged off as your application database encryption version has changed. Please login in again to complete the upgrade.</string>
<string name="account_removed">You have been logged off as your account has been removed from the accounts manager.</string>
</resources>
7 changes: 7 additions & 0 deletions opensrp-app/res/xml/authenticator.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
android:accountType="org.smartregister.core"
android:icon="@drawable/opensrp_logo"
android:smallIcon="@drawable/opensrp_logo"
android:label="@string/app_name"
android:accountPreferences="@xml/preferences"/>
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,29 @@ public FakeUserService() {
}

@Override
public boolean isValidLocalLogin(String userName, String password) {
public boolean isValidLocalLogin(String userName, byte[] password) {
assertExpectedCredentials(userName, password);
actualCalls.add("local");
return shouldSucceedLocalLogin;
}

@Override
public LoginResponse isValidRemoteLogin(String userName, String password) {
public LoginResponse isValidRemoteLogin(String userName, char[] password) {
assertExpectedCredentials(userName, password);
actualCalls.add("remote");
return shouldSucceedRemoteLogin;
}

@Override
public void localLogin(String userName, String password) {
super.setupContextForLogin(userName, password);
public void localLogin(String userName, char[] password) {
super.setupContextForLogin(password);
actualCalls.add("login");
assertExpectedCredentials(userName, password);
}


public void remoteLogin(String userName, String password, String anmLocation) {
super.setupContextForLogin(userName, password);
public void remoteLogin(String userName, char[] password, String anmLocation) {
super.setupContextForLogin(password);
actualCalls.add("login");
assertExpectedCredentials(userName, password);
}
Expand All @@ -65,7 +65,7 @@ public void logoutSession() {
super.logoutSession();
}

private void assertExpectedCredentials(String userName, String password) {
private void assertExpectedCredentials(String userName, char[] password) {
if (!expectedUserName.equals(userName)) {
throw new RuntimeException("Expected user: " + expectedUserName + ". Actual: " + userName);
}
Expand Down
Loading

0 comments on commit ae8f7ba

Please sign in to comment.