Search code examples
androidkeyboard

Simple Mobile Tools Keyboard set theme color


I'm trying to build the Android project Simple-Keyboard and have the default theme be "Black & White" because the default theme of Dark is too dark for my users. I tried changing the theme in styles.xml:

<style name="AppTheme" parent="AppTheme.BlackAndWhite" />

But it still defaults to the dark theme. I also looked over the code of which most of it resides in the Simple-Commons project and couldn't figure out a code change to make this the default. I don't want to have to set it manually from the app for every user so that is why I would like to achieve this from either code and/or styles/manifest files.

Simple-Keyboard Simple-Commons


Solution

  • I figured it out and the solution is in Simple-Commons repository. You need to change two values in commons/src/main/res/values/colors.xml. For me I wanted the Black & White theme so I changed:

    <color name="theme_dark_text_color">@color/md_grey_200</color>
    <color name="theme_dark_background_color">@color/md_grey_800</color>
    

    to:

    <color name="theme_dark_text_color">@color/md_grey_black</color>
    <color name="theme_dark_background_color">@color/md_grey_white</color>
    

    It appears most of the theming when changing it from code is based on color calculations based on the two "default dark theme" values.