How git-xuhao/kotlinmvp works
Main Components Identification
a. Presentation Layer:
• Activities and Fragments (UI Components)
• Presenters
• Contracts (Interfaces between Views and Presenters)
b. Data Layer:
• Models
• API Service
• Local Storage (Watch History)
c. Core Components:
• Network Layer (Retrofit)
• Image Loading (Glide)
• Dependency Injection
• Utils and Helpers
┌─────────────────────────────────────────────────────────────┐
• Presentation Layer │
• ┬─────────────────────────┬──────────────────┤
• Activities │ Fragments │ Adapters │
• & Views │ │ │
• ┬───────┴──────────┬─────────────┴────────┬──────────┘
• ▼ ▼ ▼
┌───────────────────────────────────────────────────────────┐
• MVP Components │
• ┬────────────────────┬────────────────────┤
• Contracts │ Presenters │ Models │
• ┬───────┴────────┬──────────┴─────────┬──────────┘
• ▼ ▼ ▼
┌───────────────────────────────────────────────────────────┐
• Data Layer │
• ┬────────────────────┬────────────────────┤
• API Service │ Local Storage │ Cache Manager │
• ┬───────┴────────┬──────────┴─────────┬──────────┘
• ▼ ▼ ▼
┌───────────────────────────────────────────────────────────┐
• Core Components │
• ┬────────────────────┬────────────────────┤
• Retrofit │ Glide │ RxJava/Android │
• ┴────────────────────┴────────────────────┘
Important Relationships
• Unidirectional data flow from API to Presenters to Views
Additional Elements
Specific features:
• Video playback component (GSYVideoPlayer)
• Image loading pipeline (Glide)
• Navigation flow between main sections
• Error handling and network state management
• Cache management for offline support