-
public final class TwoPaneKt
-
-
Method Summary
Modifier and Type Method Description final static UnitTwoPane(Function0<Unit> first, Function0<Unit> second, TwoPaneStrategy strategy, List<DisplayFeature> displayFeatures, Modifier modifier, FoldAwareConfiguration foldAwareConfiguration)A layout that places two different pieces of content defined by the first and second slots where the arrangement, sizes and separation behaviour is controlled by TwoPaneStrategy. final static TwoPaneStrategyHorizontalTwoPaneStrategy(Float splitFraction, Dp gapWidth)Returns a TwoPaneStrategy that will place the slots horizontally. final static TwoPaneStrategyHorizontalTwoPaneStrategy(Dp splitOffset, Boolean offsetFromStart, Dp gapWidth)Returns a TwoPaneStrategy that will place the slots horizontally. final static TwoPaneStrategyVerticalTwoPaneStrategy(Float splitFraction, Dp gapHeight)Returns a TwoPaneStrategy that will place the slots horizontally. final static TwoPaneStrategyVerticalTwoPaneStrategy(Dp splitOffset, Boolean offsetFromTop, Dp gapHeight)Returns a TwoPaneStrategy that will place the slots horizontally. -
-
Method Detail
-
TwoPane
@Composable() final static Unit TwoPane(Function0<Unit> first, Function0<Unit> second, TwoPaneStrategy strategy, List<DisplayFeature> displayFeatures, Modifier modifier, FoldAwareConfiguration foldAwareConfiguration)
A layout that places two different pieces of content defined by the first and second slots where the arrangement, sizes and separation behaviour is controlled by TwoPaneStrategy.
TwoPane is fold and hinges aware using the provided the displayFeatures (which should normally be calculated via calculateDisplayFeatures). The layout will be adapted to properly separate first and second panes so they don't interfere with hardware hinges (vertical or horizontal) as specified in displayFeatures, or respect folds when needed (for example, when foldable is half-folded (90-degree fold AKA tabletop) the split will become on the bend).
To only be aware of folds with a specific orientation, pass in an alternate foldAwareConfiguration to only adjust for vertical or horizontal folds.
The TwoPane layout will always place both first and second, based on the provided strategy and window environment. If you instead only want to place one or the other, that should be controlled at a higher level and not calling TwoPane if placing both is not desired.
- Parameters:
first- the first content of the layout, a left-most in LTR, a right-most in RTL and top-most in a vertical split based on the SplitResult of TwoPaneStrategy.calculateSplitResultsecond- the second content of the layout, a right-most in the LTR, a left-most in the RTL and the bottom-most in a vertical split based on the SplitResult of TwoPaneStrategy.calculateSplitResultstrategy- strategy of the two pane that controls the arrangement of the layoutdisplayFeatures- the list of known display features to automatically avoidmodifier- an optional modifier for the layoutfoldAwareConfiguration- the types of display features to automatically avoid
-
HorizontalTwoPaneStrategy
final static TwoPaneStrategy HorizontalTwoPaneStrategy(Float splitFraction, Dp gapWidth)
Returns a TwoPaneStrategy that will place the slots horizontally.
The gap will be placed at the given splitFraction from start, with the given gapWidth.
-
HorizontalTwoPaneStrategy
final static TwoPaneStrategy HorizontalTwoPaneStrategy(Dp splitOffset, Boolean offsetFromStart, Dp gapWidth)
Returns a TwoPaneStrategy that will place the slots horizontally.
The gap will be placed at splitOffset either from the start or end based on offsetFromStart, with the given gapWidth.
-
VerticalTwoPaneStrategy
final static TwoPaneStrategy VerticalTwoPaneStrategy(Float splitFraction, Dp gapHeight)
Returns a TwoPaneStrategy that will place the slots horizontally.
The gap will be placed at the given splitFraction from top, with the given gapHeight.
-
VerticalTwoPaneStrategy
final static TwoPaneStrategy VerticalTwoPaneStrategy(Dp splitOffset, Boolean offsetFromTop, Dp gapHeight)
Returns a TwoPaneStrategy that will place the slots horizontally.
The gap will be placed at splitOffset either from the top or bottom based on offsetFromTop, with the given gapHeight.
-
-
-
-