Skip to content

Instantly share code, notes, and snippets.

@juniorz
Created May 30, 2011 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juniorz/998350 to your computer and use it in GitHub Desktop.
Save juniorz/998350 to your computer and use it in GitHub Desktop.
Hello Views (Relative Layout) using Droid DSL
/*
* Relative Layout Example
* Based on: http://developer.android.com/resources/tutorials/views/hello-relativelayout.html
*/
application "Hello, Android!" com.example.android.hellodroid {
activity HelloDroid {
=> show main
}
relative layout main {
properties {
layout: {
width: fill_parent
height: fill_parent
}
}
textView: <label> "Type here:" {
layout: {
width: fill_parent
height: wrap_content
}
}
editText: <entry> "" {
background: @drawable "editbox_background"
layout: {
width: fill_parent
height: wrap_content
below: label
}
}
button: <ok> "OK" {
layout: {
width: wrap_content
height: wrap_content
below: entry
alignParentRight: TRUE
marginLeft: 10dp //or dip
}
}
button: "Cancel" {
layout: {
width: wrap_content
height: wrap_content
toLeftOf: ok
alignTop: ok
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment