-
Notifications
You must be signed in to change notification settings - Fork 74
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
Image Preloading. #495
Closed
Closed
Image Preloading. #495
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- moved it in different file
- created kotlin class for cache - converted legacy gif and image cache in kotlin - CtCaches holds all the caches for in-apps feature for CT - Minor refactoring
- as per legacy code
- changed Ct caches signature to not have concrete class ref
- passing logger is optional
- added code to save data in files, as a bytearray stream
- properly to lru cache
- exposed caches for disk and made 2 entries for image and gif
- moved to comp object
- func to fetch and cache image. - caching is handled internally.
- the inheritance is correctly used - also changed interface signature to non nullable
- we did not need val. - props are better immutable as not changed.
- added func to save byte array in response - we changed logic to get in byte[] data and then make bitmap out of it. - we will return both byte[] and bitmap so that we can cache data as well.
- we need the byte array for caching in the file. - we wil reuse code for bitmap download in app.
- it not also contains the byte array of data - this will help us in saving to cache
- fetch method for network - cached method for checking from cache - InAppImageProvider.kt is intented to use to fetch any image needed for inapps feature.
…into lp/in_app_caching
- utils class comp errors removed - java-kt default argument issue
- fetch image functionality - provides bitmap/byte data as needed - made method inline to get generic type
- added functionality to fetch and save gif in cache - the gif cache is configured similar to inapps image cache
- extracted code for api call
- exposed method to take list of urls as args - we cannot enforce priority, we will need to support those changes
- passed dispatcher provider as dependency
- added read timeout - added connection timeout
- we have reused bitmap download code which is used in Push templates
- checked in cached file has a valid bitmap.
- delete image and gif methods added
- In app image provider renamed
- used resource provider to fetch the image and gif and removed previous image cache code.
- fixed the cache directory names
- used to cache and also for deleting resources
- safe refactor to extract variables
- we need to handle null key as LRU cache will internally throw exception
- we used media provider for inapps module to fetch cached image and gif data
- there was compilation prob - fixed as i passed argument
- deleted legacy cache classes
- assigned bytes to bitmap response - we missed assigning to DownloadedBitmap class
- we correctly initialised the manager - we did not have config to get logger which was causing a crash pre commit.
- created hashing method which can be passed on to file cache, this is needed to cache url to unique key
- separated uuid/hash generation logic for url key in cache.
- added test to verify file cache
This was referenced Nov 7, 2023
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://wizrocket.atlassian.net/browse/SDK-3362
Plan: