feat: consent screen, reminder system, medical metrics, sex field, design tokens, code quality
A. Reminder: ReminderService (AlarmManager chain), ReminderSettingsView, bell icon in Piezo top bar, reschedule on catheterization B. Consent: ConsentView (3 mandatory items), onboarding→consent→registration flow, persistent consent storage, sex field in User + Registration Step 2 C. Diary: 24hUV, NUV, NPI, max capacity, day/night frequency metrics card D. Design: DesignTokens.kt, 48dp touch targets, DonutChart semantics, pressScale modifier E. Quality: BuildConfig.DEBUG log wrapping, DateFormatter caching, background I/O for diary store Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,11 +11,10 @@ import com.example.medilightv2android.models.*
|
||||
import com.example.medilightv2android.services.*
|
||||
|
||||
enum class AppScreen {
|
||||
ONBOARDING, REGISTRATION, HOME, SENSOR_SELECT, DEVICE_SCAN,
|
||||
ONBOARDING, CONSENT, REGISTRATION, HOME, SENSOR_SELECT, DEVICE_SCAN,
|
||||
NIRS_CALIBRATION, PIEZO_PERSONALIZATION, PIN_SETUP, PIN_ENTRY,
|
||||
VIVAMYO_MONITORING, PIEZO_MONITORING, MEASUREMENT_HISTORY,
|
||||
VOIDING_DIARY,
|
||||
URINE_CAMERA
|
||||
VOIDING_DIARY, URINE_CAMERA, REMINDER_SETTINGS
|
||||
}
|
||||
|
||||
class AppState(private val context: Context) {
|
||||
@@ -32,6 +31,7 @@ class AppState(private val context: Context) {
|
||||
private val historyStore = MeasurementHistoryStore.getInstance(context)
|
||||
private val notificationService = NotificationService.getInstance(context)
|
||||
private val bleManager = BleManager.getInstance(context)
|
||||
private val reminderService = ReminderService.getInstance(context)
|
||||
|
||||
init {
|
||||
loadState()
|
||||
@@ -49,6 +49,7 @@ class AppState(private val context: Context) {
|
||||
|
||||
currentScreen = when {
|
||||
!storage.hasCompletedOnboarding -> AppScreen.ONBOARDING
|
||||
!storage.hasConsented -> AppScreen.CONSENT
|
||||
!storage.isRegistered -> AppScreen.REGISTRATION
|
||||
!storage.hasPin -> AppScreen.PIN_SETUP
|
||||
else -> AppScreen.PIN_ENTRY
|
||||
@@ -57,6 +58,12 @@ class AppState(private val context: Context) {
|
||||
|
||||
fun completeOnboarding() {
|
||||
storage.hasCompletedOnboarding = true
|
||||
currentScreen = AppScreen.CONSENT
|
||||
}
|
||||
|
||||
fun completeConsent() {
|
||||
storage.hasConsented = true
|
||||
storage.consentTimestamp = System.currentTimeMillis()
|
||||
currentScreen = AppScreen.REGISTRATION
|
||||
}
|
||||
|
||||
@@ -164,6 +171,7 @@ class AppState(private val context: Context) {
|
||||
bladderLevel = newLevel
|
||||
storage.bladderLevel = 0
|
||||
notificationService.cancelAll()
|
||||
reminderService.reschedule()
|
||||
|
||||
if (catheterCount.intValue > 0) {
|
||||
catheterCount.intValue--
|
||||
|
||||
Reference in New Issue
Block a user