@@ -77,7 +77,9 @@ import androidx.compose.ui.graphics.StrokeCap
7777import androidx.compose.ui.graphics.drawscope.Stroke
7878import androidx.compose.ui.graphics.vector.ImageVector
7979import androidx.compose.ui.platform.LocalContext
80+ import androidx.compose.ui.platform.LocalFocusManager
8081import androidx.compose.ui.platform.LocalResources
82+ import androidx.compose.ui.platform.LocalSoftwareKeyboardController
8183import androidx.compose.ui.res.stringResource
8284import androidx.compose.ui.text.font.FontWeight
8385import androidx.compose.ui.text.input.ImeAction
@@ -126,6 +128,8 @@ import kotlinx.coroutines.withContext
126128@Composable
127129fun 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
607627private 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
0 commit comments