The second Android 11 Developer Preview is now available, test it out and share your feedback.

ExtensionWindowBackend

class ExtensionWindowBackend : WindowBackend
kotlin.Any
   ↳ androidx.window.ExtensionWindowBackend

Default implementation of WindowBackend that uses a combination of platform APIs and device-dependent OEM extensions.

Summary

Public methods

DeviceState

static ExtensionWindowBackend
getInstance(@NonNull context: Context)

Get the shared instance of the class.

WindowLayoutInfo
getWindowLayoutInfo(@NonNull context: Context)

Unit
registerDeviceStateChangeCallback(@NonNull executor: Executor, @NonNull callback: Consumer<DeviceState!>)

Unit
registerLayoutChangeCallback(@NonNull context: Context, @NonNull executor: Executor, @NonNull callback: Consumer<WindowLayoutInfo!>)

Unit

Unit

Public methods

getDeviceState

@NonNull fun getDeviceState(): DeviceState

getInstance

@NonNull static fun getInstance(@NonNull context: Context): ExtensionWindowBackend

Get the shared instance of the class.

getWindowLayoutInfo

@NonNull fun getWindowLayoutInfo(@NonNull context: Context): WindowLayoutInfo

registerDeviceStateChangeCallback

fun registerDeviceStateChangeCallback(
    @NonNull executor: Executor,
    @NonNull callback: Consumer<DeviceState!>
): Unit

registerLayoutChangeCallback

fun registerLayoutChangeCallback(
    @NonNull context: Context,
    @NonNull executor: Executor,
    @NonNull callback: Consumer<WindowLayoutInfo!>
): Unit

unregisterDeviceStateChangeCallback

fun unregisterDeviceStateChangeCallback(@NonNull callback: Consumer<DeviceState!>): Unit

unregisterLayoutChangeCallback

fun unregisterLayoutChangeCallback(@NonNull callback: Consumer<WindowLayoutInfo!>): Unit