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

Prevent Duplicate Growth Chart Dialogs From Loading #294

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=0.8.2-SNAPSHOT
VERSION_NAME=0.8.3-SNAPSHOT
VERSION_CODE=1
GROUP=org.smartregister
POM_SETTING_DESCRIPTION=OpenSRP Client Child Library
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1354,8 +1354,6 @@ private void showGrowthDialog(View view) {
RecordGrowthDialogFragment recordWeightDialogFragment = RecordGrowthDialogFragment.newInstance(dob, weightWrapper, heightWrapper);
recordWeightDialogFragment.show(fragmentTransaction, DIALOG_TAG);
}


}

@Override
Expand Down Expand Up @@ -1679,37 +1677,38 @@ public void showGrowthDialogFragment(Map<String, List> growthMonitoring) {
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
Fragment prev = getSupportFragmentManager().findFragmentByTag(BaseChildImmunizationActivity.DIALOG_TAG);
if (prev != null) {
fragmentTransaction.remove(prev);
// fragmentTransaction.remove(prev);
ndegwamartin marked this conversation as resolved.
Show resolved Hide resolved
return;
}
fragmentTransaction.addToBackStack(null);

showProgressDialog(getString(R.string.loading), getString(R.string.loading_form_message));

List<Weight> weights = new ArrayList<>();
List<Height> heights = new ArrayList<>();

if (growthMonitoring == null || growthMonitoring.isEmpty()) {
Utils.showToast(this, getString(R.string.record_growth_details));
} else {

if (growthMonitoring.containsKey(Constants.WEIGHT)) {
weights = growthMonitoring.get(Constants.WEIGHT);
}

if (growthMonitoring.containsKey(Constants.HEIGHT)) {
heights = growthMonitoring.get(Constants.HEIGHT);
}


}

GrowthDialogFragment growthDialogFragment = GrowthDialogFragment.newInstance(childDetails, weights, heights);
growthDialogFragment.show(fragmentTransaction, BaseChildImmunizationActivity.DIALOG_TAG);

hideProgressDialog();
}

////////////////////////////////////////////////////////////////
// Inner classes
////////////////////////////////////////////////////////////////


public void updateScheduleDate() {
String dobString = Utils.getValue(childDetails.getColumnmaps(), Constants.KEY.DOB, false);
DateTime dateTime = Utils.dobStringToDateTime(dobString);
Expand Down