xref: /aosp_15_r20/external/accompanist/themeadapter-appcompat/README.md (revision fa44fe6ae8e729aa3cfe5c03eedbbf98fb44e2c6)
1*fa44fe6aSInna Palant# AppCompat Theme Adapter
2*fa44fe6aSInna Palant
3*fa44fe6aSInna Palant[![Maven Central](https://img.shields.io/maven-central/v/com.google.accompanist/accompanist-themeadapter-appcompat)](https://search.maven.org/search?q=g:com.google.accompanist)
4*fa44fe6aSInna Palant
5*fa44fe6aSInna PalantAppCompat Theme Adapter enables the reuse of [AppCompat][appcompat] XML themes, for theming in [Jetpack Compose][compose].
6*fa44fe6aSInna Palant
7*fa44fe6aSInna Palant## Usage
8*fa44fe6aSInna Palant
9*fa44fe6aSInna PalantThis library attempts to bridge the gap between [AppCompat][appcompat] XML themes, and themes in [Jetpack Compose][compose],
10*fa44fe6aSInna Palantallowing your composable [`MaterialTheme`][materialtheme] to be based on the `Activity`'s XML theme:
11*fa44fe6aSInna Palant
12*fa44fe6aSInna Palant``` kotlin
13*fa44fe6aSInna PalantAppCompatTheme {
14*fa44fe6aSInna Palant    // MaterialTheme.colors and MaterialTheme.typography
15*fa44fe6aSInna Palant    // will now contain copies of the context's theme
16*fa44fe6aSInna Palant}
17*fa44fe6aSInna Palant```
18*fa44fe6aSInna Palant
19*fa44fe6aSInna PalantFor more information, visit the documentation: https://google.github.io/accompanist/themeadapter-appcompat
20*fa44fe6aSInna Palant
21*fa44fe6aSInna Palant## Download
22*fa44fe6aSInna Palant
23*fa44fe6aSInna Palant```groovy
24*fa44fe6aSInna Palantrepositories {
25*fa44fe6aSInna Palant    mavenCentral()
26*fa44fe6aSInna Palant}
27*fa44fe6aSInna Palant
28*fa44fe6aSInna Palantdependencies {
29*fa44fe6aSInna Palant    implementation "com.google.accompanist:accompanist-themeadapter-appcompat:<version>"
30*fa44fe6aSInna Palant}
31*fa44fe6aSInna Palant```
32*fa44fe6aSInna Palant
33*fa44fe6aSInna PalantSnapshots of the development version are available in Sonatype's `snapshots` [repository][snap]. These are updated on every commit.
34*fa44fe6aSInna Palant
35*fa44fe6aSInna Palant[appcompat]: https://developer.android.com/jetpack/androidx/releases/appcompat
36*fa44fe6aSInna Palant[compose]: https://developer.android.com/jetpack/compose
37*fa44fe6aSInna Palant[materialtheme]: https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#materialtheme
38*fa44fe6aSInna Palant[snap]: https://oss.sonatype.org/content/repositories/snapshots/com/google/accompanist/accompanist-themeadapter-appcompat/
39