-
Notifications
You must be signed in to change notification settings - Fork 4
Propoid ui
svenmeier edited this page Jan 18, 2012
·
9 revisions
With propoid-ui you can bind a property to a view with a single line of code:
TextBinding.string(foo.stringProperty, editText);All changes to the property are automatically propagated to the view and vice versa.
Converters allow conversion for a TextBinding:
new TextBinding(foo.intProperty, editText, new NumberConverter(R.string.NO_NUMBER));For String and Number properties appropriate factory methods make it simpler:
TextBinding.number(foo.intProperty, editText);Conversion errors are automatically reported on the view.
Boolean properties can be bound to CheckBox views view CheckBinding:
new CheckBinding(foo.booleanProperty, checkBox);Properties can be bound to a spinner via SpinnerBinding:
new SpinnerBinding(foo.barProperty, spinner, listAdapter);A Converter allows you to use a list or varargs for the choices:
new SpinnerBinding(foo.barProperty, spinner, converter, bar1, bar2, bar3);For String, Number and Enum properties appropriate factory methods make it even simpler:
SpinnerBinding.number(foo.intProperty, spinner, 100, 200, 300);