No description
- HTML 67.4%
- Kotlin 32.6%
|
|
||
|---|---|---|
| .superpowers/sdd | ||
| app | ||
| docs/agents | ||
| gradle | ||
| graphify-out | ||
| .gitignore | ||
| build.gradle.kts | ||
| CLAUDE.md | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| README.md | ||
| settings.gradle.kts | ||
Pokebox — Pokemon TCG Collection App
A Manabox-style Android app for managing your Pokemon TCG collection.
Features
- Splash screen with version number on launch
- Search cards by name (Cards tab) or browse all sets (Sets tab) via pokemontcg.io API
- Set list shows set logos (disk-cached for offline use after first load)
- Filter by Supertype, Type, Rarity — type filter chips show Pokemon TCG energy icons
- Sort by Name, Set Number, Rarity, or Price — with ascending/descending toggle; Sort section appears at the top of the Filter & Sort sheet; changing sort scrolls results back to the top
- Cache-first search: cached results appear instantly while network refreshes in the background
- Price cache TTL: card price data refreshes automatically after 6 hours
- CardMarket trending price shown in GBP on card list, card detail, and binder totals
- View a card's listing directly on CardMarket (opens browser)
- Card detail: image constrained so all details are visible; tap image to expand fullscreen; swipe left/right to navigate adjacent cards
- Remove a card from a binder via the trash icon in the card detail app bar (only visible when navigating from a binder)
- Collection view with donut chart showing per-binder GBP value, total in centre, and card count per binder ("1 card" / "N cards"; hidden when 0)
- Binder CRUD: create, rename, delete binders; create inline from card detail
- Binder detail: 3-column card grid with card images; set ID + number shown below each card; quantity badge on image; long-press to edit quantity
- Add cards to binders with quantities
- Filter/sort within binders (+ sort by Quantity, Date Added, Price)
- Export binder as CSV via Android share sheet
- Offline support: cached cards and sets shown when no network
- Navigation state preserved when switching between bottom nav tabs
- Dark/light mode toggle in Settings; defaults to system setting on first install
Requirements
- Android Studio Ladybug (2024.2.1) or later
- Android SDK 35 (compileSdk), minSdk 26 (Android 8.0)
- Java 21
Setup
- Install Android Studio (includes SDK and Gradle toolchain)
- Open the project: File > Open > select this directory
- Let Gradle sync complete (downloads dependencies automatically)
- Run on an emulator or device via the Run button
API Key (Optional)
pokemontcg.io is free up to 1,000 requests/day without a key. For higher limits, register at https://dev.pokemontcg.io/ then:
- In
app/build.gradle.ktsdefaultConfigblock:buildConfigField("String", "POKEMON_TCG_API_KEY", "\"your-key-here\"") - In
di/NetworkModule.kt, add theX-Api-Keyheader toOkHttpClient.
Running Tests
./gradlew test # all JVM unit tests (no emulator needed)
./gradlew test --info # verbose output
Coverage:
- DAO tests:
CardDao,BinderDao,BinderCardDao(Robolectric + in-memory Room) - Repository tests:
CardRepository(cache-first, offline fallback),BinderRepository(CRUD) - ViewModel tests:
CardSearchViewModel,BindersListViewModel - Util tests:
CsvExporter(field order, escaping, filename format)
Project Structure
app/src/main/java/com/pokebox/
├── data/
│ ├── local/ Room entities, DAOs, AppDatabase
│ ├── remote/ Retrofit API, DTOs
│ └── repository/ CardRepository, BinderRepository
├── di/ Hilt modules
├── ui/
│ ├── search/ Card search screen + ViewModel (Cards/Sets tabs)
│ ├── detail/ Card detail screen + ViewModel
│ ├── binders/ Collection screen + ViewModel (donut chart)
│ ├── binderdetail/ Binder detail screen + ViewModel (grid view)
│ ├── settings/ Settings screen + ViewModel (dark mode toggle)
│ ├── splash/ Splash screen
│ ├── components/ Shared Compose components (incl. EnergyTypeIcon, BinderCardGridItem)
│ ├── navigation/ NavGraph, BottomNavBar
│ └── theme/ Material 3 theme
└── util/ CsvExporter, NetworkMonitor, PriceUtils, ThemePreferences