Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eygraber/portal
Portal Compose Navigation
https://github.com/eygraber/portal
compose navigation
Last synced: about 2 months ago
JSON representation
Portal Compose Navigation
- Host: GitHub
- URL: https://github.com/eygraber/portal
- Owner: eygraber
- License: mit
- Created: 2021-10-19T03:38:49.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-27T21:51:05.000Z (about 2 months ago)
- Last Synced: 2024-10-28T04:59:39.274Z (about 2 months ago)
- Topics: compose, navigation
- Language: Kotlin
- Homepage:
- Size: 1.52 MB
- Stars: 12
- Watchers: 7
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: changelog_config.json
- License: LICENSE
Awesome Lists containing this project
README
# Portal
Portal is a KMP library that helps manage navigating and architecting Compose UI apps. It works with both Jetpack and Jetbrains Compose (and theoretically any other future flavors).
It provides a simple API to manage displaying Composable functions with enter and exit transitions. There is a backstack, and saving/restoring state is a WIP.
### Setup
```
repositories {
mavenCentral()
}dependencies {
implementation("com.eygraber:portal:0.9.31")
}
```Snapshots can be found [here](https://s01.oss.sonatype.org/#nexus-search;gav~com.eygraber~portal~~~).
### Usage
```kotlin
enum class MyPortalKey {
FirstScreen,
SecondScreen
}fun main() {
val portals = PortalManager()thread {
Thread.sleep(1_000)portals.withTransaction {
add(MyPortalKey.FirstScreen) {
Text(text = "Hello, Portal!")
}
}
}
singleWindowApplication(title = "Portals") {
Surface(
modifier = Modifier.fillMaxSize()
) {
portals.Render()
}
}
}
```More to come here. Check out the samples for now.