line-sdk-android
line-sdk-android copied to clipboard
feat: Make image loading customizable and remove Picasso dependency
This commit introduces an ImageLoader interface and LineSdkImageConfig to allow apps to provide their own image loading implementation.
A DefaultImageLoader is provided as a basic, yet efficient, implementation with the following characteristics:
- Caches bitmaps in memory using
LruCacheto reduce network requests and improve UI responsiveness. - Safely handles
ImageViewreferences within coroutines usingWeakReferenceto prevent potential memory leaks. - Decodes image dimensions efficiently using
inJustDecodeBoundsbefore loading the full image into memory.
The SDK no longer uses Picasso directly, and the dependency has been removed. Advanced image loading features can be implemented by creating a custom ImageLoader with libraries like Glide or Coil.
Dialogs now use LineSdkImageConfig.getImageLoader() to load images.
Fixes #163.