// 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")
}# libs.versions.toml
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)
}//androidMain
//ComponentActivity
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//...
//replace default setContent to setContentThemeWithStatusBars
setContentThemeWithStatusBars { App() }
}//iosMain
//main.kt
fun MainViewController(): UIViewController {
//replace default ComposeUIViewController to StatusBarsProviderUIViewController
return StatusBarsProviderUIViewController { App() }
}commonMain:
//commonMain
//Composable Scope
var theme by LocalThemeStatusBars.current
theme = SystemThemeStatusBars.DARK
//or
theme = SystemThemeStatusBars.LIGHT
An sample of a project using the library can be viewed here -> sample
Copyright (c) 2024 CME project and open source contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
