Skip to content

feat(android): edge to edge #10774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

feat(android): edge to edge #10774

wants to merge 3 commits into from

Conversation

triniwiz
Copy link
Member

@triniwiz triniwiz commented Jul 28, 2025

Android: Edge-to-Edge Support with Overflow Handling

This PR introduces a flexible edge-to-edge system for Android, allowing views to handle system insets more precisely.

Note: Insets propagate down the view hierarchy until consumed. When applied, they are added to the view’s padding.


🔧 Features

  1. androidOverflowEdge (new property)
    Controls which inset edges should be applied and/or consumed by the view.

  2. androidOverflowInset (new event)
    Fired when androidOverflowEdge is set to dont-apply. Allows manual handling of the insets.

  3. enableEdgeToEdge() (new method)
    Enables full edge-to-edge rendering and lets you:

    • Customize status bar and navigation bar light/dark overlay colors
    • Provide a callback to control whether light or dark system UI should be used based on your own logic

✏️ androidOverflowEdge Options

Value Behavior
none Apply and consume all inset edges
left / top / right / bottom Apply and consume only the specified edge
dont-apply Do not apply or consume any insets — triggers androidOverflowInset
left-dont-consume Apply the left inset but do not consume it; all other insets are ignored
top-dont-consume Apply the top inset but do not consume it; all other insets are ignored
right-dont-consume Apply the right inset but do not consume it; all other insets are ignored
bottom-dont-consume Apply the bottom inset but do not consume it; all other insets are ignored
all-but-left Apply and consume all insets except left
all-but-top Apply and consume all insets except top
all-but-right Apply and consume all insets except right
all-but-bottom Apply and consume all insets except bottom

Pages default to dont-apply.


🧩 Manually Handling Insets with androidOverflowInset

When androidOverflowEdge is set to dont-apply, the view will receive the androidOverflowInset event instead of automatically applying insets.

This event allows you to inspect, modify, and explicitly consume specific inset sides using the *Consumed flags.

Example:

myView.on('androidOverflowInset', (args) => {
  // Modify inset values if needed
  args.inset.top += 10;    // Add 10px to top
  args.inset.bottom += 10; // Add 10px to bottom
  args.inset.left += 10;   // Add 10px to left
  args.inset.right += 10;  // Add 10px to right

  // Explicitly consume each side
  args.inset.topConsumed = true;
  args.inset.bottomConsumed = true;
  args.inset.leftConsumed = true;
  args.inset.rightConsumed = true;
});
 

Copy link

nx-cloud bot commented Jul 28, 2025

🤖 Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution ↗ for commit 5938492

Command Status Duration Result
nx test apps-automated -c=android ❌ Failed 5m 17s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2025-08-06 01:26:37 UTC

@NathanWalker NathanWalker changed the title feat: edge to edge feat(android): edge to edge Jul 28, 2025
@NathanWalker NathanWalker added this to the 9.0 milestone Jul 30, 2025
@triniwiz triniwiz marked this pull request as ready for review August 6, 2025 01:51
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