|
@@ -58,8 +58,12 @@ public class OptionsPresenter {
|
58
|
58
|
if (options.layout.backgroundColor.hasValue()) {
|
59
|
59
|
view.setBackgroundColor(options.layout.backgroundColor.get());
|
60
|
60
|
}
|
61
|
|
- if (options.layout.topMargin.hasValue()) {
|
62
|
|
- ((MarginLayoutParams) view.getLayoutParams()).topMargin = options.layout.topMargin.get();
|
|
61
|
+ applyTopMargin(view, options);
|
|
62
|
+ }
|
|
63
|
+
|
|
64
|
+ private void applyTopMargin(View view, Options options) {
|
|
65
|
+ if (view.getLayoutParams() instanceof MarginLayoutParams) {
|
|
66
|
+ ((MarginLayoutParams) view.getLayoutParams()).topMargin = options.layout.topMargin.get(0);
|
63
|
67
|
}
|
64
|
68
|
}
|
65
|
69
|
|