karthyks / Composed

Utility for Android jetpack compose applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

develop release CircleCI

Composed

Utility library for Jetpack compose projects.

Overlay

Render a composable dynamically on top of a composable. Overlay is a stack based renderer, multiple composables can be rendered on top of each other. One of the main use-cases is it is really useful in a modularised project where you don't have to expose the UI code but just the overlay contract and also to render condition based composable (show a dialog on click/ show a message on top of a screen).

Why Composed?

Without composed overlay

All the conditional composable components are tied to the composable function.

image

With composed

Conditional composable components such as ToastMessage, DialogScreen can be decoupled from Composables and triggered via a contract from the viewModel.

image

Installation

implementation "io.github.karthyks:composed:{latest_version}"

Usage

ProvideOverlay {
    Column {
       val overlayProvider = LocalOverlayProvider.current
       LaunchedEffect(key1 = Unit) {
          overlayProvider.showOverlay(FullScreenDialog())
       }
    }
}
class FullScreenDialog : Overlay {
    override val viewHolder: ViewHolder by viewHolder { disposable ->
        RenderFullScreenDialogContent {
            disposable.dispose()
        }
    }
}

ComposedOverlay.mp4

Changelog

The changelog is regularly updated to reflect what's changed in each new release.

License

This project is licensed under the terms of the MIT license.

Contributing

Read the contributing guide to learn about our development process, how to propose bug fixes and improvements, and how to build and test your changes.

Contributing to Composed is about more than just issues! New features or extensions are always welcome.

About

Utility for Android jetpack compose applications.

License:MIT License


Languages

Language:Kotlin 100.0%