ruboto/ruboto — pull request #195 by KentonWhite (2012-06-26 20:42:06+00:00)
Title: Added :margins parameter to View

In the Android SDK, margins are set within the layout holding the view, along with height & width.

In Ruboto, a View can accept the keywords height & width directly (as well as specifying them in the layout block for the view).

For consistency, allow the View to also accept the margins keyword.

All parameters that can be passed to the layout block are unaffected.

Example:

text_view :margins => [100,50,0,0]

is equivalent to

text_view :layout => {:set_margins => [100,50,0,0]}

which is equivalent to

text_view :layout => {:left_margin= => 100, :right_margin= => 50}

I apologize for not including a test. I struggled with understanding where best to include such a test in the Ruboto test framework. If you can suggest a suitable place to include the test, perhaps pointing me to a similar example test, I am more than happy to write one.