I created a custom style:
<style name="Static">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginEnd">5dp</item>
</style>
Then I extended anko with a static function:
inline fun ViewManager.static(theme: Int = R.style.Static, init: TextView.() -> Unit) = ankoView(::TextView, theme, init)
When I use this in my layout:
static { text = resources.getString(R.string.name) }
The marginEnd value is ignored.
If I add a margin manually in anko:
static { text = resources.getString(R.string.name) }.lparams { marginEnd = dip(5) }
The margin is fine.
Do you guys know what is happening that anko is ignoring my margin value or any other way to define a predefined margin for a extended view anko function?