Ch. 19 Data Binding includes View Binding?

(Placing this here since there is no category for Ch. 19)

After completing the BeatBox chapters with Data Binding, I started looking in to the Jetpack View Binding. It appears from the Chapter 19 writeup that the Data Binding implementation includes View Binding as well.

Listing 19.4 and 19.5 contain the following two statements which shows the View Binding.

val binding: ActivityMainBinding = DataBindingUtil.setContentView(this, R.layout.activity_main)
binding.recyclerView.apply {
    layoutManager = GridLayoutManager(context, 3)
}

Could we replace the first line with the following to do the explicit View Binding?

val binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)

yup, however you’ll lose any data binding features such as xml variables and two-way binding: https://developer.android.com/topic/libraries/view-binding

personally I like the separation. I really didn’t advantage of two-way binding except for loading images with picasso which was pretty neat.