$ show AEFeinstein/mtg-familiar
MTG Familiar is a mature, open-source Android companion app for Magic: The Gathering. It provides a comprehensive suite of offline-capable tools including card search with advanced filtering, life counter with commander damage and poison tracking, mana pool, dice roller, trade and wishlist management, round timer, comprehensive rules browser, judge documents (MTR, IPG, JAR), deck builder with import/export and statistics, and the MoJhoSto random card generator. The app is built as a single-module Android project using AndroidX, with a local SQLite database for card data (updated via JSON patches from a GitHub repository), TCGPlayer API integration for market prices, and Glide for card image loading. The architecture follows standard Android patterns: a main Activity (FamiliarActivity) manages a navigation drawer and fragment transactions, with each tool implemented as a Fragment. Data access is centralized through CardDbAdapter and DatabaseManager, with custom Views for mana symbols, color pie, and token-based input. The codebase is well-organized but shows signs of age with deprecated API usage (AsyncTask, PreferenceFragment) and some large, tightly-coupled fragments. It is actively maintained (last commit 2026-06-04) with regular database updates and community contributions.
The LLM identified 4 files worth highlighting for reuse:
A custom TextView that renders Magic: The Gathering mana symbols (e.g., {W}, {U}, {B}, {R}, {G}, hybrid, phyrexian, tap) as inline drawable tokens. It parses mana cost strings and replaces symbol placeholders with corresponding vector drawables, handling scaling and spacing. This component is self-contained, depends only on Android resources (drawables), and could be extracted into a library for any MTG-related app.
A token-based input view for selecting multiple items (e.g., card sets) with autocomplete. It extends a third-party TokenAutoComplete library and integrates with the app's database for suggestions. The view handles token creation, deletion, and styling. While it depends on the app's data layer, the pattern of a tokenized autocomplete input is reusable in any Android app requiring multi-select with suggestions.
A utility class that implements a chain of comparators for multi-field sorting, similar to Apache Commons ComparatorChain. It allows building a sort order by adding multiple comparators with ascending/descending flags, then applying them in sequence. This is a clean, self-contained implementation that could be reused in any Java project needing flexible multi-column sorting without external dependencies.
A wrapper around Android's Snackbar that provides a consistent pattern for showing undoable actions. It handles the Snackbar lifecycle, callback registration, and dismissal. This component is decoupled from business logic and can be reused in any Android app to implement undo functionality with minimal boilerplate.