-
Notifications
You must be signed in to change notification settings - Fork 542
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
add singleton image loader, remove unused libs, increase disk & decrease memory cache #1396
base: master
Are you sure you want to change the base?
Conversation
.respectCacheHeaders(false) | ||
/** !Only use default placeholders and errors, if not using this instance for local | ||
* image buttons because when animating this will appear or in more cases **/ | ||
//.placeholder(R.drawable.logo) | ||
//.error(R.drawable.logo) | ||
.allowHardware(true) | ||
.allowHardware(false) // takes a toll on battery (only allow if app is like instagram or photos) |
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 this really the case? I thought hardware bitmaps enabled the hardware to save energy by "offloading the work to dedicated co-processors". Can you link where you got this information or explain more in detail.
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.
the theory is hw decoding works well only in devices that are recent maybe like sdk int > 28, (point where snapdragon 636 arrived and mediatek started to get a lot better with g85, g90T) and it is only needed to render large bitmaps.
actually we are fucked instacart released coil 3 in which we dont need our own singleton instead we should inherit their factory in application class
inshort alternatively we can set sdk int > 28 instead of false or true if you think it will be better
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.
This does not work on image resources, like the source profiles.
fixed load bitmap from drawable, and for the hardware thing, we got software render error, because coil themselves have to solve that bitmap render issue on unsupported device |
@fire-light42 should we use okhttp client from requests helper here instead of building? |
Yes |
i tried to add it, the base client is very confusing, do we set there for each network request, i hope this works same, app is working fine for me |
annotation processors are now needed if we shift to room sqlite or DI, kapt & ksp were for glide so as transformation lib