File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
catalog/java/io/material/catalog/navigationdrawer Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 2727import androidx .activity .OnBackPressedCallback ;
2828import androidx .annotation .NonNull ;
2929import androidx .annotation .Nullable ;
30+ import androidx .core .view .GravityCompat ;
3031import androidx .drawerlayout .widget .DrawerLayout ;
3132import androidx .drawerlayout .widget .DrawerLayout .SimpleDrawerListener ;
3233import com .google .android .material .materialswitch .MaterialSwitch ;
@@ -98,6 +99,14 @@ public void onDrawerClosed(@NonNull View drawerView) {
9899 navigationViewEnd .setItemTextAppearanceActiveBoldEnabled (isChecked );
99100 });
100101
102+ drawerLayout .post (
103+ () -> {
104+ if (drawerLayout .isDrawerOpen (GravityCompat .START )
105+ || drawerLayout .isDrawerOpen (GravityCompat .END )) {
106+ drawerOnBackPressedCallback .setEnabled (true );
107+ }
108+ });
109+
101110 return view ;
102111 }
103112
You can’t perform that action at this time.
0 commit comments