-
Notifications
You must be signed in to change notification settings - Fork 548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(refactor): replace glide with coil image loading library (fast & small) #1368
Conversation
I can maybe understand why to use coil over glide. However I dont understand why you have to break the setImage API with some new API, as it was quite literally made to be replaceable??? |
i have tested in many screens and many extensions, i have not encountered any breakpoint, the UIHelper was modified because loadImage is present in coil module so that we can stick to one instance and coil doesn't support drawable res, instead default input formats and presets |
i also reformatted to a proper text util and its location plus introduced a header object |
@@ -1,17 +1,13 @@ | |||
package com.lagradost.cloudstream3.ui.result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason behind this package move? It is a breaking change, so it needs to be a good reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not encountered any issue, the file name should be textutil instead of uitext as image functions have been removed, location was also in wrong package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can merge this, but some extensions may break due to UiText.
i think extension devs need to be pinged for changes immediately after merge so that they can update few |
After testing this PR, I have to say that it is has several issues, but all of them stem from your weak typing of Any? and as such it fails to load on several places. Your removal of UiImage also prevents any strong typing making it impossible to use the type system correctly. Due to this I will fix this issues myself. |
@fire-light42 can you specify certain location where loading fails ? the any supports all types we load if we look at the load function inside library |
There is two places where the Any type caused problems, one was I dont see why you need to use Any when it just causes these types of bugs. |
Lets hope this does not break stable or pre too hard. |
yeah,, can you tell the repo name in which you faced problem, type safety is good and robust but unfortunaetely i am just comparing latest pre and my debug hand to hand in same device and both account images in select activity , the bottom sheet, setting fragment are loading properly plus the repo images also ! |
This PR breaks the API in two ways, the first is that registerVideoClickAction(VideoClickAction) where VideoClickAction has abstract val name: UiText. Some providers may also use some custom settings to load loading images or do stuff in the custom action if TvType=CustomMedia. |
understood now, thank you. |
In my case it is bit slower |
old caches cleared, new disk caches, memory caches and http caches will be built slowly and size will be raised gradually, i forgot to include crossfade also so it looks like rapid load |
🔥
coil is native and faster
is small
no conditions for error placeholder visibility
unlike glide where multiplt instances with different contexts were used, we now use a global synchronized instance for all builders through application class
expect performance improvements and smaller apk