Zhuinden / fragmentviewbindingdelegate-kt

[ACTIVE] A delegate for making managing the ViewBinding variable in a Fragment simpler.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Activity support

DonnyRozendal opened this issue · comments

Could you add the function for Activities as well? Currently this library is only usable for Fragments.

Theoretically yes, but the reason why I didn't is because there was a crash I got when using ActivityMainBinding.inflate() instead of setContentView(R.layout.activity_main) + ActivityMainBinding.bind(findViewById(Window.ID_ANDROID_CONTENT)) and I find that a bit loopy to explain to people and didn't end up adding the inflate variant to this library as a result

As this repo is called fragment-viewbindingdelegate-kt, I won't add activity-viewbindingdelegate-kt to it.

I will think about whether it's a good idea to release the activity variant in that format, though. That one issue with using .inflate instead of setContentView still bothers me.

Fair enough, thanks for the explanation!

i haven't tried but this could be alternative for activity viewbinding delegate