Skip to content

Commit

Permalink
LMH1-98: fix navigate back to family profile, for child
Browse files Browse the repository at this point in the history
  • Loading branch information
LZRS committed Oct 25, 2021
1 parent b62ec38 commit 180df9b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,9 @@ public boolean showFamilyRegisterNextInToolbar() {
public boolean onFamilySaveGoToProfile() {
return true;
}

@Override
public boolean onChildProfileHomeGoToChildRegister() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,13 @@ private String getEligibleChildString() {
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
Intent intent = new Intent(this, ChildRegisterActivity.class);
startActivity(intent);
finish();
return true;
if (ChwApplication.getApplicationFlavor().onChildProfileHomeGoToChildRegister()) {
Intent intent = new Intent(this, ChildRegisterActivity.class);
startActivity(intent);
finish();
return true;
}
return super.onOptionsItemSelected(item);
case R.id.action_malaria_registration:
MalariaRegisterActivity.startMalariaRegistrationActivity(ChildProfileActivity.this, presenter().getChildClient().getCaseId(), ((ChildProfilePresenter) presenter()).getFamilyID());
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@ public interface Flavor {

boolean onFamilySaveGoToProfile();

boolean onChildProfileHomeGoToChildRegister();

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,9 @@ public boolean showFamilyRegisterNextInToolbar() {
public boolean onFamilySaveGoToProfile() {
return false;
}

@Override
public boolean onChildProfileHomeGoToChildRegister() {
return true;
}
}

0 comments on commit 180df9b

Please sign in to comment.