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

Sync Statistics View #812

Merged
merged 25 commits into from
Aug 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
152c56a
Remove bintray repository
qiarie Jul 6, 2021
32d6fd1
Add database download implementation
qiarie Jul 6, 2021
91bf0c3
Add database download feature to sample app
qiarie Jul 6, 2021
4fde497
Add unit tests
qiarie Jul 6, 2021
d799d3a
Add database download
qiarie Jul 7, 2021
ec7f08f
Bump up version
qiarie Jul 7, 2021
1f7163b
Remove bintray repository
qiarie Jul 6, 2021
bc41025
Add database download implementation
qiarie Jul 6, 2021
3c28a91
Add database download feature to sample app
qiarie Jul 6, 2021
ece94e0
Add unit tests
qiarie Jul 6, 2021
b6fd306
Add database download
qiarie Jul 7, 2021
413c6a8
Bump up version
qiarie Jul 7, 2021
ff83523
Merge branch '811-sync-statistics-view' of github.com:opensrp/opensrp…
allan-on Aug 4, 2021
8c0c57e
:construction: Implement HealthStatsView in BaseRegisterAct
allan-on Aug 4, 2021
f23e479
:recycle: Remove Unnecessary use of fully qualified name
allan-on Aug 10, 2021
468d1c1
:white_check_mark: Cast invokeMethod args to Object
allan-on Aug 10, 2021
dd55f49
:white_check_mark: Add start StatsActivity test
allan-on Aug 10, 2021
4591e9c
:white_check_mark: Add Stats fragment tests
allan-on Aug 10, 2021
d5eaad3
:white_check_mark: Remove Unnecessary use of fully qualified name
allan-on Aug 10, 2021
43a74fa
:white_check_mark: Add refreshECSyncInfo test
allan-on Aug 10, 2021
97eefc2
:white_check_mark: Add StatsActivity tests
allan-on Aug 10, 2021
c1d2e37
:camera_flash: Update snapshot version
allan-on Aug 11, 2021
6095de1
Add username to downloaded database filename
qiarie Aug 12, 2021
94f48c7
Fix unit test
qiarie Aug 12, 2021
eb2e166
Fix codacy issue
qiarie Aug 12, 2021
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
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ subprojects {
maven {
url "https://s3.amazonaws.com/repo.commonsware.com"
}
maven { url "https://dl.bintray.com/ibm-watson-health/ibm-fhir-server-releases"}
mavenLocal()
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=4.3.15-SNAPSHOT
VERSION_NAME=4.3.16-SNAPSHOT
VERSION_CODE=1
GROUP=org.smartregister
POM_SETTING_DESCRIPTION=OpenSRP Client Core Application
Expand Down
9 changes: 8 additions & 1 deletion opensrp-app/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
<application
android:clearTaskOnLaunch="true"
android:label="@string/app_name"
android:largeHeap="true">
android:largeHeap="true"
android:requestLegacyExternalStorage="true">
<service
android:name=".service.ImageUploadSyncService"
android:description="@string/component_desc_image_upload_service"
Expand Down Expand Up @@ -117,6 +118,12 @@
android:launchMode="singleTask"
android:screenOrientation="portrait" />

<activity
android:name=".view.activity.StatsActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/AppThemeNoActionBarAndTitle" />

<receiver
android:name=".view.receiver.SyncBroadcastReceiver"
android:exported="false" />
Expand Down
43 changes: 43 additions & 0 deletions opensrp-app/res/layout/activity_stats.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".view.StatsActivity">

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/toolbar_appbarlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/customAppThemeBlue">

<androidx.appcompat.widget.Toolbar
android:id="@+id/summary_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/customAppThemeBlue"
android:theme="@style/AppTheme.AppBarOverlay"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp">

<org.smartregister.view.customcontrols.CustomFontTextView
android:id="@+id/toolbar_title"
style="@style/CustomFontTextViewStyle.ClientList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="0dp"
android:paddingEnd="0dp"
android:textColor="@color/white"
android:textSize="@dimen/register_member_title_size" />

</androidx.appcompat.widget.Toolbar>

</com.google.android.material.appbar.AppBarLayout>

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

</androidx.coordinatorlayout.widget.CoordinatorLayout>
204 changes: 204 additions & 0 deletions opensrp-app/res/layout/fragment_stats.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:id="@+id/summary_forms_group"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginTop="50dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:visibility="visible">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:textStyle="bold"
android:text="@string/synced_events"/>

<TextView
android:id="@+id/synced_events"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:text=""/>

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:textStyle="bold"
android:text="@string/unsynced_events"/>

<TextView
android:id="@+id/unsynced_events"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:text=""/>

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:textStyle="bold"
android:text="@string/task_unprocessed_events"/>

<TextView
android:id="@+id/task_unprocessed_events"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:text=""/>

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:orientation="horizontal"
android:weightSum="2">

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:textStyle="bold"
android:text="@string/synced_clients"/>

<TextView
android:id="@+id/synced_clients"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:text=""/>

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:textStyle="bold"
android:text="@string/unsynced_clients"/>

<TextView
android:id="@+id/unsynced_clients"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:text=""/>

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="30dp"
android:weightSum="2">

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:textStyle="bold"
android:text="@string/validated_events"/>

<TextView
android:id="@+id/validated_events"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:text=""/>

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:textStyle="bold"
android:text="@string/validated_clients"/>

<TextView
android:id="@+id/validated_clients"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:text=""/>

</LinearLayout>

<Button
android:id="@+id/refresh_button"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center_horizontal|center_vertical"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:text="@string/refresh"
android:textAllCaps="false"
android:textColor="@color/text_black"
android:textSize="20sp" />

</LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
1 change: 1 addition & 0 deletions opensrp-app/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,5 @@
<dimen name="profile_btn_registration_info_padding">24dp</dimen>
<dimen name="profile_dot_separator_margin">10dp</dimen>

<dimen name="register_member_title_size">17sp</dimen>
</resources>
17 changes: 17 additions & 0 deletions opensrp-app/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -439,4 +439,21 @@
<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>
<string name="no_client_available_for_url">No auth client available for the URL</string>

<!-- Sync Statistics View -->
<string name="download_database">Download Database</string>
<string name="view_sync_stats">Show Sync Stats</string>
<string name="export_db_notification">Exporting Database…</string>
<string name="database_download_success">Database download successful</string>
<string name="synced_events">Synced events:</string>
<string name="unsynced_events">Unsynced events:</string>
<string name="synced_clients">Synced clients:</string>
<string name="unsynced_clients">Unsynced clients:</string>
<string name="validated_events">Validated events:</string>
<string name="validated_clients">Validated clients:</string>
<string name="task_unprocessed_events">Task unprocessed events:</string>
<string name="refresh">Refresh</string>
<string name="return_to_register">Return</string>
<string name="summary_forms">Other Forms</string>
<string name="permission_write_external_storage_rationale">Write access to the device internal storage is required for database download.</string>
</resources>
18 changes: 17 additions & 1 deletion opensrp-app/src/main/java/org/smartregister/AllConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -580,5 +580,21 @@ public interface ClientProcessing {

}


public interface DatabaseKeys {
String SYNC_STATUS = "syncStatus";
String VALIDATION_STATUS = "validationStatus";
}

public interface SyncInfo {
String SYNCED_EVENTS = "syncedEvents";
String SYNCED_CLIENTS = "syncedClients";
String UNSYNCED_EVENTS = "unsyncedEvents";
String UNSYNCED_CLIENTS = "unsyncedClients";
String VALID_EVENTS = "validEvents";
String INVALID_EVENTS = "invalidEvents";
String VALID_CLIENTS = "validClients";
String INVALID_CLIENTS = "INValidClients";
String TASK_UNPROCESSED_EVENTS = "taskUnprocessedEvents";
String NULL_EVENT_SYNC_STATUS = "nullEventSyncStatus";
}
}
Loading