Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is ViewBinding GeneratedCode

How/Where Can I find the generated code for ViewBinding?

whenever I try control+click/control+b to see the declaration, AndroidStudio just opens the XML layout.

like image 595
seyed Jafari Avatar asked Mar 02 '20 21:03

seyed Jafari


People also ask

What is ActivityMainBinding in Android?

xml so the corresponding generated class is ActivityMainBinding . This class holds all the bindings from the layout properties (for example, the user variable) to the layout's views and knows how to assign values for the binding expressions.

What is data binding and view binding in Android?

The one and only function of View Binding is to bind the views in the code, while Data Binding offers some more options like Binding Expressions, which allows us to write expressions the connect variables to the views in the layout.

What is Br in Kotlin?

BR is the a Bindable Resource. Similar to your R reference object, this is just a collection of static integers referencing specific views. A naive implementation of this pattern for an imaginary game could look something like: @Bindable var currentLevel = levelManager.


1 Answers

The generate binding classes reside in app > build > generated > data_binding_base_class_source_out > debug > your app package > databinding

A you can see in the following screenshot all my ViewBinding classes for XML layout are inside the above path

Screeen shot of generated classes path

like image 177
Somesh Kumar Avatar answered Sep 17 '22 17:09

Somesh Kumar