-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LMH1-58: update adding family members to be intuitive
Depends on: opensrp/opensrp-client-chw-core#460
- Loading branch information
Showing
7 changed files
with
134 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<item name="family_floating_fab_icon" type="drawable">@drawable/ic_input_add</item> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
opensrp-chw/src/main/java/org/smartregister/chw/presenter/FamilyRegisterPresenter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package org.smartregister.chw.presenter; | ||
|
||
import android.content.Intent; | ||
|
||
import org.smartregister.chw.application.ChwApplication; | ||
import org.smartregister.chw.interactor.FamilyProfileInteractor; | ||
import org.smartregister.domain.FetchStatus; | ||
import org.smartregister.family.contract.FamilyRegisterContract; | ||
import org.smartregister.family.domain.FamilyEventClient; | ||
import org.smartregister.family.presenter.BaseFamilyRegisterPresenter; | ||
import org.smartregister.family.util.Constants; | ||
import org.smartregister.family.util.Utils; | ||
import org.smartregister.view.contract.BaseRegisterContract; | ||
|
||
import java.util.List; | ||
|
||
public class FamilyRegisterPresenter extends BaseFamilyRegisterPresenter { | ||
public FamilyRegisterPresenter(FamilyRegisterContract.View view, FamilyRegisterContract.Model model) { | ||
super(view, model); | ||
} | ||
|
||
@Override | ||
public void onRegistrationSaved(boolean isEditMode, boolean isSaved, List<FamilyEventClient> familyEventClientList) { | ||
if (ChwApplication.getApplicationFlavor().onFamilySaveGoToProfile()){ | ||
BaseRegisterContract.View view = viewReference == null? null : viewReference.get(); | ||
if (view != null && view.getContext() != null) { | ||
// view.refreshList(FetchStatus.fetched); | ||
|
||
FamilyEventClient familyEventClient = familyEventClientList.get(0); | ||
FamilyEventClient headEventClient = familyEventClientList.get(1); | ||
Intent intent = new Intent(view.getContext(), Utils.metadata().profileActivity); | ||
intent.putExtra(Constants.INTENT_KEY.FAMILY_BASE_ENTITY_ID, familyEventClient.getClient().getBaseEntityId()); | ||
// intent.putExtra("family_head", Utils.getValue(patient.getColumnmaps(), "family_head", false)); | ||
// intent.putExtra("primary_caregiver", Utils.getValue(patient.getColumnmaps(), "primary_caregiver", false)); | ||
// intent.putExtra("village_town", Utils.getValue(patient.getColumnmaps(), "village_town", false)); | ||
// intent.putExtra("family_name", Utils.getValue(patient.getColumnmaps(), "first_name", false)); | ||
// intent.putExtra("go_to_due_page", goToDuePage); | ||
view.getContext().startActivity(intent); | ||
view.hideProgressDialog(); | ||
} | ||
}else{ | ||
super.onRegistrationSaved(isEditMode, isSaved, familyEventClientList); | ||
} | ||
} | ||
} |