Compose Multiplatform Mobile Extensions (CME)



Preview

Gradle
Raw
// build.gradle.kts
dependencies {
commonMainApi("io.github.aagrishankov:cme-theme-status-bars:0.0.1")
// or
androidMainApi("io.github.aagrishankov:cme-theme-status-bars:0.0.1")
iosMainApi("io.github.aagrishankov:cme-theme-status-bars:0.0.1")
}
Version Catalog
cme-status-bars = { module = "io.github.aagrishankov:cme-theme-status-bars", version = "0.0.1" }
// build.gradle.kts
dependencies {
commonMainApi(libs.cme.status.bars)
// or
androidMainApi(libs.cme.status.bars)
iosMainApi(libs.cme.status.bars)
}
Usage
Theme System Bars
Setup Android
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentThemeWithStatusBars { App() }
}
Setup iOS
fun MainViewController(): UIViewController {
return StatusBarsProviderUIViewController { App() }
}
How to change theme
commonMain:
var theme by LocalThemeStatusBars.current
theme = SystemThemeStatusBars.DARK
theme = SystemThemeStatusBars.LIGHT
Sample
An sample of a project using the library can be viewed here -> sample
License
Copyright (c) 2024 CME project and open source contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use except compliance the License.
You may obtain a copy of the License at
http:
Unless applicable law agreed to writing, software
distributed under the License distributed an BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express implied.
See the License the specific language governing permissions
limitations under the License.