Skip to content

Instantly share code, notes, and snippets.

@stanch
Created September 29, 2013 00:42
Show Gist options
  • Save stanch/6748144 to your computer and use it in GitHub Desktop.
Save stanch/6748144 to your computer and use it in GitHub Desktop.
// if screen width > 1000 dip, make layout horizontal, else make it vertical
l[LinearLayout](...) ~> (minWidth(1000 dp) ? horizontal | vertical)
// use different widget depending on screen width
(widerThan(1000 dp) ? w[BigTextView] |
widerThan(600 dp) ? w[MediumTextView] |
w[TextView]) ~> text("Gibberish")
// tweak a widget only if a condition is met
w[TextView] ~> text("Balderdash!") ~> (hdpi ? TextSize.large)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment