diff --git a/README.md b/README.md index d361c7ad3..5b0ecf8bc 100644 --- a/README.md +++ b/README.md @@ -7,22 +7,22 @@ https://github.com/dhis2/dhis2-android-trackercapture/releases # Testing If you want to try the application out with a demo database, you can use the following: -- Server: https://apps.dhis2.org/demo +- Server: https://play.dhis2.org/demo - Username: android - Password: Android123 -# How to Download and Set up in Android Studio +# How to Download and Set up the development environment in Android Studio To successfully build and run this project, the dhis2-android-sdk is required. -The dhis2-android-sdk project https://github.com/dhis2/dhis2-android-sdk folder should be in a subfolder called named sdk inside dhis2-android-trackercapture. It is configured as a git submodule, so it will be automatically include when cloned using --recursive. +The dhis2-android-sdk project https://github.com/dhis2/dhis2-android-sdk folder should be in a subfolder named sdk inside dhis2-android-trackercapture. It is configured as a git submodule, so it will be automatically included when cloned using --recursive. -To be compatible with 2.25/2.26/2.27 & 2.28 servers, use 2.23-legacy branch in dhis2-android-trackercapture and tracker-capture branch in dhis2-android-sdk repositories. +Currently, the compatibility is guaranteed with 2.27, 2.28 and 2.29 servers, use develop branch in dhis2-android-trackercapture and tracker-capture branch in dhis2-android-sdk repositories. When cloning from zero, it's strongly recommended to do it as follows: ``` -git clone --recursive -b 2.23-legacy git@github.com:dhis2/dhis2-android-trackercapture.git +git clone --recursive -b develop git@github.com:dhis2/dhis2-android-trackercapture.git cd dhis2-android-trackercapture/sdk git checkout tracker-capture ``` diff --git a/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/enrollment/EnrollmentDataEntryFragmentQuery.java b/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/enrollment/EnrollmentDataEntryFragmentQuery.java index e82335245..2349e0624 100644 --- a/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/enrollment/EnrollmentDataEntryFragmentQuery.java +++ b/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/enrollment/EnrollmentDataEntryFragmentQuery.java @@ -113,12 +113,12 @@ public EnrollmentDataEntryFragmentForm query(Context context) { dataEntryRows.add( new EnrollmentDatePickerRow(currentEnrollment.getProgram().getEnrollmentDateLabel(), - currentEnrollment)); + currentEnrollment, true)); if (currentEnrollment.getProgram().getDisplayIncidentDate()) { dataEntryRows.add( new IncidentDatePickerRow(currentEnrollment.getProgram().getIncidentDateLabel(), - currentEnrollment)); + currentEnrollment, true)); } for (ProgramTrackedEntityAttribute ptea : programTrackedEntityAttributes) { diff --git a/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/enrollment/EnrollmentDataEntryRuleHelper.java b/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/enrollment/EnrollmentDataEntryRuleHelper.java index e1600d68c..477c83ea1 100644 --- a/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/enrollment/EnrollmentDataEntryRuleHelper.java +++ b/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/enrollment/EnrollmentDataEntryRuleHelper.java @@ -214,7 +214,7 @@ public void showWarningHiddenValuesDialog(Fragment fragment, ArrayList a .newInstance(fragment.getString(org.hisp.dhis.android.sdk.R.string.warning_hidefieldwithvalue), trackedEntityAttributeNames ); enrollmentDataEntryFragment.setValidationErrorDialog(validationErrorDialog); - if (fragment.isAdded()) { + if (fragment.isAdded() && fragment.isVisible()) { enrollmentDataEntryFragment.getValidationErrorDialog().show(fragment.getChildFragmentManager()); } } diff --git a/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/enrollmentdate/EnrollmentDateFragmentQuery.java b/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/enrollmentdate/EnrollmentDateFragmentQuery.java index fab11c23b..6ac1d0d1e 100644 --- a/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/enrollmentdate/EnrollmentDateFragmentQuery.java +++ b/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/enrollmentdate/EnrollmentDateFragmentQuery.java @@ -58,10 +58,10 @@ public EnrollmentDateFragmentForm query(Context context) { return fragmentForm; List dataEntryRows = new ArrayList<>(); - dataEntryRows.add(new EnrollmentDatePickerRow(enrollment.getProgram().getEnrollmentDateLabel(), enrollment)); + dataEntryRows.add(new EnrollmentDatePickerRow(enrollment.getProgram().getEnrollmentDateLabel(), enrollment, false)); if (enrollment.getProgram().getDisplayIncidentDate()) { - dataEntryRows.add(new IncidentDatePickerRow(enrollment.getProgram().getIncidentDateLabel(), enrollment)); + dataEntryRows.add(new IncidentDatePickerRow(enrollment.getProgram().getIncidentDateLabel(), enrollment, true)); } fragmentForm.setEnrollment(enrollment); diff --git a/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/programoverview/ProgramOverviewFragment.java b/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/programoverview/ProgramOverviewFragment.java index 3e870c5e4..aed572b91 100644 --- a/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/programoverview/ProgramOverviewFragment.java +++ b/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/programoverview/ProgramOverviewFragment.java @@ -186,6 +186,7 @@ public class ProgramOverviewFragment extends AbsProgramRuleFragment implements V private ImageButton followupButton; private ImageButton profileButton; private ImageView enrollmentServerStatus; + private TextView enrollmentServerStatusText; private Button completeButton; private Button reOpenButton; private Button terminateButton; @@ -306,6 +307,7 @@ public void onViewCreated(View view, Bundle savedInstanceState) { registerForContextMenu(listView); enrollmentServerStatus = (ImageView) header.findViewById(R.id.enrollmentstatus); + enrollmentServerStatusText = (TextView) header.findViewById(R.id.enrollmentstatus_text); enrollmentLayout = (LinearLayout) header.findViewById(R.id.enrollmentLayout); enrollmentDateLabel = (TextView) header.findViewById(R.id.dateOfEnrollmentLabel); enrollmentDateValue = (TextView) header.findViewById(R.id.dateOfEnrollmentValue); @@ -565,10 +567,13 @@ public void onLoadFinished(Loader loader, if (failedItem != null && failedItem.getHttpStatusCode() >= 0) { enrollmentServerStatus.setImageResource(R.drawable.ic_event_error); + enrollmentServerStatusText.setText(R.string.event_error); } else if (!mForm.getEnrollment().isFromServer()) { enrollmentServerStatus.setImageResource(R.drawable.ic_legacy_offline); + enrollmentServerStatusText.setText(R.string.event_offline); } else { enrollmentServerStatus.setImageResource(R.drawable.ic_from_server); + enrollmentServerStatusText.setText(R.string.event_sent); } refreshRelationshipButton.setEnabled(mForm.getEnrollment().isFromServer()); @@ -598,10 +603,12 @@ public void onLoadFinished(Loader loader, } final Map failedEvents = getFailedEvents(); - for (IndicatorRow indicatorRow : mForm.getProgramIndicatorRows().values()) { View view = indicatorRow.getView(getChildFragmentManager(), getLayoutInflater(getArguments()), null, programIndicatorLayout); + if(indicatorRow.getIndicator().isDisplayInForm()){ + programIndicatorCardView.setVisibility(View.VISIBLE); + } programIndicatorLayout.addView(view); } @@ -672,6 +679,7 @@ private void initializeEventsViews(LinearLayout programEventsLayout) { } private void initializeIndicatorViews(LinearLayout programIndicatorLayout) { + programIndicatorCardView.setVisibility(View.GONE); programIndicatorLayout.removeAllViews(); FlowLayout keyValueLayout = (FlowLayout) programIndicatorCardView.findViewById( R.id.keyvaluelayout); diff --git a/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/trackedentityinstance/TrackedEntityInstanceDataEntryRuleHelper.java b/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/trackedentityinstance/TrackedEntityInstanceDataEntryRuleHelper.java index 4fd61c432..ceafc96e5 100644 --- a/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/trackedentityinstance/TrackedEntityInstanceDataEntryRuleHelper.java +++ b/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/trackedentityinstance/TrackedEntityInstanceDataEntryRuleHelper.java @@ -214,7 +214,7 @@ public void showWarningHiddenValuesDialog(Fragment fragment, ArrayList a .newInstance(fragment.getString(org.hisp.dhis.android.sdk.R.string.warning_hidefieldwithvalue), trackedEntityAttributeNames ); mTrackedEntityInstanceDataEntryFragment.setValidationErrorDialog(validationErrorDialog); - if (fragment.isAdded()) { + if (fragment.isAdded() && fragment.isVisible()) { mTrackedEntityInstanceDataEntryFragment.getValidationErrorDialog().show(fragment.getChildFragmentManager()); } } diff --git a/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/trackedentityinstanceprofile/TrackedEntityInstanceProfileRuleHelper.java b/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/trackedentityinstanceprofile/TrackedEntityInstanceProfileRuleHelper.java index 21874c53d..f819700fd 100644 --- a/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/trackedentityinstanceprofile/TrackedEntityInstanceProfileRuleHelper.java +++ b/app/src/main/java/org/hisp/dhis/android/trackercapture/fragments/trackedentityinstanceprofile/TrackedEntityInstanceProfileRuleHelper.java @@ -103,7 +103,7 @@ public void showWarningHiddenValuesDialog(Fragment parentFragment, ArrayList + + android:src="@drawable/ic_offline" + android:layout_gravity="center"/> + + diff --git a/build.gradle b/build.gradle index 399037faa..6f2d45e8a 100644 --- a/build.gradle +++ b/build.gradle @@ -33,8 +33,8 @@ ext { minSdkVersion = 15 compileSdkVersion = 23 targetSdkVersion = 23 - versionCode = 61 - versionName = "0.5.3" + versionCode = 63 + versionName = "0.5.5" configuration = [ package : "org.hisp.dhis.android.trackercapture", @@ -43,8 +43,8 @@ ext { minSdkVersion : 15, compileSdkVersion: 23, targetSdkVersion : 23, - versionCode : 58, - versionName : "0.5.0" + versionCode : 63, + versionName : "0.5.5" ] libraries = [