$ show Trinea/android-common
Trinea Android Common is a mature Android library providing a comprehensive set of caching components (in-memory, disk, HTTP), custom UI widgets (pull-to-refresh ListView, horizontal ListView, border ScrollView, single-page Gallery), and a wide array of utility classes for common Android development tasks. The cache system is particularly well-architected, featuring a pluggable eviction policy interface with 13+ strategies, two-level caching (memory + SD card), and preloading support. The library is written in Java and targets API 21+, with AndroidX dependencies. While the codebase is functional and well-documented, it shows its age with patterns like AsyncTask and raw HttpURLConnection, and lacks Kotlin or modern coroutine support. It remains a solid reference for cache implementation patterns and utility functions, but for new projects, developers may prefer more modern alternatives like Coil or Glide for image loading.
The LLM identified 5 files worth highlighting for reuse:
A generic, thread-safe cache implementation with configurable maximum size, time-based expiration, and pluggable eviction policies via CacheFullRemoveType. It provides hit/miss tracking, serialization support, and a Map-like interface. This component is self-contained and can be extracted into any Java/Android project needing a customizable in-memory cache.
Extends SimpleCache with asynchronous data fetching and preloading capabilities. It supports forward/backward preloading based on a key list, network type restrictions, and a listener pattern for data retrieval. The use of CountDownLatch for synchronous waiting and a dedicated thread pool makes it a reusable pattern for any list-based data loading scenario.
A two-level image cache combining ImageMemoryCache (in-memory) and ImageSDCardCache (disk). It handles image fetching, decoding with optional downsampling, and provides callbacks for UI updates. The architecture separates concerns cleanly and can be reused as a reference for implementing multi-tier caching in Android apps.
A custom ListView that supports pull-to-refresh and automatic load-more when scrolling to the bottom. It includes header/footer animations, configurable text, and listener interfaces. This is a self-contained widget that can be extracted and used in any Android project needing these features without external libraries.
A comprehensive file utility class providing read/write operations, file manipulation (move, copy, delete), path parsing, and directory creation. It handles edge cases like null inputs and missing files gracefully. This utility is reusable across any Java/Android project and demonstrates robust error handling and input validation.