How to Ignore view component(s) that I do not want to create bindings in Android view Binding library?
Asked Answered
C

1

14

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?

Coronagraph answered 31/1, 2020 at 4:50 Comment(0)
C
20

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

Coronagraph answered 31/1, 2020 at 4:50 Comment(3)
Much needed thing.Demilitarize
needs to be a way to do it true by default! Need to update hundreads of files.Cageling
I really appreciate it bro.Knop

© 2022 - 2024 — McMap. All rights reserved.