Created
April 30, 2017 08:46
-
-
Save tatocaster/ff4ac67dcaf9ccc82233d3b1569e52b1 to your computer and use it in GitHub Desktop.
ListItemSpec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@LayoutSpec | |
class ListItemSpec { | |
@OnCreateLayout | |
static ComponentLayout onCreateLayout( | |
ComponentContext c, | |
@Prop(optional = true, resType = ResType.DIMEN_OFFSET) int shadowRadius, | |
@Prop(optional = true) int color, | |
@Prop String title, | |
@Prop String subtitle) { | |
return Column.create(c) | |
.paddingDip(ALL, 16) | |
.backgroundColor(color) | |
.child( | |
Text.create(c) | |
.text(title) | |
.textSizeSp(40)) | |
.child( | |
Text.create(c) | |
.text(subtitle) | |
.textStyle(ITALIC) | |
.textSizeSp(20)) | |
.child(EditText.create(c) | |
.gravity(Gravity.CENTER) | |
.textSizeDip(14) | |
.build()) | |
.build(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment