feat: implement edge-to-edge support across Pluto#362
Open
argahutama wants to merge 6 commits into
Open
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- PlutoActivity: replace legacy window flags with enableEdgeToEdge() and apply top/bottom padding via WindowInsetsCompat - SelectorActivity: add enableEdgeToEdge() and inset-aware padding - RulerActivity: add enableEdgeToEdge() and adjust controls top margin to account for status bar insets - Remove android:fitsSystemWindows from all plugin fragment root layouts (datastore, exceptions, logger, network, rooms-database, shared-prefs, selector dialog) — insets are now handled at the activity level Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ViewHierarchyFragment: add WindowCompat.setDecorFitsSystemWindows(false)
in onStart and apply insets to appBarContent top padding and list bottom
padding; add @id/appBarContent to the layout
- ViewInfoFragment: remove obsolete manual insets listener (bottom-sheet
padding is now handled by the activity-level inset logic)
- Remove android:fitsSystemWindows from view_info, view_hierarchy and
view_attr layouts
Fix InspectOverlay coordinate mismatch under edge-to-edge:
enableEdgeToEdge() + paddingTop on the Pluto root view shifts the
InspectOverlay down by statusBarHeight in screen space. Previously
InspectedView.reset() stored rects in screen-absolute coordinates while
canvas drawing and MotionEvent coordinates are overlay-local, causing
hit-testing and selection highlights to be offset by ~statusBarHeight.
- InspectedView now stores an overlay View reference and calls
overlay.getLocationOnScreen() inside every reset(), subtracting the
overlay's screen offset so all rects are in overlay-local space.
This works correctly for both edge-to-edge and non-edge-to-edge
inspected apps.
- InspectOverlay.tryGetFrontView() wraps the traversal in doOnLayout{}
so getLocationOnScreen() is called only after the overlay has
completed its first layout pass (before layout it always returns 0,0).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- MainActivity: add enableEdgeToEdge(), pad appBar top and actionsView bottom using WindowInsetsCompat; add @id/appBar to layout - DemoLayoutInspectorActivity: add enableEdgeToEdge(), pad appBar top and root left/right/bottom; add @id/appBar to layout Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
@srtvprateek please kindly help to review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adopts Android's edge-to-edge display mode throughout the Pluto library, its plugins, and the sample app. Content now draws behind the status bar and navigation bar; insets are handled explicitly via
WindowInsetsCompatso nothing gets clipped.Changes
deps: add androidx-activity dependency for edge-to-edge supportandroidx.activity:activity-ktxto the version catalog,pluto/lib, andsample— required for theenableEdgeToEdge()API.feat: enable edge-to-edge in Pluto core activitiesPlutoActivity— replaced legacyWindowManagerflags and manual status-bar colour withenableEdgeToEdge()+ViewCompat.setOnApplyWindowInsetsListenerapplyingtop/bottompadding.SelectorActivity— same pattern; preserves the layout's initial padding so insets are additive.RulerActivity— adjusts the floating controls'topMargininstead of padding to keep the ruler widget unaffected.android:fitsSystemWindows="true"; insets are now consumed at the activity level.feat: add edge-to-edge support to layout-inspector pluginViewHierarchyFragment— callsWindowCompat.setDecorFitsSystemWindows(false)inonStartand applies insets to the app-bar top padding and list bottom padding. Added@id/appBarContentto the layout.ViewInfoFragment— removed the now-redundant manual bottom-padding insets listener for the preview bottom sheet.view_info,view_hierarchy,view_attr) — removedandroid:fitsSystemWindows.Bug fix —
InspectOverlaycoordinate mismatch under edge-to-edge:enableEdgeToEdge()+paddingTop = statusBarHeighton the Pluto root view shiftsInspectOverlaydown the screen.InspectedView.reset()was storing rects in screen-absolute coordinates (viagetLocationOnScreen), while canvas drawing andMotionEventcoordinates are overlay-local — causing hit-testing and selection highlights to be offset by roughly the status-bar height.InspectedViewnow holds a reference to the overlayViewand callsoverlay.getLocationOnScreen()inside everyreset(), subtracting the offset so all rects are in overlay-local space. Works correctly for both edge-to-edge and non-edge-to-edge inspected apps.InspectOverlay.tryGetFrontView()wraps the traversal indoOnLayout {}so the position is read only after the overlay's first layout pass (before layoutgetLocationOnScreenalways returns[0, 0]).feat: enable edge-to-edge in sample app activitiesMainActivityandDemoLayoutInspectorActivity— addedenableEdgeToEdge()and explicit inset handling (app-bar top, actions/root bottom, horizontal gutters).@id/appBarto both activity layouts so the inset listener can reference the correct view.Screenshots