i register a LibraryGlideModule in my library,but how can i use the API?
hi,when i register a LibraryGlideModule in my lib,it does not generate the GlideApp,how can i use the api in lib?
same problem :/
http://bumptech.github.io/glide/doc/generatedapi.html#getting-started
Added all dependencies. When using AppGlideModule it is generating GlideApp but as I am using glide in a library, adding LibraryGlideModule not generating GlideApp class.
Ah so to be clear, you cannot generate the GlideApp class in libraries, only in applications.
We could theoretically do so, but then you'd have a different GlideApp class per library which would make importing the correct one a challenge.
If you have some special need to use GlideApp in your library, let me know. Otherwise you should just use the non-generated Glide class. It should just have a slightly less convenient API.
I am using that for now. But I just want to know How do we use LibraryGlideModule class because the documentation specifically mention, do not use AppGlideModule in your libraries. As I have used glide in one of open source libraries, I want to provide flexibility to use glide while developing with glide.
Thanks.
You can use LibraryGlideModule to register components automatically. It's only useful if you have components to register (like a networking library, or additional decoders or something similar). If you don't have components to register, you don't need a LibraryGlideModule.
Put another way, if you didn't need a GlideModule in your AndroidManifest.xml with Glide v3, you don't need a LibraryGlideModule with Glide v4. If you did need a GlideModule in Glide v3, you can directly translate your GlideModule into a LibraryGlideModule in v4.
ahh..okay!! Thanks!
@DroidNinja @Carpten I got the same issue My workaround is copying all generated files by Glide. Add them into a module, and add this module as dependence of App-module
All generated files:
CustomGlideModule
GeneratedAppGlideModuleImpl
GeneratedRequestManagerFactory
GlideApp
GlideOptions
GlideRequest
GlideRequests
OkHttpStreamFetcher
OkHttpUrlLoader
Good luck