mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 04:37:25 +01:00
Use simpler DrawerLayout methods (#1015)
This commit is contained in:
parent
b72bfdef37
commit
e04fedfc64
@ -1097,8 +1097,8 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {;
|
public void onBackPressed() {;
|
||||||
if (drawer.isDrawerOpen(GravityCompat.START)) {
|
if (drawer.isOpen()) {
|
||||||
drawer.closeDrawer(GravityCompat.START);
|
drawer.close();
|
||||||
} else {
|
} else {
|
||||||
if (mBackButtonAction == SharedPreferencesUtils.MAIN_PAGE_BACK_BUTTON_ACTION_CONFIRM_EXIT) {
|
if (mBackButtonAction == SharedPreferencesUtils.MAIN_PAGE_BACK_BUTTON_ACTION_CONFIRM_EXIT) {
|
||||||
new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme)
|
new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme)
|
||||||
@ -1108,7 +1108,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
|
|||||||
.setNegativeButton(R.string.no, null)
|
.setNegativeButton(R.string.no, null)
|
||||||
.show();
|
.show();
|
||||||
} else if (mBackButtonAction == SharedPreferencesUtils.MAIN_PAGE_BACK_BUTTON_ACTION_OPEN_NAVIGATION_DRAWER) {
|
} else if (mBackButtonAction == SharedPreferencesUtils.MAIN_PAGE_BACK_BUTTON_ACTION_OPEN_NAVIGATION_DRAWER) {
|
||||||
drawer.openDrawer(GravityCompat.START);
|
drawer.open();
|
||||||
} else {
|
} else {
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user