use of com.orgzly.android.ui.fragments.NoteFragment in project orgzly-android by orgzly.
the class MainActivity method onBackPressed.
@Override
public void onBackPressed() {
if (BuildConfig.LOG_DEBUG)
LogUtils.d(TAG);
/* Close drawer if opened. */
if (mDrawerLayout != null) {
if (mDrawerLayout.isDrawerOpen(GravityCompat.START)) {
mDrawerLayout.closeDrawer(GravityCompat.START);
return;
}
}
/* Handle back press when editing note - check for changes */
Fragment fragment = getSupportFragmentManager().findFragmentByTag(NoteFragment.FRAGMENT_TAG);
if (fragment != null && fragment instanceof NoteFragment && fragment.isVisible()) {
final NoteFragment noteFragment = (NoteFragment) fragment;
if (noteFragment.isAskingForConfirmationForModifiedNote()) {
return;
}
}
super.onBackPressed();
}
Aggregations