retrofit interceptor on different module in feature-based clean-architecture android

帅比萌擦擦* 提交于 2020-05-16 21:58:12

问题


I've been learning clean architecture with refrence to this-sample and some others, with which I just created a base module, such that all the modules in my project must be implementing it. Here I keep all the Utility classes as well. It helped me a lot to be lazy on basic project setup for dagger, retrofit, etc. I thus got faster easy way on diving into the clean-architecture with feature-based modules.

I've managed my project files in this manner.

The main problem I faced with this structure is to add http-interceptor which handles token response that is visible by only featureauth and featureauth-core. I need the interceptor written here to be added on the retrofit instance provided by base-module to all the modules used in project. P.S I tried circular dependencies in base and featureauth module that gave myself a pretty good smile.

I also want the interceptor to bring out an ERROR-VIEW in the screen without any activity-context [may use application-context] where if I click on retry, starts from the same point it was stopped by error as in functional programming.

来源:https://stackoverflow.com/questions/61489261/retrofit-interceptor-on-different-module-in-feature-based-clean-architecture-and

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!