Created
May 30, 2011 01:52
-
-
Save juniorz/998350 to your computer and use it in GitHub Desktop.
Hello Views (Relative Layout) using Droid DSL
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
/* | |
* 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