Skip to content

Commit 35e88e4

Browse files
authored
feat: support material3 expressive (#444)
1 parent e308c90 commit 35e88e4

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

.changeset/olive-rockets-take.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-native-bottom-tabs': patch
3+
---
4+
5+
feat: support material3 expressive

docs/docs/docs/guides/android-native-styling.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Available options:
3232
- `material2` - Material Design 2 styling
3333
- `material3` - Material Design 3 styling
3434
- `material3-dynamic` - Material Design 3 styling with dynamic theming (Material You)
35+
- `material3-expressive` - Material Design 3 Expressive styling
3536

3637
## React Native Community CLI users
3738

@@ -69,3 +70,14 @@ If you want to use Material Design 2, you can extend from `Theme.MaterialCompone
6970
</resources>
7071
```
7172

73+
For Material Design 3 Expressive styling, you can use `Theme.Material3Expressive.DayNight.NoActionBar`:
74+
75+
```diff
76+
<resources>
77+
- <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
78+
+ <style name="AppTheme" parent="Theme.Material3Expressive.DayNight.NoActionBar">
79+
<!-- … -->
80+
</style>
81+
</resources>
82+
```
83+

packages/react-native-bottom-tabs/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ dependencies {
107107
//noinspection GradleDynamicVersion
108108
implementation "com.facebook.react:react-native:+"
109109
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
110-
implementation 'com.google.android.material:material:1.13.0-alpha10'
110+
implementation 'com.google.android.material:material:1.14.0-alpha05'
111111

112112
implementation("io.coil-kt.coil3:coil:${COIL_VERSION}")
113113
implementation("io.coil-kt.coil3:coil-network-okhttp:${COIL_VERSION}")

packages/react-native-bottom-tabs/src/expo.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ const MATERIAL3_THEME_DYANMIC =
88
'Theme.Material3.DynamicColors.DayNight.NoActionBar';
99
const MATERIAL3_THEME = 'Theme.Material3.DayNight.NoActionBar';
1010
const MATERIAL2_THEME = 'Theme.MaterialComponents.DayNight.NoActionBar';
11+
const MATERIAL3_EXPRESSIVE_THEME =
12+
'Theme.Material3Expressive.DayNight.NoActionBar';
1113

1214
type ConfigProps = {
1315
/*
1416
* Define theme that should be used.
1517
* @default 'material3'
1618
*/
17-
theme: 'material2' | 'material3' | 'material3-dynamic';
19+
theme:
20+
| 'material2'
21+
| 'material3'
22+
| 'material3-dynamic'
23+
| 'material3-expressive';
1824
};
1925

2026
const withMaterial3Theme: ConfigPlugin<ConfigProps> = (config, options) => {
@@ -28,6 +34,8 @@ const withMaterial3Theme: ConfigPlugin<ConfigProps> = (config, options) => {
2834
style.$.parent = MATERIAL3_THEME_DYANMIC;
2935
} else if (theme === 'material2') {
3036
style.$.parent = MATERIAL2_THEME;
37+
} else if (theme === 'material3-expressive') {
38+
style.$.parent = MATERIAL3_EXPRESSIVE_THEME;
3139
} else {
3240
style.$.parent = MATERIAL3_THEME;
3341
}

0 commit comments

Comments
 (0)