Files
yola/Pink/CLAUDE.md
T
coco 88c0fbefef a
2026-07-14 09:44:44 +08:00

47 lines
2.4 KiB
Markdown

# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project overview
**PinkOV** — an Android application using Kotlin, Jetpack Compose, and Material 3 with adaptive navigation. Package: `com.pinkbear.pinkov`.
## Build and test commands
```bash
# Build the project
./gradlew assembleDebug
# Run unit tests (JVM, in app/src/test/)
./gradlew test
# Run a single unit test class
./gradlew test --tests "com.pinkbear.pinkov.ExampleUnitTest"
# Run a single unit test method
./gradlew test --tests "com.pinkbear.pinkov.ExampleUnitTest.addition_isCorrect"
# Run instrumented tests (requires connected device or emulator)
./gradlew connectedAndroidTest
# Run lint checks
./gradlew lint
# Clean build outputs
./gradlew clean
```
## Architecture
- **Single-activity app**: `MainActivity` uses `setContent` with `PinkOVTheme` wrapping the root composable `PinkOVApp()`.
- **Navigation**: `NavigationSuiteScaffold` (Material 3 adaptive) with bottom tabs defined by the `AppDestinations` enum. Destinations are Home and Mine — each backed by a drawable icon resource. Full-screen pages (e.g., `ScanPage`) are toggled via a `showScanPage` boolean state in `PinkOVApp`.
- **Theme layer** (`ui/theme/`): Supports dynamic color on Android 12+ with dark/light fallback color schemes. Uses `MaterialTheme` with custom color and typography definitions.
- **Camera**: Uses CameraX (`camera-core`, `camera-camera2`, `camera-lifecycle`) with `ImageAnalysis` for frame processing. `OvImageAnalyzer` (in `ui/scan/`) implements `ImageAnalysis.Analyzer`, crops the top 50% of each frame, and exposes the result via `MutableState<Bitmap>`. Permissions are handled via Accompanist (`accompanist-permissions`).
- **Dependency management**: Gradle version catalog in `gradle/libs.versions.toml` — add new dependencies there and reference via `libs.*` in `app/build.gradle.kts` rather than hardcoding coordinates.
- **Target**: compileSdk 36, minSdk 24, Kotlin 2.2.10, AGP 9.2.1, Java 11 bytecode target.
## Key conventions
- Compose previews use `@PreviewScreenSizes` (for adaptive layouts) and `@Preview(showBackground = true)` (for component-level previews).
- Navigation icons are `painterResource`-based drawable vectors stored in `app/src/main/res/drawable/`.
- The Compose BOM (`androidx-compose-bom`) manages Compose library versions — individual Compose dependency versions should not be pinned.