Package io.getstream.butterfly

Types

Link copied to clipboard
object GlobalWindowSize

Definition of the window size to be on the global scope.

Link copied to clipboard
sealed class Posture

Represent the posture of the foldable device.

Link copied to clipboard
abstract class WindowInfoActivity : ComponentActivity

WindowInfoActivity tracks window configurations and update the WindowLayoutInfo by invoking onWindowLayoutInfoUpdated. Also, provides a default property windowSize which includes definition of the screen size.

Link copied to clipboard
abstract class WindowInfoAppcompatActivity : AppCompatActivity

WindowInfoAppcompatActivity tracks window configurations and update the WindowLayoutInfo by invoking onWindowLayoutInfoUpdated. Also, provides a default property windowSize which includes definition of the screen size.

Link copied to clipboard
abstract class WindowInfoFragment : Fragment

WindowInfoFragment tracks window configurations and update the WindowLayoutInfo by invoking onWindowLayoutInfoUpdated. Also, provides a default property windowSize which includes definition of the screen size.

Link copied to clipboard
abstract class WindowInfoFragmentActivity : ComponentActivity

WindowInfoFragmentActivity tracks window configurations and update the WindowLayoutInfo by invoking onWindowLayoutInfoUpdated. Also, provides a default property windowSize which includes definition of the screen size.

Link copied to clipboard
sealed class WindowSize

Breakpoints defines the screen size at which a layout will adapt to best fit content and conform to responsive layout requirements. A breakpoint range informs how a screen adjusts to fit its size and orientation.

Properties

Link copied to clipboard
val FoldingFeature.hingeDpSize: Int

Returns a dp size of the hinge from a FoldingFeature.

Link copied to clipboard
val FoldingFeature.hingeHeightDpSize: Int

Returns a width Dp size of the hinge from a FoldingFeature.

Link copied to clipboard
val FoldingFeature.hingeHeightPxSize: Int

Returns a width pixel size of the hinge from a FoldingFeature.

Link copied to clipboard
val FoldingFeature.hingePxSize: Int

Returns a pixel size of the hinge from a FoldingFeature.

Link copied to clipboard
val FoldingFeature.hingeWidthDpSize: Int

Returns a width Dp size of the hinge from a FoldingFeature.

Link copied to clipboard
val FoldingFeature.hingeWidthPxSize: Int

Returns a width pixel size of the hinge from a FoldingFeature.

Link copied to clipboard
val FoldingFeature.isBookPosture: Boolean

Returns whether a FoldingFeature is the book mode.

Link copied to clipboard
val FoldingFeature.isFlat: Boolean

Returns whether the state of a FoldingFeature is flat.

Link copied to clipboard
val FoldingFeature.isHalfOpened: Boolean

Returns whether the state of a FoldingFeature is half-opened.

Link copied to clipboard
val FoldingFeature.isHorizontal: Boolean

Returns whether the orientation of a FoldingFeature is horizontal.

Link copied to clipboard
val WindowLayoutInfo.isSeparating: Boolean

Calculates if a FoldingFeature should be thought of as splitting the window into multiple physical areas that can be seen by users as logically separate. Display panels connected by a hinge are always separated. Folds on flexible screens should be treated as separating when they are not FoldingFeature.State.FLAT.

Link copied to clipboard
val FoldingFeature.isTableTopPosture: Boolean

Returns whether a FoldingFeature is the table-top mode.

Link copied to clipboard
val FoldingFeature.isVertical: Boolean

Returns whether the orientation of a FoldingFeature is vertical.

Link copied to clipboard

Calculates the occlusion mode to determine if a FoldingFeature occludes a part of the window. This flag is useful for determining if UI elements need to be moved around so that the user can access them. For some devices occluded elements can not be accessed by the user at all.

Link copied to clipboard

Returns FoldingFeature.Orientation.HORIZONTAL if the width is greater than the height, FoldingFeature.Orientation.VERTICAL otherwise.

Link copied to clipboard
val Activity.postureFlow: Flow<Posture>

Returns a Flow of the Posture by tracking the WindowLayoutInfo.

Link copied to clipboard
val Fragment.postureFlow: Flow<Posture>

Returns a Flow of the Posture by tracking the WindowLayoutInfo.

Link copied to clipboard
val WindowLayoutInfo.state: FoldingFeature.State
Link copied to clipboard
val Activity.windowLayoutInfo: Flow<WindowLayoutInfo>

Returns a Flow of the WindowLayoutInfo.

Link copied to clipboard
val Fragment.windowLayoutInfo: Flow<WindowLayoutInfo>

Returns a Flow of the WindowLayoutInfo.

Functions

Link copied to clipboard
fun WindowLayoutInfo.findFoldingFeature(): FoldingFeature?
fun List<DisplayFeature>.findFoldingFeature(): FoldingFeature?

Finds a FoldingFeature from a list of DisplayFeature.

Link copied to clipboard
fun Activity.getWindowSize(): WindowSize
fun Fragment.getWindowSize(): WindowSize

Returns the WindowSize by computing the size of the viewport.

Link copied to clipboard
fun WindowInfoTracker.postureFlow(activity: Activity): Flow<Posture>

Returns a Flow of the Posture by tracking the WindowLayoutInfo.

Link copied to clipboard
fun FoldingFeature.toPosture(): Posture

Returns a Posture which represent the current posture of the foldable device.

Link copied to clipboard
fun DisplayFeature.toSize(): Size

Returns a Size spec from a FoldingFeature.