Skip to content

Releases: ouchadam/themr

36

04 May 14:04
Compare
Choose a tag to compare
  • Adding mapping generator to avoid needing to use a runtime look up
ThemR.get(R.style.Dark, R.style.AppTheme) // returns R.style.Dark_AppTheme

25

04 May 08:22
Compare
Choose a tag to compare
25
  • Adds support for separate source locations by making the source option take a list file names.
source = ["dark-themes", "light-themes", "palettes"]

22

26 Apr 16:17
Compare
Choose a tag to compare
22
  • Adds support for usage in android library projects

18

05 Apr 07:30
Compare
Choose a tag to compare
18

Ports style parsing from regex to a real xml parser

  • Fixes stackoverflow when using large themr files

Initial Release (12)

01 Apr 12:38
Compare
Choose a tag to compare

Theme concatenation via gradle plugin

res/values/themr.xml

<style name="PaletteLight">
  <item name="brandColor">#008577</item>
</style>

<style name="PaletteDark">
  <item name="brandColor">#000000</item>
</style>

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
  <item name="colorPrimary">?attr/brandColor</item>
</style>

build.gradle

themr {
  combinations = ["AppTheme": ["PaletteLight", "PaletteDark"]] // map of themes to palettes
  source = "themr" // res/values/ filename to scan for styles, defaults to themr 
}

Generated styles

<style name="PaletteLight_AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
  <item name="brandColor">#008577</item>
  <item name="colorPrimary">?attr/brandColor</item>
</style>

<style name="PaletteDark_AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
  <item name="brandColor">#000000</item>
  <item name="colorPrimary">?attr/brandColor</item>
</style>