-
Notifications
You must be signed in to change notification settings - Fork 259
Adding a new theme
A theme in Clover is a collection of new colors for the various elements in the app.
Themes can be added to Clover without knowing a programming language. Only a few changes need to be made to the code for each theme, the rest is editing a xml file.
First, set up Android studio as described in the "building clover" page.
Edit the styles file located at app/src/main/res/values/styles.xml
. Each theme either extends a light or a dark theme. Themes inherit all values by default from their parent theme, and you can override each value if needed. The black theme for example inherits from the dark theme and only changes a few values to make it completely black.
Add your own style block by copying one of the other themes and start editing the colors.
Next, add your theme to the code. Go to app/src/main/java/org/floens/chan/ui/theme/ThemeHelper.java
. Add your theme in the constructor below the others. The first argument is the name the user will see, the second will be stored in the preference file and must consist of only letters and underscores, the third argument is a reference to the xml block, and the last is the main primary color for the theme. The primary color is the color for the toolbar etc.
Run the app by pressing the debug button at the top.
If you're satisfied with your theme you can make a pull request as also described in the "building clover" page. Good luck!
Guides:
How to build Clover
Adding a site
Add a new theme
Rambling:
Clover UI infrastrucure