Compose library for creating interactive presentations
| .fleet | ||
| compre | ||
| gradle | ||
| sample/composeApp | ||
| .gitignore | ||
| build.gradle.kts | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| LICENSE.md | ||
| README.md | ||
| settings.gradle.kts | ||
COMpose-PREsentation
A library for creating interactive presentations in Compose.
Setup
Add to settings.gradle.kts:
dependencyResolutionManagement {
repositories {
maven("https://joker.morwud.cz/api/packages/Morwud/maven")
}
}
And then to build.gradle.kts of the compose application:
// ...
kotlin {
// ...
sourceSets {
// ...
commonMain.dependencies {
// ...
implementation("org.zimmma.compose:compre:1.0-SNAPSHOT")
}
// ...
}
}
// ...
The library is still in heavy development, although the bases shouldn't change much.
Usage
In Main.kt:
fun main() {
application {
val state = PresentationState()
val modifier = Modifier
state.addChapters(
listOf(
ChapterImpl(
chapterName = "Basics",
pages =
listOf(
StandardContentPage(
"Sectioning the page",
listOf(
Section(IntRange(1, 4)) { Text("This will be here the whole time [1-4]") },
Section(2) { Text("This will be here only on section [2]") },
Section(IntRange(3, 4)) {
Text("This will be here from now [3] to the end [4]")
},
Section(4) {
Column {
Text("This works for images too")
Image(
painterResource(Res.drawable.kotlin),
contentDescription = null,
modifier =
modifier
.padding(end = Paddings.big)
.clip(RoundedCornerShape(32.dp))
.size(256.dp)
)
Text("You can end the presentation by pressing 'Q'")
}
}
)
)
)
)
)
)
Window(
onCloseRequest = ::exitApplication,
title = "Test presentation",
state = rememberWindowState(WindowPlacement.Fullscreen),
onPreviewKeyEvent = state::HandleKeyEvent
) {
Presentation(config = PresentationConfig(headerImageResourcePath = "images/kotlin.svg"))
}
}
}
For more comprehensive example see the sample.