Android-Animated-Theme-Manager icon indicating copy to clipboard operation
Android-Animated-Theme-Manager copied to clipboard

Pass layout in activity constructor

Open DatL4g opened this issue 3 years ago • 3 comments

⚠️ Is your feature request related to a problem? Please describe

I'm normally using a viewbinding library to simplify the process and prevent memory leaks. ViewBindingPropertyDelegate

The library wants me to pass the layout in the activity constructor as described in the README. This makes it impossible to use with this Theme-Manager.

💡 Describe the solution you'd like

It would be nice if this library were compatible with ViewBindingPropertyDelegate and the best option for this would be if it's possible to pass the layout in the constructor.

🤚 Do you want to develop this feature yourself?

  • [ ] Yes
  • [x] No

DatL4g avatar Jan 29 '22 17:01 DatL4g

As a workaround the noreflection version can be used with CreateMethod.INFLATE

DatL4g avatar Apr 13 '22 17:04 DatL4g

So, basically, you didn't fix anything. Correct? I just encountered the same problem. I receive this exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.samprojre/com.example.samprojre.screens.main.MainActivity}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.

krutzzz avatar Aug 24 '22 09:08 krutzzz

@krutzzz I fixed a bunch of things but it's already 7months ago and I don't know what in detail.

All I know is that in my fork (available on jitpack) it's possible to use the Fragment constructor.

And the activity constructor can't be used however it's possible to use the inflate create method with that it works

DatL4g avatar Aug 25 '22 17:08 DatL4g