-
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Milestone
Description
🎨 Implement Dynamic Color Detection System
🎯 Objective
Create a robust system to detect and utilize Android 12+ dynamic color capabilities while providing graceful fallbacks for older devices.
📋 Tasks
Core Implementation
- Create
DynamicColorHelper
utility class - Implement system capability detection for dynamic colors
- Add device API level checks (Android 12+ / API 31+)
- Create fallback mechanisms for unsupported devices
Integration Points
- Update
AccentTheme
enum to includeDYNAMIC
option - Modify
SettingsViewModel
to handle dynamic color preferences - Update theme selection logic in
getAccentTheme()
function - Add preference storage for dynamic color setting
Code Structure
- Create new file:
util/DynamicColorHelper.kt
- Update existing:
util/AccentTheme.kt
- Update existing:
util/Utility.kt
- Update existing:
settings/viewmodel/SettingsViewModel.kt
🔧 Implementation Details
New DynamicColorHelper Class:
object DynamicColorHelper {
fun isDynamicColorSupported(): Boolean
fun isDynamicColorEnabled(): Boolean
fun canUseDynamicColors(): Boolean
fun getSystemAccentColor(): Int?
}
Updated AccentTheme Enum:
enum class AccentTheme {
DYNAMIC, // New - uses system colors on Android 12+
BLUE,
GREEN,
PURPLE,
PINK,
RED,
GREY
}
🧪 Testing Requirements
- Test on Android 12+ devices with different wallpapers
- Test on Android 11 and below (should gracefully fallback)
- Verify dynamic color detection accuracy
- Test preference persistence across app restarts
✅ Acceptance Criteria
- Dynamic color support detected correctly on compatible devices
- Graceful fallback to existing themes on older devices
- No crashes or performance issues on any supported Android version
- User preference properly stored and retrieved
- Clean, well-documented code
🔗 Related Issues
- Depends on: 📦 Phase 1.1: Update Material Design Dependencies to Support Material3 #60 (Dependencies Update)
- Part of milestone: 🎯 Milestone: Material You Upgrade for v3.0.0 Release #59
📝 Notes
- This is a foundational feature for Material You implementation
- Ensure backward compatibility is maintained
- Consider user preference override (allow disabling dynamic colors even on supported devices)