Skip to content

Initial Release (12)

Latest
Compare
Choose a tag to compare
@ouchadam ouchadam released this 05 Mar 13:19
5a21949

kapt attribute parser

Supports

  • @Dimension Float
  • @ColorInt Int
  • @Px Int
  • @IdRes Int
  • Float
  • Boolean
  • Int
  • Drawable

Usage

Declare collections of attributes as data classes

@Attr // mark data class for processing
data class ThemeAttributes(
    @Attr.Id(R.attr.colorPrimary) @ColorInt val colorPrimary: Int, // explicitly specify the attribute id
    @Attr.Id(-1) val missingAttribute: Drawable?, // allow attribute to be unavailable
    @ColorInt val colorPrimaryDark: Int // infer attribute id from parameter name
)

Using circleci build number as the version to keep things super simple