π¨ Jetpack Compose material theming library, which falls back onto a custom dynamic colors implementation based on wallpapers to support older API levels. Yes! Dynamic colors are now available even on old android devices, enjoy!
Examples (See ImageResizer)
Attention: ColorPicker not included in the package
- Declaring custom color scheme based on up to three colors
- Content based colorscheme by providing bitmap
- Dynamic themeing from android 5
- Amoled mode support
- Flexible api to retrieve secondary and tertiary colors from given primary color
- Animating color scheme changes
π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯
repositories {
maven { setUrl("https://jitpack.io") } // Add jitpack
}
dependencies {
implementation("com.github.t8rin:dynamictheme:LATEST_VERSION") // Replace "LATEST_VERSION" with preferrend version tag
}
repositories {
maven { url 'https://jitpack.io' } // Add jitpack
}
dependencies {
implementation 'com.github.t8rin:dynamictheme:LATEST_VERSION' // Replace "LATEST_VERSION" with preferrend version tag
}
@Composable
fun DynamicThemeComposable() {
DynamicTheme(
state = rememberDynamicThemeState(),
defaultColorTuple = ColorTuple(
primary = /*your value*/,
secondary = /*your value (optional)*/,
tertiary = /*your value (optional)*/
),
content = {
/*your content
* there you can get you provided state value by LocalDynamicThemeState.current
*/
}
)
//...
// Also you can use ColorTupleItem to get represenation of your color scheme by three colors
- Rewrite to Kotlin
Support it by joining stargazers for this repository. β
And follow me for my next creations! π€©
Designed and developed by 2023 T8RIN
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.