Up button navigation now doing same as back button.

This commit is contained in:
GaidamakUA 2015-11-03 19:49:48 +02:00
parent e4f786cbaa
commit 41ea53257e

View file

@ -135,7 +135,7 @@ public class EditPoiDialogFragment extends DialogFragment {
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dismiss();
dismissCheckForChanges();
}
});
@ -337,12 +337,7 @@ public class EditPoiDialogFragment extends DialogFragment {
LOG.debug("onKey hasChangesBeenMade" + editPoiData.hasChangesBeenMade());
return true;
} else {
if (editPoiData.hasChangesBeenMade()) {
new AreYouSureDialogFragment().show(getChildFragmentManager(),
"AreYouSureDialogFragment");
} else {
dismiss();
}
dismissCheckForChanges();
return true;
}
}
@ -351,6 +346,15 @@ public class EditPoiDialogFragment extends DialogFragment {
});
}
private void dismissCheckForChanges() {
if (editPoiData.hasChangesBeenMade()) {
new AreYouSureDialogFragment().show(getChildFragmentManager(),
"AreYouSureDialogFragment");
} else {
dismiss();
}
}
@Override
public void onSaveInstanceState(Bundle outState) {
outState.putSerializable(TAGS_LIST, (Serializable) editPoiData.getTagValues());