Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Theme Adapter] Migrate all theme adapter libraries to Accompanist #1410

Merged
merged 9 commits into from Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/theme-adapter-core-bug-report .md
@@ -0,0 +1,16 @@
---
name: Core Theme Adapter bug report
about: Create a report to help us improve
title: "[Core Theme Adapter]"
labels: ''
assignees: ricknout

---

**Description**

**Steps to reproduce**

**Expected behavior**

**Additional context**
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/theme-adapter-material-bug-report copy.md
@@ -0,0 +1,16 @@
---
ricknout marked this conversation as resolved.
Show resolved Hide resolved
name: Material Theme Adapter bug report
about: Create a report to help us improve
title: "[Material Theme Adapter]"
labels: ''
assignees: ricknout

---

**Description**

**Steps to reproduce**

**Expected behavior**

**Additional context**
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/theme-adapter-material3-bug-report.md
@@ -0,0 +1,16 @@
---
name: Material 3 Theme Adapter bug report
about: Create a report to help us improve
title: "[Material 3 Theme Adapter]"
labels: ''
assignees: ricknout

---

**Description**

**Steps to reproduce**

**Expected behavior**

**Additional context**
12 changes: 9 additions & 3 deletions README.md
Expand Up @@ -34,8 +34,14 @@ For stable versions of Compose, we use the latest *stable* version of the Compos
### 🍫 [System UI Controller](./systemuicontroller/)
A library that provides easy-to-use utilities for recoloring the Android system bars from Jetpack Compose.

### 🎨 [AppCompat Theme Adapter](./appcompat-theme/)
A library that enables the reuse of [AppCompat][appcompat] XML themes for theming in Jetpack Compose.
### 🎨 [AppCompat Theme Adapter](./themeadapter-appcompat/)
A library that enables the reuse of [AppCompat][appcompat] XML themes, for theming in Jetpack Compose.

### 🎨 [Material Theme Adapter](./themeadapter-material/)
A library that enables the reuse of [MDC-Android][mdc] Material 2 XML themes, for theming in Jetpack Compose.

### 🎨 [Material 3 Theme Adapter](./themeadapter-material3/)
A library that enables the reuse of [MDC-Android][mdc] Material 3 XML themes, for theming in Jetpack Compose.

### 📖 [Pager](./pager/)
A library that provides utilities for building paginated layouts in Jetpack Compose, similar to Android's [ViewPager][viewpager].
Expand Down Expand Up @@ -115,7 +121,7 @@ limitations under the License.
[appcompat]: https://developer.android.com/jetpack/androidx/releases/appcompat
[compose]: https://developer.android.com/jetpack/compose
[snap]: https://oss.sonatype.org/content/repositories/snapshots/com/google/accompanist/
[mdc]: https://material.io/develop/android/
[mdc]: https://github.com/material-components/material-components-android
[windowinsets]: https://developer.android.com/reference/kotlin/android/view/WindowInsets
[viewpager]: https://developer.android.com/reference/kotlin/androidx/viewpager/widget/ViewPager
[runtimepermissions]: https://developer.android.com/guide/topics/permissions/overview
37 changes: 0 additions & 37 deletions appcompat-theme/README.md

This file was deleted.

This file was deleted.

36 changes: 19 additions & 17 deletions docs/appcompat-theme.md → docs/themeadapter-appcompat.md
@@ -1,8 +1,8 @@
# AppCompat Compose Theme Adapter
# AppCompat Theme Adapter

[![Maven Central](https://img.shields.io/maven-central/v/com.google.accompanist/accompanist-appcompat-theme)](https://search.maven.org/search?q=g:com.google.accompanist)
[![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)

A library that enables reuse of [AppCompat][appcompat] XML themes for theming in [Jetpack Compose][compose].
A library that enables the reuse of [AppCompat][appcompat] XML themes, for theming in [Jetpack Compose][compose].

The basis of theming in [Jetpack Compose][compose] is the [`MaterialTheme`][materialtheme] composable, where you provide [`Colors`][colors], [`Shapes`][shapes] and [`Typography`][typography] instances containing your styling parameters:

Expand Down Expand Up @@ -37,9 +37,10 @@ AppCompatTheme {
This is especially handy when you're migrating an existing app, a fragment (or other UI container) at a time.

!!! caution
If you are using [Material Design Components](https://material.io/develop/android/) in your app, you should use the
[MDC Compose Theme Adapter](https://github.com/material-components/material-components-android-compose-theme-adapter)
instead, as it allows much finer-grained reading of your theme.
If you are using [Material Design Components][mdc] in your app, you should use the
[Material Theme Adapter](https://github.com/google/accompanist/tree/main/themeadapter-material) or
[Material 3 Theme Adapter](https://github.com/google/accompanist/tree/main/themeadapter-material3)
instead, as they allow much finer-grained reading of your theme.


### Customizing the theme
Expand Down Expand Up @@ -126,15 +127,15 @@ There are some known limitations with the implementation at the moment:

## Usage

[![Maven Central](https://img.shields.io/maven-central/v/com.google.accompanist/accompanist-appcompat-theme)](https://search.maven.org/search?q=g:com.google.accompanist)
[![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)

``` groovy
repositories {
mavenCentral()
}

dependencies {
implementation "com.google.accompanist:accompanist-appcompat-theme:<version>"
implementation "com.google.accompanist:accompanist-themeadapter-appcompat:<version>"
}
```

Expand All @@ -152,7 +153,7 @@ Make sure to read the [Contributing](../contributing) page first though.
## License

```
Copyright 2020 The Android Open Source Project
Copyright 2022 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -167,11 +168,12 @@ See the License for the specific language governing permissions and
limitations under the License.
```

[compose]: https://developer.android.com/jetpack/compose
[appcompat]: https://developer.android.com/jetpack/androidx/releases/appcompat
[appcompattheme]: ../api/appcompat-theme/appcompat-theme/com.google.accompanist.appcompattheme/-app-compat-theme.html
[createappcompattheme]: ../api/appcompat-theme/appcompat-theme/com.google.accompanist.appcompattheme/create-app-compat-theme.html
[materialtheme]: https://developer.android.com/reference/kotlin/androidx/compose/material/MaterialTheme
[shapes]: https://developer.android.com/reference/kotlin/androidx/compose/material/Shapes
[colors]: https://developer.android.com/reference/kotlin/androidx/compose/material/Colors
[typography]: https://developer.android.com/reference/kotlin/androidx/compose/material/Typography
[compose]: https://developer.android.com/jetpack/compose
[mdc]: https://github.com/material-components/material-components-android
[appcompat]: https://developer.android.com/jetpack/androidx/releases/appcompat
[appcompattheme]: ../api/themeadapter-appcompat/com.google.accompanist.themeadapter.appcompat/-app-compat-theme.html
[createappcompattheme]: ../api/themeadapter-appcompat/com.google.accompanist.themeadapter.appcompat/create-app-compat-theme.html
[materialtheme]: https://developer.android.com/reference/kotlin/androidx/compose/material/MaterialTheme
[colors]: https://developer.android.com/reference/kotlin/androidx/compose/material/Colors
[typography]: https://developer.android.com/reference/kotlin/androidx/compose/material/Typography
[shapes]: https://developer.android.com/reference/kotlin/androidx/compose/material/Shapes
55 changes: 55 additions & 0 deletions docs/themeadapter-core.md
@@ -0,0 +1,55 @@
# Core Theme Adapter

[![Maven Central](https://img.shields.io/maven-central/v/com.google.accompanist/accompanist--themeadapter-core)](https://search.maven.org/search?q=g:com.google.accompanist)

A library that includes common utilities that enable the reuse of XML themes, for theming in [Jetpack Compose][compose].

See the [API][api] for more details.

---

## Usage

[![Maven Central](https://img.shields.io/maven-central/v/com.google.accompanist/accompanist-themeadapter-core)](https://search.maven.org/search?q=g:com.google.accompanist)

``` groovy
repositories {
mavenCentral()
}

dependencies {
implementation "com.google.accompanist:accompanist-themeadapter-core:<version>"
}
```

### Library Snapshots

Snapshots of the current development version of this library are available, which track the latest commit. See [here](../using-snapshot-version) for more information on how to use them.

---

## Contributions

Please contribute! We will gladly review any pull requests.
Make sure to read the [Contributing](../contributing) page first though.

## License

```
Copyright 2022 The Android Open Source Project

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

https://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.
```

[compose]: https://developer.android.com/jetpack/compose
[api]: ../api/themeadapter-core