How buggily/enemy works
Based on our analysis of the provided file tree and README, enemy is an Android audio player built as a sample and for personal daily use. It focuses on local audio playback (with comprehensive metadata requirements) and integrates key Android libraries and modern architectural practices such as MVVM, dependency injection (Hilt), Paging3, Jetpack Compose, Media3 for audio, and adaptive layouts. The project is highly modular, with separate modules for core functionality (domain, data, UI, controller, etc.), features (album, browse, controller, playlist, track, etc.), as well as local, external, and infrastructure build components.
• App Module: Represent the primary Android application module (located in “app”) that includes the AndroidManifest, main Activity, Media Service, and basic DI initialization (EnemyApplication.kt). This module is the entry point.
• Core Layers:
• Domain: Represent modules under “core/domain” and “domain/…” – they encapsulate business logic and use-case definitions (e.g., Play, Pause, GetDuration, etc.).
• Data: Include “core/data” which and modules under “data/…” that deal with data structures, network/local data sources, and repositories.
• UI: Include “core/ui” which contains shared UI components, themes, and global UI states.
• Navigation and Paging: The project has dedicated navigation (“core/navigation” and domain/navigation) and paging (“core/paging”) modules that structure the user flows and data loading.
• Builder & Infrastructure: The “builder” module contains custom Gradle convention plugins and properties that are used to enforce consistency in the multi-module structure.
Relationships and Architectural Patterns
• The App module depends on feature modules (UI) as well as on core layers.
• Feature modules use ViewModels to interact with the Domain (business logic) layer.
• Domain modules invoke repository interfaces provided by the Data modules.
• Data modules interact with both the local (persistent storage, Room/Database) and external (query sources) modules.
• Navigation modules interact with both the UI and Domain layers to handle app routing.
• Use of MVVM by diagramming the flow: UI Components → ViewModels → Domain (use cases) → Data Sources.
Critical Technologies and Technologies per Layer
• For the UI/presentation layer:
• Jetpack Compose, adaptive layouts (WindowSizeClass), Coil for image loading.
• For audio playback:
• Media3 with its mediaservice and media notifications.
• For data handling:
• Paging3 for positional paging.
• For dependency management:
• Hilt for dependency injection.
• For architecture:
• Unidirectional data flow following MVVM.