13

I am exploring new Android View Binding library.

In my layout XML file, some views that I don't want to include in my binding class.

Does there any attribute or mechanism exist that exclude views into generated Binding class?

Micer
  • 8,731
  • 3
  • 79
  • 73
pRaNaY
  • 24,642
  • 24
  • 96
  • 146

1 Answers1

18

We can use tools:viewBindingIgnore=”true/false” to include and exclude view in generated view binding class.

Usage:

<LinearLayout
    ...
    tools:viewBindingIgnore="true" >
    ...
</LinearLayout>

Check more about View Binding on below link:

https://developer.android.com/topic/libraries/view-binding#setup

pRaNaY
  • 24,642
  • 24
  • 96
  • 146