You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 20, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,20 +80,22 @@ ThemeColor.BLACK
80
80
81
81
### Using Themes
82
82
83
-
Any `Activity` you wish to be automatically themed must inherit from either `CActivity` or `CAppCompatActivity` if you wish to use AppCompat
83
+
Any `Activity` you wish to be automatically themed must inherit from either `CActivity`, `CAppCompatActivity` if you wish to use AppCompat or `CMaterialActivity` if you wish to use the new Material Componets theme.
84
84
```kotlin
85
85
classMainActivity : CActivity()
86
86
```
87
87
```kotlin
88
88
classMainActivity : CAppCompatActivity()
89
89
```
90
+
```kotlin
91
+
classMainActivity : CMaterialActivity()
92
+
```
90
93
If you wish to use your own activity, you can manually apply Colorful's theme to any activity using `apply(activity:Activity)`
The `override` value will control whether Colorful overrides your activitie's existing base theme, or merely sets primary and accent colors. **Note**: dark/light themeing will not work when override is disabled
95
-
The `appcompat` value will control which base theme Colorful will use, Appcompat or Material
96
-
*Note*: The override value is optional and may be omitted. Default value is true.
98
+
The `baseTheme` value will control which base theme Colorful will use, Appcompat, Material, or Material Componets.
97
99
98
100
Alternatively, as of Colorful 2.1, you can now have your activity inherit from the interface `CThemeInterface` which will provide the `handleOnCreate` and `handleOnResume` methods for automatic theme handling.
99
101
See both [CActivity](https://github.com/garretyoder/Colorful/blob/master/library/src/main/java/io/multimoon/colorful/CActivity.kt) and [CAppCompatActivity](https://github.com/garretyoder/Colorful/blob/master/library/src/main/java/io/multimoon/colorful/CAppCompatActivity.kt) for examples on how to implement the `CThemeInterface`
0 commit comments