Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

IndusAryan
Copy link
Contributor

annotation processors are now needed if we shift to room sqlite or DI, kapt & ksp were for glide so as transformation lib

.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)
Copy link
Collaborator

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.

Copy link
Contributor Author

@IndusAryan IndusAryan Oct 28, 2024

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

@IndusAryan IndusAryan marked this pull request as draft October 28, 2024 19:55
@IndusAryan IndusAryan changed the title remove unused libs, increase disk cache and decrease memory cache add singleton image loader, remove unused libs, increase disk cache and decrease memory cache Oct 29, 2024
@IndusAryan IndusAryan marked this pull request as ready for review October 29, 2024 17:53
@IndusAryan IndusAryan changed the title add singleton image loader, remove unused libs, increase disk cache and decrease memory cache add singleton image loader, remove unused libs, increase disk & decrease memory cache Oct 30, 2024
Copy link
Collaborator

@fire-light42 fire-light42 left a 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.

@IndusAryan
Copy link
Contributor Author

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

@IndusAryan
Copy link
Contributor Author

@fire-light42 should we use okhttp client from requests helper here instead of building?

@fire-light42
Copy link
Collaborator

@fire-light42 should we use okhttp client from requests helper here instead of building?

Yes

@IndusAryan
Copy link
Contributor Author

IndusAryan commented Nov 16, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants