Just made a big push to Anvil repository - it can now inflate layout from XMLs! This means you may use your favourite IDE to design layouts, then use Anvil to bind data and event listeners to make your UI reactive:
public override fun view() {
// A designer gave us an XML with some fancy layout:
// a viewgroup with a button and a progress bar in it
xml(R.layout.my_layout) {
backgroudnColor(Settings.bgColor) // will modify root layout view color
withId(R.id.my_button) {
// button state may depend on some variable
enabled(isMyButtonEnabled)
// button click listener can be attached
onClick { v ->
...
}
}
withId(R.id.my_progress_bar) {
visible(isMyProgressBarShown)
progress(someProgressValue)
}
}
}
I know many people are opposed to defining layouts in code, so this can be a good compromise for them. Also, it's very helpful if you have a large project made with XMLs and want to refactor it.