diff options
author | Maurice Lam <yukl@google.com> | 2016-12-19 11:46:55 -0800 |
---|---|---|
committer | Maurice Lam <yukl@google.com> | 2017-01-10 10:47:33 -0800 |
commit | 7514f1cee29b3feb4822ce16945c1c312057d24f (patch) | |
tree | d345c2b45f0b7641dae6301f2b2c50457c525474 /library/main/res/values/attrs.xml | |
parent | 035ba6bda68e78bbb49424300bdd3f0fb305b9e7 (diff) | |
download | setupwizard-7514f1cee29b3feb4822ce16945c1c312057d24f.tar.gz |
Implement Mixins for Templates
Implement Mixin functionalities, which defines part of a template
layout, making it reusable in different layouts. For example, the
HeaderMixin allows setting and getting the header text via the mixin,
which allows for clients which uses multiple different layuots to
simplify their code via something like
layout.getMixin(HeaderMixin.class).setText("Foobar");
Bug: 34163318
Test: ./gradlew connectedAndroidTest
Change-Id: I4348c8bb5b8e640b49c2be0c79c70aa85cf0ebc0
Diffstat (limited to 'library/main/res/values/attrs.xml')
-rw-r--r-- | library/main/res/values/attrs.xml | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/library/main/res/values/attrs.xml b/library/main/res/values/attrs.xml index 1fedecc..984b6cd 100644 --- a/library/main/res/values/attrs.xml +++ b/library/main/res/values/attrs.xml @@ -35,7 +35,6 @@ <!-- Custom view attributes --> <attr name="suwColorPrimary" format="color" /> <attr name="suwHeader" format="reference" /> - <attr name="suwHeaderText" format="string" localization="suggested" /> <attr name="suwDividerInset" format="dimension|reference" /> <attr name="suwItemDescriptionStyle" format="reference" /> @@ -52,10 +51,7 @@ </declare-styleable> <declare-styleable name="SuwGlifLayout"> - <attr name="android:icon" /> <attr name="suwColorPrimary" /> - <attr name="suwHeaderColor" format="reference|color" /> - <attr name="suwHeaderText" /> </declare-styleable> <declare-styleable name="SuwGlifListLayout"> @@ -75,7 +71,6 @@ <declare-styleable name="SuwSetupWizardLayout"> <attr name="suwBackground" format="color|reference" /> <attr name="suwBackgroundTile" format="color|reference" /> - <attr name="suwHeaderText" /> <attr name="suwDecorPaddingTop" format="dimension|reference" /> <attr name="suwIllustration" format="color|reference" /> <attr name="suwIllustrationAspectRatio" format="float|reference" /> @@ -122,4 +117,16 @@ <attr name="android:theme" /> </declare-styleable> + <declare-styleable name="SuwHeaderMixin"> + <attr name="suwHeaderText" format="string" localization="suggested" /> + </declare-styleable> + + <declare-styleable name="SuwColoredHeaderMixin"> + <attr name="suwHeaderColor" format="reference|color" /> + </declare-styleable> + + <declare-styleable name="SuwIconMixin"> + <attr name="android:icon" /> + </declare-styleable> + </resources> |