Skip to content

fix(android): enable edge-to-edge for translucent modal Dialogs - #96

Merged
paufau merged 1 commit into
paufau:mainfrom
huukhuong:fix/android-edge-to-edge-navigation-bar
Oct 15, 2026
Merged

paufau merged 1 commit into
paufau:mainfrom
huukhuong:fix/android-edge-to-edge-navigation-bar

Conversation

@huukhuong

@huukhuong huukhuong commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

On Android, modal Dialogs did not draw truly edge-to-edge: the backdrop stopped at the status / navigation bars instead of extending behind them. That breaks the documented edge-to-edge behavior (statusBar.translucent + backdrop covering system bars while JS pads content with safe area).

This change enables edge-to-edge for the modal window so the backdrop can cover both the status bar and the navigation bar.

Changes

  • Enable edge-to-edge on the Dialog window via WindowCompat.setDecorFitsSystemWindows(window, false)
  • Make status bar and navigation bar transparent (window + Theme.FullScreenDialog)
  • When translucent, zero top and bottom system window insets so content/backdrop can draw behind system bars (JS should continue to pad with SafeAreaView / insets)

Screenshots

Full Screen modal

Before After
before-full-screen after-full-screen

Status / nav bars stay opaque or letterboxed before; after apply, the modal backdrop extends behind both system bars.

Simple modal

Before After
before-simple after-simple

Notes / migration

  • Apps using statusBar={{ translucent: true }} (or deprecated statusBarTranslucent) should pad content with SafeAreaView / useSafeAreaInsets, same as the edge-to-edge guide.
  • Without safe-area padding, content may sit under the navigation bar after this change.

Test plan

  • Example app Android — Full Screen / edge-to-edge scenario: backdrop under status + nav bar; content padded
  • Example app Android — Simple modal: backdrop / dimming behind system bars as expected
  • Gesture navigation and 3-button navigation
  • Keyboard open/close with text input inside modal (SOFT_INPUT_ADJUST_RESIZE)
  • statusBar.translucent: false still respects system insets

@paufau

paufau commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Thank you very much for raising the pull request!

I'm going to free up some time tomorrow to review it and merge asap

@paufau

paufau commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Hey @huukhuong, could you please provide more info
I need to know which Android and RN versions were used to reproduce the broken behavior

@huukhuong

Copy link
Copy Markdown
Contributor Author

Hi @paufau, here’s all the information you need:

  • Android: 16
  • RN: You can use the example project in this repo
  • Container: Replace SafeAreaView with View in DemoScreen.tsx
  • Content: ScrollView
  • Safe area: Intentionally not applied to allow edge-to-edge rendering
<View style={[styles.safeArea, { backgroundColor: colors.background }]}>
  <ScrollView
    style={styles.scroll}
    contentContainerStyle={[
      styles.scrollContent,
      { paddingBottom: height / 2 },
    ]}
  >
    <Typography testID="screen-top" style={styles.architecture}>
      Current Architecture: {IS_FABRIC ? "Fabric 🚀" : "Paper ✈️"}
    </Typography>

    <View style={styles.casesContainer}>
      {demoCases.map(({ title, description, id }) => (
        <ScenarioCard
          key={id}
          testID={`${id}-open-button`}
          title={title}
          description={description}
          onPress={() => {
            openModal(id);
          }}
        />
      ))}
    </View>
  </ScrollView>

  {activeCases.map(renderModal)}
</View>;

@paufau
paufau merged commit a13f423 into paufau:main Oct 15, 2026
7 checks passed
@paufau

paufau commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Hey, thanks for waiting and for your contribution.

During testing, I was able to reproduce the bug on versions 14 and below; everything worked fine for me on version 16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants