Skip to content

Commit

Permalink
[Catalog][Navigation Drawer] Update navigation drawer state handling …
Browse files Browse the repository at this point in the history
…to be more accurate in demo

Resolves #3611
Resolves #3610

GIT_ORIGIN_REV_ID=23a4655b1b4689f4b8fb233460822cd3b7c09675
PiperOrigin-RevId: 572943834
  • Loading branch information
manabu-nakamura authored and drchen committed Oct 12, 2023
1 parent a00ee50 commit 74ac87c
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -27,6 +27,7 @@
import androidx.activity.OnBackPressedCallback;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.drawerlayout.widget.DrawerLayout.SimpleDrawerListener;
import com.google.android.material.materialswitch.MaterialSwitch;
Expand Down Expand Up @@ -98,6 +99,14 @@ public void onDrawerClosed(@NonNull View drawerView) {
navigationViewEnd.setItemTextAppearanceActiveBoldEnabled(isChecked);
});

drawerLayout.post(
() -> {
if (drawerLayout.isDrawerOpen(GravityCompat.START)
|| drawerLayout.isDrawerOpen(GravityCompat.END)) {
drawerOnBackPressedCallback.setEnabled(true);
}
});

return view;
}

Expand Down

0 comments on commit 74ac87c

Please sign in to comment.