All Projects → lcdsmao → JetTheme

lcdsmao / JetTheme

Licence: MIT license
A flexible theme provider for Jetpack Compose. Supports dynamic theme changes and saving theme preference.

Programming Languages

kotlin
9241 projects
shell
77523 projects

Projects that are alternatives of or similar to JetTheme

kmm-production-sample
This is an open-source, mobile, cross-platform application built with Kotlin Multiplatform Mobile. It's a simple RSS reader, and you can download it from the App Store and Google Play. It's been designed to demonstrate how KMM can be used in real production projects.
Stars: ✭ 1,476 (+2975%)
Mutual labels:  jetpack-compose
Photos
No description or website provided.
Stars: ✭ 74 (+54.17%)
Mutual labels:  jetpack-compose
DailyDoc
Productivity Note App utilizing Jetpack Compose
Stars: ✭ 31 (-35.42%)
Mutual labels:  jetpack-compose
Compose-Settings
Android #JetpackCompose Settings library
Stars: ✭ 188 (+291.67%)
Mutual labels:  jetpack-compose
accrescent
A novel Android app store focused on security, privacy, and usability
Stars: ✭ 208 (+333.33%)
Mutual labels:  jetpack-compose
SSComposeCookBook
A Collection of major Jetpack compose UI components which are commonly used.🎉🔝👌
Stars: ✭ 386 (+704.17%)
Mutual labels:  jetpack-compose
Pacman Compose
Pacman Created in JetpackCompose
Stars: ✭ 28 (-41.67%)
Mutual labels:  jetpack-compose
Flower-App-Jetpack-Compose
This sample is created to elaborate this article, it contains the UI of the flower app from our dribble collection
Stars: ✭ 73 (+52.08%)
Mutual labels:  jetpack-compose
info-bar-compose
An Android Jetpack Compose library for displaying on-screen messages. (simplified Snackbar alternative)
Stars: ✭ 80 (+66.67%)
Mutual labels:  jetpack-compose
AndroidOpenSourceDemo
Android 主流开源库是如何实现的呢?来自己动手实现一个
Stars: ✭ 40 (-16.67%)
Mutual labels:  jetpack-compose
ThinkRchive
An app showing all details for various Lenovo Thinkpad models. Made to try out Jepack Compose for Android.
Stars: ✭ 84 (+75%)
Mutual labels:  jetpack-compose
VegetableOrderUI-Android
Check out the new style for App Design aims for the Vegetable Order Service using jetpack compose...😉😀😁😎
Stars: ✭ 349 (+627.08%)
Mutual labels:  jetpack-compose
NestedScrollView
NestedScrollView for Jetpack Compose
Stars: ✭ 57 (+18.75%)
Mutual labels:  jetpack-compose
SnappCompose
A clone of Snapp using Jetpack Compose. Showcasing various usages of Google Maps Animations etc combined with Compose
Stars: ✭ 59 (+22.92%)
Mutual labels:  jetpack-compose
compose-backstack
Simple composable for rendering transitions between backstacks.
Stars: ✭ 411 (+756.25%)
Mutual labels:  jetpack-compose
Delish
Delish, a Food Recipes App in Jetpack Compose and Hilt based on modern Android tech-stacks and MVI clean architecture.
Stars: ✭ 356 (+641.67%)
Mutual labels:  jetpack-compose
Praxis
Example Android project using MVVM, DaggerAndroid, Jetpack Compose, Retrofit, Coroutines and Multi module architecture ✌🏽
Stars: ✭ 258 (+437.5%)
Mutual labels:  jetpack-compose
Awesome-Android-Open-Source-Projects
👓 A curated list of awesome android projects by open-source contributors.
Stars: ✭ 401 (+735.42%)
Mutual labels:  jetpack-compose
hands on kotlin
Experiments with Compose and latest architecture patterns in Kotlin
Stars: ✭ 45 (-6.25%)
Mutual labels:  jetpack-compose
Jetpack-Compose-Theme-Configurator
Desktop Application to setup/configure your Jetpack Compose Color/Theme Palette
Stars: ✭ 50 (+4.17%)
Mutual labels:  jetpack-compose

JetTheme

JetTheme is a flexible theme provider for Jetpack Compose.

  • Change the theme and recompose the UI dynamically.
  • Save theme preference to local storage.
  • Build your own design system.

Download

dependencies {
  // Use this if you want material design support (recommended)
  implementation "dev.lcdsmao.jettheme:jettheme-material:$latestVersion"
  // Use this if you want to build custom design system
  implementation "dev.lcdsmao.jettheme:jettheme:$latestVersion"
}

Quick Start

Provide Themes

Define your material themes themes using buildMaterialThemePack.

val AppTheme = buildMaterialThemePack {
  defaultMaterialTheme(
    colors = lightColors(...),
    typography = Typography(...),
    shapes = Shapes(...),
  )
  materialTheme(
    id = darkId,
    colors = darkColors(...),
  )
  materialTheme(
    id = "other_theme",
    colors = otherColors(...),
  )
}

For child components can correctly access defined AppTheme via MaterialTheme, wrap your child components in a ProvideAppMaterialTheme.

@Composable
fun App() {
  ProvideAppMaterialTheme(AppTheme) {
    // children
  }
}

Change Themes

You can retrieve current component tree's ThemeController from ThemeControllerAmbient.

val themeController = ThemeControllerAmbient.current

To change current theme you can use the theme id strings.

themeController.setThemeId(ThemeIds.Default)
themeController.setThemeId("other_theme_id")

Access Current Theme Values

You can access current theme values via MaterialTheme object (from androidx.compose.material):

Surface(color = MaterialTheme.colors.primary) {
  // children
}

Check out JetTheme's full documentation here.

Contributing

Feel free to open a issue or submit a pull request for any bugs/improvements.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].