Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@cbracken
Copy link
Member

@cbracken cbracken commented Dec 12, 2017

Model top and side system insets as padding and bottom (keyboard) as a
view inset. This avoids applying system insets twice (once as an inset,
once as padding).

Engine side fix to flutter/flutter#13475

Copy link
Member

@xster xster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Override
public final WindowInsets onApplyWindowInsets(WindowInsets insets) {
// On Android, we do not differentiate between 'safe areas' and view insets.
// Status bar, left/right system insets are padding.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just as a mini hint for readers, mention top left right are paddings because they're partial obstructions, bottom is generally a full obstruction, thus a view inset.

Copy link
Member Author

@cbracken cbracken Dec 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Hinted at rationale: padding is for view content that should sit 'under' the system chrome; insets are for view content where system chrome should effectively 'shrink' the content area.

Model top and side system insets as padding and bottom (keyboard) as a
view inset. This avoids applying system insets twice (once as an inset,
once as padding).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants