discord / OverlappingPanels

Overlapping Panels is a gestures-driven navigation UI library for Android
Apache License 2.0
420 stars 27 forks source link

support max side panel width for tablets #2

Closed donaldchen closed 4 years ago

donaldchen commented 4 years ago

For phones, we set the side panel width to the portrait screen width minus the visible width of the closed center panel minus the margin between panels.

That logic makes the side panels very wide on tablets, so this PR adds an attribute on OverlappingPanelsLayout to set a max non-full-screen width fro the side panel. OverlappingPanelsLayout will set the side panel width to the minimum between the portrait-screen-width based panel width and the max non-full-screen width.

The max non-full-screen width does not affect OverlappingPanels#setStartPanelUseFullPortraitWidth() API which still sets the start panel width to the full screen width.