Closed badoualy closed 1 year ago
This is not something that we are looking to support
For anyone with the same use-case, one other alternative is to code an interceptor that would do nothing when the current context is not an instance of the wanted activity (unwrapping ContextWrapper, ...).
I'll post the snippet when I'll have time to code it
From what I gathered from the doc and source code, currently we call only call
ViewPump.init
once, and have only one configurationIf we want to add some new interceptors later, we have to call
init
again after getting currently installed interceptors, and add them in the new configIt also means that having an activity specific configuration while maintaining an app wide configuration is possible but complicated
In my case, I have an app-wide configuration, and for one activity, I have to override a specific widget with my own version
ViewPump
parameter to theViewPumpContextWrapper#wrap
method, and then inject theViewPump
instance intoViewPumpLayoutInflater
, and by default make it useViewPump.get()
ViewPump
wouldn't affect it anymore. An easy solution would be to inject null in theViewPumpLayoutInflater
, and when creating a view, if the instance is null, fallback toViewPump.get()
as before. This would prevent any behavior changes