Package-level declarations

Types

Link copied to clipboard
abstract class Application<out A : Application<A>>(self: BaseLazyReference<A>, rawContext: PlatformContext) : StartupPool
Link copied to clipboard
abstract class ApplicationWindow

一个独立窗口的生命周期。每次打开使用新实例,持久业务状态可由调用方另行持有。 Window 只创建一个平台窗口,并将系统关闭请求交给 close;Content 自动使用应用的主题和资源配置。 窗口离开组合后取消其协程并调用 uninitialize,关闭子窗口不会退出应用。

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
actual abstract class PlatformApplication<out A : PlatformApplication<A>> : Application<A>
expect abstract class PlatformApplication<out A : PlatformApplication<A>> : Application<A>
actual abstract class PlatformApplication<out A : PlatformApplication<A>> : Application<A>
actual abstract class PlatformApplication<out A : PlatformApplication<A>> : Application<A>
actual abstract class PlatformApplication<out A : PlatformApplication<A>> : Application<A>
actual abstract class PlatformApplication<out A : PlatformApplication<A>> : Application<A>
Link copied to clipboard
Link copied to clipboard
class Tray
class Tray

跟随窗口生命周期创建、更新及释放;不持有已关闭的窗口

Link copied to clipboard
class WindowController(placement: WindowPlacement, isMinimized: Boolean, position: WindowPosition, initSize: DpSize, initTitle: String, initIcon: DrawableResource?, initRoundedCorner: Boolean)
class WindowController(initSize: DpSize, initTitle: String, isMinimized: Boolean = false, initIcon: DrawableResource? = null, initRoundedCorner: Boolean = true, initUndecorated: Boolean = true, minSize: DpSize = DpSize(360.dp, 640.dp), placement: WindowPlacement = WindowPlacement.Floating, position: WindowPosition = WindowPosition.Aligned(Alignment.Center), initFocusable: Boolean = true, initResizable: Boolean = true, initClickThrough: Boolean = false)
Link copied to clipboard
data class WindowOptions(val title: String = "Skiko Native", val width: Int = 800, val height: Int = 480, val backend: NativeWindowBackend = NativeWindowBackend.GPU, val transparent: Boolean = false, val undecorated: Boolean = false, val focusable: Boolean = true, val resizable: Boolean = true, val clickThrough: Boolean = false)

Functions

Link copied to clipboard
Link copied to clipboard
fun DefaultTopBar(controller: WindowController, onExit: () -> Unit, backgroundColor: Color = Colors.Transparent, actions: @Composable RowScope.() -> Unit = { DefaultTopBarActions(controller, onExit) })
fun DefaultTopBar(controller: WindowController, onExit: () -> Unit, backgroundColor: Color = Colors.Transparent, actions: @Composable RowScope.() -> Unit = { DefaultTopBarActions(controller, onExit) })
Link copied to clipboard
fun DefaultTopBarActions(controller: WindowController, onExit: () -> Unit)
fun DefaultTopBarActions(controller: WindowController, onExit: () -> Unit)
Link copied to clipboard
fun ApplicationWindow.NativeWindow(options: WindowOptions = WindowOptions(title = "Compose Native"), onOpen: (NativeWindowScope) -> Unit = {}, onEvent: (NativeWindowEvent) -> Unit = {}, onClose: () -> Unit = {}, content: @Composable NativeWindowScope.() -> Unit)
Link copied to clipboard
Link copied to clipboard
fun ApplicationWindow.OverlayWindow(layoutInScreen: Boolean = true, touchable: Boolean = true, onPermissionFailed: () -> Unit = {}, onOpen: (FloatingView) -> Unit = {}, onClose: () -> Unit = {}, content: @Composable () -> Unit)

创建应用管理的 Android 悬浮窗,自动请求悬浮窗权限并在窗口关闭时注销请求、释放 View。 layoutInScreen、touchable 为创建参数;onOpen 可取得底层宿主以更新位置。 无前台 Activity 时等待其就绪,Activity 重建后重新处理待打开请求;明确拒绝权限时调用 onPermissionFailed。

Link copied to clipboard
fun Modifier.windowDragArea(controller: WindowController, draggable: Boolean = true): Modifier