Skip to content

Commit 472b51c

Browse files
committed
feat(lookup): show private checks and real evidence
Bring the idle and verdict layouts toward the generated design while keeping local risk data authoritative. Close the keypad on Check so the evidence is visible.
1 parent 21d02b8 commit 472b51c

5 files changed

Lines changed: 61 additions & 30 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ All notable changes to CallShield will be documented in this file.
44

55
## Unreleased
66

7+
- Lookup now opens with a clear number-check prompt and a private-check card.
8+
Risk results group the app's actual reasons under Evidence, and checking a
9+
number closes the keypad so the verdict stays visible.
710
- Activity now uses clear Recent and Blocked pills and an outlined summary of
811
actual call history. Its introduction names the history the app can show.
912
- Settings now opens on grouped Basic controls, with detailed access, detection,

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ language in [issue #7](https://github.com/SysAdminDoc/CallShield/issues/7).
542542
| URL Safety | Local spam-domain data; optional PhishTank and OpenPhish |
543543
| Verification | Local Gradle, lint, and release-artifact checks |
544544
| Tests | 1559 JVM unit tests (JUnit) |
545-
| Strings | 1619 string resources and 38 plural groups (translation-ready) |
545+
| Strings | 1622 string resources and 38 plural groups (translation-ready) |
546546
| Accessibility | 100+ content descriptions, 48dp touch targets |
547547
| Min SDK | 29 (Android 10) |
548548
| Target SDK | 36 |

‎app/src/main/java/com/sysadmindoc/callshield/ui/screens/lookup/LookupScreen.kt‎

Lines changed: 51 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ import androidx.compose.ui.graphics.StrokeCap
7777
import androidx.compose.ui.graphics.drawscope.Stroke
7878
import androidx.compose.ui.graphics.vector.ImageVector
7979
import androidx.compose.ui.platform.LocalContext
80+
import androidx.compose.ui.platform.LocalFocusManager
8081
import androidx.compose.ui.platform.LocalResources
82+
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
8183
import androidx.compose.ui.res.stringResource
8284
import androidx.compose.ui.text.font.FontWeight
8385
import androidx.compose.ui.text.input.ImeAction
@@ -126,6 +128,8 @@ import kotlinx.coroutines.withContext
126128
@Composable
127129
fun LookupScreen(viewModel: MainViewModel) {
128130
val context = LocalContext.current
131+
val focusManager = LocalFocusManager.current
132+
val keyboard = LocalSoftwareKeyboardController.current
129133
val resources = LocalResources.current
130134
val scope = rememberCoroutineScope()
131135
val snackbarHostState = remember { SnackbarHostState() }
@@ -169,6 +173,8 @@ fun LookupScreen(viewModel: MainViewModel) {
169173
fun runLookup() {
170174
if (!canLookup || checking) return
171175

176+
focusManager.clearFocus(force = true)
177+
keyboard?.hide()
172178
checking = true
173179
viewModel.clearLookupOutcome()
174180
errorMessage = null
@@ -206,6 +212,19 @@ fun LookupScreen(viewModel: MainViewModel) {
206212
horizontalAlignment = Alignment.CenterHorizontally,
207213
verticalArrangement = Arrangement.spacedBy(14.dp),
208214
) {
215+
Column(modifier = Modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(4.dp)) {
216+
Text(
217+
stringResource(R.string.lookup_page_title),
218+
style = MaterialTheme.typography.headlineMedium,
219+
fontWeight = FontWeight.Bold,
220+
color = CatText,
221+
)
222+
Text(
223+
stringResource(R.string.lookup_page_intro),
224+
style = MaterialTheme.typography.bodyMedium,
225+
color = CatSubtext,
226+
)
227+
}
209228
Column(
210229
modifier = Modifier.fillMaxWidth(),
211230
verticalArrangement = Arrangement.spacedBy(8.dp),
@@ -402,6 +421,7 @@ fun LookupScreen(viewModel: MainViewModel) {
402421
GradientDivider(color = resultAccent)
403422

404423
if (lookupResult.isSpam) {
424+
SectionHeader(stringResource(R.string.lookup_evidence), CatRed)
405425
DetailRow(
406426
label = stringResource(R.string.lookup_detection),
407427
value = friendlyMatchReasonLabel(lookupResult.reasonCode.wireValue),
@@ -605,39 +625,41 @@ fun LookupScreen(viewModel: MainViewModel) {
605625

606626
@Composable
607627
private fun LookupIdleCard() {
608-
Column(
609-
modifier = Modifier.fillMaxWidth(),
610-
verticalArrangement = Arrangement.spacedBy(12.dp),
611-
) {
612-
Row(
613-
verticalAlignment = Alignment.CenterVertically,
614-
horizontalArrangement = Arrangement.spacedBy(8.dp),
628+
PremiumCard(modifier = Modifier.fillMaxWidth(), accentColor = CatGreen) {
629+
Column(
630+
modifier = Modifier.padding(16.dp),
631+
verticalArrangement = Arrangement.spacedBy(12.dp),
615632
) {
616-
Icon(
617-
imageVector = Icons.Default.VerifiedUser,
618-
contentDescription = null,
619-
modifier = Modifier.size(16.dp),
620-
tint = CatGreen,
633+
Row(
634+
verticalAlignment = Alignment.CenterVertically,
635+
horizontalArrangement = Arrangement.spacedBy(8.dp),
636+
) {
637+
Icon(
638+
imageVector = Icons.Default.VerifiedUser,
639+
contentDescription = null,
640+
modifier = Modifier.size(16.dp),
641+
tint = CatGreen,
642+
)
643+
Text(
644+
text = stringResource(R.string.lookup_idle_title),
645+
style = MaterialTheme.typography.bodyMedium,
646+
fontWeight = FontWeight.Medium,
647+
color = CatText,
648+
)
649+
}
650+
LookupHintRow(
651+
icon = Icons.Default.Psychology,
652+
title = stringResource(R.string.lookup_idle_signal_title),
653+
subtitle = stringResource(R.string.lookup_idle_signal_body),
654+
accentColor = CatSubtext,
621655
)
622-
Text(
623-
text = stringResource(R.string.lookup_idle_title),
624-
style = MaterialTheme.typography.bodyMedium,
625-
fontWeight = FontWeight.Medium,
626-
color = CatSubtext,
656+
LookupHintRow(
657+
icon = Icons.Default.VerifiedUser,
658+
title = stringResource(R.string.lookup_idle_trusted_title),
659+
subtitle = stringResource(R.string.lookup_idle_trusted_body),
660+
accentColor = CatGreen,
627661
)
628662
}
629-
LookupHintRow(
630-
icon = Icons.Default.Psychology,
631-
title = stringResource(R.string.lookup_idle_signal_title),
632-
subtitle = stringResource(R.string.lookup_idle_signal_body),
633-
accentColor = CatSubtext,
634-
)
635-
LookupHintRow(
636-
icon = Icons.Default.VerifiedUser,
637-
title = stringResource(R.string.lookup_idle_trusted_title),
638-
subtitle = stringResource(R.string.lookup_idle_trusted_body),
639-
accentColor = CatGreen,
640-
)
641663
}
642664
}
643665

‎app/src/main/res/values-zh-rCN/strings.xml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@
295295
<string name="dialog_keyword">关键词</string>
296296
<string name="dialog_keyword_placeholder">例如:免费礼品卡</string>
297297
<string name="dialog_keyword_note">任何包含此关键词的短信都将被拦截。</string>
298+
<string name="lookup_page_title">查询号码</string>
299+
<string name="lookup_page_intro">拨打电话或发送短信前,先检查号码。</string>
298300
<string name="lookup_phone_number">电话号码</string>
299301
<string name="lookup_paste_clipboard">粘贴剪贴板</string>
300302
<string name="lookup_supporting_location">正在核查 %1$s · %2$s</string>
@@ -305,6 +307,7 @@
305307
<string name="lookup_trace_allow">允许</string>
306308
<string name="lookup_trace_off">关闭</string>
307309
<string name="lookup_trace_pass">通过</string>
310+
<string name="lookup_evidence">判断依据</string>
308311
<string name="lookup_detection">检测</string>
309312
<string name="lookup_type">类型</string>
310313
<string name="lookup_details">详情</string>

‎app/src/main/res/values/strings.xml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,8 @@
410410
<string name="dialog_keyword_note">SMS containing this keyword will be flagged in the CallShield log.</string>
411411

412412
<!-- Lookup Screen -->
413+
<string name="lookup_page_title">Lookup a number</string>
414+
<string name="lookup_page_intro">Check a phone number before you call or text.</string>
413415
<string name="lookup_phone_number">Phone number</string>
414416
<string name="lookup_paste_clipboard">Paste</string>
415417
<string name="lookup_supporting_location">%1$s · %2$s</string>
@@ -425,6 +427,7 @@
425427
<string name="lookup_verdict_suspected_spam">Suspected spam</string>
426428
<string name="lookup_verdict_no_risk">No risk detected</string>
427429
<string name="lookup_verdict_probabilistic_note">This confidence comes from on-device analysis and is shown only for probabilistic signals.</string>
430+
<string name="lookup_evidence">Evidence</string>
428431
<string name="lookup_detection">Detection</string>
429432
<string name="lookup_type">Type</string>
430433
<string name="lookup_details">Details</string>

0 commit comments

Comments
 (0)