# expo-bluesky-gif-view An Expo module for displaying animated GIFs and WebP images with optimized performance and playback controls. ## Overview This module provides a custom view component for rendering animated GIFs with support for: - Autoplay control - Placeholder images while loading - Programmatic playback control (play/pause/toggle) - Image prefetching - Efficient memory management - Player state change events ## Platform Support - iOS (13.4+) - Android (API 21+) - Web ## Architecture The module uses native platform libraries for optimal GIF rendering performance: ### iOS Implementation - **Library**: SDWebImage with SDWebImageWebPCoder - **Key Files**: - `ios/GifView.swift` - Main view implementation using `SDAnimatedImageView` - `ios/ExpoBlueskyGifViewModule.swift` - Module definition and prop bindings - `ios/Util.swift` - Cache configuration utilities **Approach**: Uses `SDAnimatedImageView` for hardware-accelerated GIF rendering. Images are cached to disk only (not memory) to avoid performance issues with `SDAnimatedImage` when loaded from memory. The view automatically cancels pending requests when scrolled off-screen and resumes loading when visible. ### Android Implementation - **Library**: Glide - **Key Files**: - `android/src/main/java/expo/modules/blueskygifview/GifView.kt` - Main view implementation - `android/src/main/java/expo/modules/blueskygifview/ExpoBlueskyGifViewModule.kt` - Module definition - `android/src/main/java/expo/modules/blueskygifview/AppCompatImageViewExtended.kt` - Custom ImageView with playback control **Approach**: Uses Glide's disk cache strategy for loading animated GIFs. Placeholders are loaded with `skipMemoryCache(true)` to avoid cache bloat. The custom `AppCompatImageViewExtended` detects when animations are loaded via `onDraw` and manages the `Animatable` drawable lifecycle. ### Web Implementation - **Library**: Native HTML5 `