Use simpler DrawerLayout methods (#1015)

This commit is contained in:
Taco 2022-09-09 01:40:07 -04:00 committed by GitHub
parent b72bfdef37
commit e04fedfc64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1097,8 +1097,8 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
@Override
public void onBackPressed() {;
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
if (drawer.isOpen()) {
drawer.close();
} else {
if (mBackButtonAction == SharedPreferencesUtils.MAIN_PAGE_BACK_BUTTON_ACTION_CONFIRM_EXIT) {
new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme)
@ -1108,7 +1108,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
.setNegativeButton(R.string.no, null)
.show();
} else if (mBackButtonAction == SharedPreferencesUtils.MAIN_PAGE_BACK_BUTTON_ACTION_OPEN_NAVIGATION_DRAWER) {
drawer.openDrawer(GravityCompat.START);
drawer.open();
} else {
super.onBackPressed();
}