@@ -13,6 +13,7 @@ import androidx.compose.animation.core.animateFloatAsState
1313import androidx.compose.animation.core.animateIntAsState
1414import androidx.compose.animation.core.tween
1515import androidx.compose.foundation.background
16+ import androidx.compose.foundation.border
1617import androidx.compose.foundation.layout.Arrangement
1718import androidx.compose.foundation.layout.Box
1819import androidx.compose.foundation.layout.Column
@@ -469,48 +470,62 @@ fun DashboardScreen(
469470 },
470471 )
471472
472- DashboardSetupChecklistCard (
473- dashboardStatus = dashboardStatus,
474- corePermissionsReady = corePermissionsReady,
475- syncState = syncState,
476- spamDatabaseReady = spamDatabaseReady,
477- spamCount = spamCount,
478- blockCallsEnabled = blockCallsEnabled,
479- callScreenerReady = callScreenerReady,
480- overlayGranted = overlayGranted,
481- notificationsGranted = notificationsGranted,
482- onReviewPermissions = openPermissions,
483- onSyncDatabase = {
484- hapticTick(context)
485- viewModel.sync()
486- },
487- onEnableCallScreener = openPermissions,
488- onEnableOverlay = openPermissions,
489- onEnableNotifications = openPermissions,
490- )
491-
492- if (backgroundExecutionRisk != BackgroundExecutionRisk .Ok && ! backgroundWarningDismissed) {
493- BackgroundExecutionWarning (
494- risk = backgroundExecutionRisk,
495- showMiuiAction = remember { BackgroundExecutionStatus .isLikelyMiui() },
496- onOpenBatterySettings = {
497- context.startActivitySafely(
498- BackgroundExecutionStatus .batteryExemptionSettingsIntent(context),
499- )
500- },
501- onOpenMiuiSettings = {
502- context.startActivitySafely(BackgroundExecutionStatus .miuiAutostartIntent())
503- },
504- onDismiss = { backgroundWarningDismissed = true },
505- )
506- }
507-
508473 DashboardStatsRow (
509474 totalBlocked = totalBlocked,
510475 blockedToday = blockedToday,
511476 blockedThisWeek = blockedThisWeek,
512477 )
513478
479+ Row (
480+ modifier = Modifier .fillMaxWidth(),
481+ horizontalArrangement = Arrangement .spacedBy(10 .dp),
482+ ) {
483+ val callsActive = blockCallsEnabled && callProtectionReady
484+ val textsActive = blockSmsEnabled && smsProtectionReady
485+ PremiumCard (
486+ modifier = Modifier .weight(1f ),
487+ onClick = openPermissions,
488+ accentColor = if (callsActive) CatGreen else CatYellow ,
489+ ) {
490+ Column (modifier = Modifier .padding(14 .dp), verticalArrangement = Arrangement .spacedBy(5 .dp)) {
491+ PremiumIconTile (Icons .Default .Phone , if (callsActive) CatGreen else CatYellow , showContainer = true )
492+ Text (stringResource(R .string.onboarding_call_screening_title), style = MaterialTheme .typography.titleSmall)
493+ Text (
494+ stringResource(
495+ when {
496+ callsActive -> R .string.dashboard_status_ready
497+ blockCallsEnabled -> R .string.dashboard_status_needed
498+ else -> R .string.dashboard_profile_off
499+ },
500+ ),
501+ style = MaterialTheme .typography.labelMedium,
502+ color = if (callsActive) CatGreen else CatYellow ,
503+ )
504+ }
505+ }
506+ PremiumCard (
507+ modifier = Modifier .weight(1f ),
508+ onClick = openPermissions,
509+ accentColor = if (textsActive) CatGreen else CatYellow ,
510+ ) {
511+ Column (modifier = Modifier .padding(14 .dp), verticalArrangement = Arrangement .spacedBy(5 .dp)) {
512+ PremiumIconTile (Icons .Default .Sms , if (textsActive) CatGreen else CatYellow , showContainer = true )
513+ Text (stringResource(R .string.dashboard_block_sms), style = MaterialTheme .typography.titleSmall)
514+ Text (
515+ stringResource(
516+ when {
517+ textsActive -> R .string.dashboard_status_ready
518+ blockSmsEnabled -> R .string.dashboard_status_needed
519+ else -> R .string.dashboard_profile_off
520+ },
521+ ),
522+ style = MaterialTheme .typography.labelMedium,
523+ color = if (textsActive) CatGreen else CatYellow ,
524+ )
525+ }
526+ }
527+ }
528+
514529 if (blockedThisWeek > 0 || blockedLastWeek > 0 ) {
515530 val diff = blockedThisWeek - blockedLastWeek
516531 val trendIcon =
@@ -587,25 +602,7 @@ fun DashboardScreen(
587602
588603 PremiumCard (modifier = Modifier .fillMaxWidth()) {
589604 Column (modifier = Modifier .padding(18 .dp)) {
590- SectionHeader (stringResource(R .string.dashboard_quick_controls), CatGreen )
591- Spacer (Modifier .height(12 .dp))
592- QuickToggle (
593- icon = Icons .Default .Phone ,
594- label = stringResource(R .string.dashboard_block_calls),
595- checked = blockCallsEnabled,
596- ) { viewModel.setBlockCalls(it) }
597- GradientDivider (modifier = Modifier .padding(vertical = 4 .dp))
598- QuickToggle (
599- icon = Icons .Default .Sms ,
600- label = stringResource(R .string.dashboard_block_sms),
601- checked = blockSmsEnabled,
602- ) { viewModel.setBlockSms(it) }
603- }
604- }
605-
606- PremiumCard (modifier = Modifier .fillMaxWidth()) {
607- Column (modifier = Modifier .padding(18 .dp)) {
608- SectionHeader (stringResource(R .string.dashboard_quick_profiles), CatMauve )
605+ SectionHeader (stringResource(R .string.dashboard_quick_profiles), CatGreen )
609606 SnackbarHost (profileSnackbar)
610607 Spacer (Modifier .height(12 .dp))
611608 Row (modifier = Modifier .fillMaxWidth(), horizontalArrangement = Arrangement .spacedBy(8 .dp)) {
@@ -660,6 +657,60 @@ fun DashboardScreen(
660657 }
661658 }
662659
660+ DashboardSetupChecklistCard (
661+ dashboardStatus = dashboardStatus,
662+ corePermissionsReady = corePermissionsReady,
663+ syncState = syncState,
664+ spamDatabaseReady = spamDatabaseReady,
665+ spamCount = spamCount,
666+ blockCallsEnabled = blockCallsEnabled,
667+ callScreenerReady = callScreenerReady,
668+ overlayGranted = overlayGranted,
669+ notificationsGranted = notificationsGranted,
670+ onReviewPermissions = openPermissions,
671+ onSyncDatabase = {
672+ hapticTick(context)
673+ viewModel.sync()
674+ },
675+ onEnableCallScreener = openPermissions,
676+ onEnableOverlay = openPermissions,
677+ onEnableNotifications = openPermissions,
678+ )
679+
680+ if (backgroundExecutionRisk != BackgroundExecutionRisk .Ok && ! backgroundWarningDismissed) {
681+ BackgroundExecutionWarning (
682+ risk = backgroundExecutionRisk,
683+ showMiuiAction = remember { BackgroundExecutionStatus .isLikelyMiui() },
684+ onOpenBatterySettings = {
685+ context.startActivitySafely(
686+ BackgroundExecutionStatus .batteryExemptionSettingsIntent(context),
687+ )
688+ },
689+ onOpenMiuiSettings = {
690+ context.startActivitySafely(BackgroundExecutionStatus .miuiAutostartIntent())
691+ },
692+ onDismiss = { backgroundWarningDismissed = true },
693+ )
694+ }
695+
696+ PremiumCard (modifier = Modifier .fillMaxWidth()) {
697+ Column (modifier = Modifier .padding(18 .dp)) {
698+ SectionHeader (stringResource(R .string.dashboard_quick_controls), CatGreen )
699+ Spacer (Modifier .height(12 .dp))
700+ QuickToggle (
701+ icon = Icons .Default .Phone ,
702+ label = stringResource(R .string.dashboard_block_calls),
703+ checked = blockCallsEnabled,
704+ ) { viewModel.setBlockCalls(it) }
705+ GradientDivider (modifier = Modifier .padding(vertical = 4 .dp))
706+ QuickToggle (
707+ icon = Icons .Default .Sms ,
708+ label = stringResource(R .string.dashboard_block_sms),
709+ checked = blockSmsEnabled,
710+ ) { viewModel.setBlockSms(it) }
711+ }
712+ }
713+
663714 PremiumCard (modifier = Modifier .fillMaxWidth(), accentColor = CatGreen ) {
664715 Column (
665716 modifier = Modifier .padding(18 .dp),
@@ -1834,6 +1885,7 @@ fun ProfileChip(
18341885 modifier =
18351886 modifier
18361887 .height(48 .dp)
1888+ .border(1 .dp, if (isActive) color else CatMuted , RoundedCornerShape (ShapeSm ))
18371889 .semantics { selected = isActive },
18381890 shape = RoundedCornerShape (ShapeSm ),
18391891 contentPadding = PaddingValues (horizontal = 4 .dp, vertical = 0 .dp),
0 commit comments