Skip to content

Commit 21d02b8

Browse files
committed
feat(activity): frame real call history in dark cards
Keep Recent and Blocked as separate views while matching the generated Activity layout with mint pills and a live call summary.
1 parent 04a895a commit 21d02b8

6 files changed

Lines changed: 37 additions & 63 deletions

File tree

‎CHANGELOG.md‎

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

55
## Unreleased
66

7+
- Activity now uses clear Recent and Blocked pills and an outlined summary of
8+
actual call history. Its introduction names the history the app can show.
79
- Settings now opens on grouped Basic controls, with detailed access, detection,
810
lists and backup options under Advanced. Cards match the dark screen design,
911
and Settings no longer opens an unrelated database search.

‎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 | 1618 string resources and 38 plural groups (translation-ready) |
545+
| Strings | 1619 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/activity/ActivityScreen.kt‎

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
package com.sysadmindoc.callshield.ui.screens.activity
22

33
import androidx.compose.foundation.background
4+
import androidx.compose.foundation.border
45
import androidx.compose.foundation.layout.Box
56
import androidx.compose.foundation.layout.Column
67
import androidx.compose.foundation.layout.Row
78
import androidx.compose.foundation.layout.RowScope
8-
import androidx.compose.foundation.layout.Spacer
99
import androidx.compose.foundation.layout.fillMaxSize
1010
import androidx.compose.foundation.layout.fillMaxWidth
1111
import androidx.compose.foundation.layout.height
12-
import androidx.compose.foundation.layout.width
12+
import androidx.compose.foundation.layout.padding
13+
import androidx.compose.foundation.shape.RoundedCornerShape
1314
import androidx.compose.material3.MaterialTheme
1415
import androidx.compose.material3.Tab
1516
import androidx.compose.material3.Text
@@ -21,9 +22,7 @@ import androidx.compose.runtime.mutableStateOf
2122
import androidx.compose.runtime.saveable.rememberSaveable
2223
import androidx.compose.runtime.saveable.rememberSaveableStateHolder
2324
import androidx.compose.runtime.setValue
24-
import androidx.compose.ui.Alignment
2525
import androidx.compose.ui.Modifier
26-
import androidx.compose.ui.graphics.Color
2726
import androidx.compose.ui.res.stringResource
2827
import androidx.compose.ui.text.font.FontWeight
2928
import androidx.compose.ui.unit.dp
@@ -33,6 +32,7 @@ import com.sysadmindoc.callshield.ui.screens.main.BlockedLogScreen
3332
import com.sysadmindoc.callshield.ui.screens.recent.RecentCallsScreen
3433
import com.sysadmindoc.callshield.ui.theme.Black
3534
import com.sysadmindoc.callshield.ui.theme.CatGreen
35+
import com.sysadmindoc.callshield.ui.theme.CatOverlay
3636
import com.sysadmindoc.callshield.ui.theme.CatSubtext
3737

3838
/**
@@ -57,7 +57,13 @@ fun ActivityScreen(
5757
val stateHolder = rememberSaveableStateHolder()
5858

5959
Column(modifier = Modifier.fillMaxSize().background(Black)) {
60-
Row(modifier = Modifier.fillMaxWidth()) {
60+
Text(
61+
stringResource(R.string.activity_intro),
62+
modifier = Modifier.padding(horizontal = 20.dp, vertical = 6.dp),
63+
style = MaterialTheme.typography.bodyMedium,
64+
color = CatSubtext,
65+
)
66+
Row(modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp, vertical = 8.dp)) {
6167
ActivityTab(
6268
selected = selectedView == ACTIVITY_RECENT,
6369
label = stringResource(R.string.activity_tab_recent),
@@ -90,25 +96,21 @@ internal fun RowScope.ActivityTab(
9096
Tab(
9197
selected = selected,
9298
onClick = onClick,
93-
modifier = Modifier.weight(1f).height(56.dp),
94-
selectedContentColor = CatGreen,
99+
modifier =
100+
Modifier
101+
.weight(1f)
102+
.padding(horizontal = 4.dp)
103+
.height(48.dp)
104+
.background(if (selected) CatGreen else MaterialTheme.colorScheme.surfaceContainerLow, RoundedCornerShape(24.dp))
105+
.border(1.dp, if (selected) CatGreen else CatOverlay.copy(alpha = 0.35f), RoundedCornerShape(24.dp)),
106+
selectedContentColor = Black,
95107
unselectedContentColor = CatSubtext,
96108
text = {
97-
Column(horizontalAlignment = Alignment.CenterHorizontally) {
98-
Text(
99-
text = label,
100-
style = MaterialTheme.typography.titleSmall,
101-
fontWeight = if (selected) FontWeight.SemiBold else FontWeight.Medium,
102-
)
103-
Spacer(Modifier.height(5.dp))
104-
Box(
105-
modifier =
106-
Modifier
107-
.width(72.dp)
108-
.height(2.dp)
109-
.background(if (selected) CatGreen else Color.Transparent),
110-
)
111-
}
109+
Text(
110+
text = label,
111+
style = MaterialTheme.typography.titleSmall,
112+
fontWeight = if (selected) FontWeight.SemiBold else FontWeight.Medium,
113+
)
112114
},
113115
)
114116
}

‎app/src/main/java/com/sysadmindoc/callshield/ui/screens/recent/RecentCallsScreen.kt‎

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -755,55 +755,23 @@ private fun RecentCallsSummaryCard(
755755
onRefresh: () -> Unit,
756756
) {
757757
val formatter = remember { NumberFormat.getIntegerInstance() }
758-
Column(
759-
modifier = Modifier.fillMaxWidth().padding(horizontal = 20.dp, vertical = 12.dp),
760-
verticalArrangement = Arrangement.spacedBy(10.dp),
761-
) {
758+
PremiumCard(modifier = Modifier.fillMaxWidth().padding(horizontal = 20.dp, vertical = 8.dp), accentColor = CatGreen) {
762759
Row(
763-
modifier = Modifier.fillMaxWidth(),
760+
modifier = Modifier.fillMaxWidth().padding(12.dp),
764761
verticalAlignment = Alignment.CenterVertically,
765762
) {
766-
RecentSummaryPill(
767-
formatter.format(totalCount),
768-
stringResource(R.string.recent_summary_total),
769-
CatText,
770-
Modifier.weight(1f),
771-
)
772-
RecentSummaryPill(
773-
formatter.format(spamCount),
774-
stringResource(R.string.recent_summary_spam),
775-
CatRed,
776-
Modifier.weight(1f),
777-
)
778-
RecentSummaryPill(
779-
formatter.format(missedCount),
780-
stringResource(R.string.recent_summary_missed),
781-
CatYellow,
782-
Modifier.weight(1f),
783-
)
784-
RecentSummaryPill(
785-
formatter.format(contactCount),
786-
stringResource(R.string.recent_summary_known),
787-
CatGreen,
788-
Modifier.weight(1f),
789-
)
763+
RecentSummaryPill(formatter.format(totalCount), stringResource(R.string.recent_summary_total), CatText, Modifier.weight(1f))
764+
RecentSummaryPill(formatter.format(spamCount), stringResource(R.string.recent_summary_spam), CatRed, Modifier.weight(1f))
765+
RecentSummaryPill(formatter.format(missedCount), stringResource(R.string.recent_summary_missed), CatYellow, Modifier.weight(1f))
766+
RecentSummaryPill(formatter.format(contactCount), stringResource(R.string.recent_summary_known), CatGreen, Modifier.weight(1f))
790767
IconButton(onClick = onRefresh, enabled = !refreshing) {
791768
if (refreshing) {
792-
CircularProgressIndicator(
793-
modifier = Modifier.size(18.dp),
794-
strokeWidth = 2.dp,
795-
color = CatGreen,
796-
)
769+
CircularProgressIndicator(modifier = Modifier.size(18.dp), strokeWidth = 2.dp, color = CatGreen)
797770
} else {
798-
Icon(
799-
Icons.Default.Refresh,
800-
contentDescription = stringResource(R.string.cd_refresh_recent),
801-
tint = CatGreen,
802-
)
771+
Icon(Icons.Default.Refresh, contentDescription = stringResource(R.string.cd_refresh_recent), tint = CatGreen)
803772
}
804773
}
805774
}
806-
GradientDivider()
807775
}
808776
}
809777

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
33
<string name="app_name">CallShield</string>
4+
<string name="activity_intro">查看最近的来电和 CallShield 拦截的通话。</string>
45
<string name="shortcut_lookup">查询</string>
56
<string name="shortcut_lookup_long">核查一个号码</string>
67
<string name="shortcut_scan">扫描</string>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,6 +1275,7 @@
12751275
<!-- MainActivity / Navigation -->
12761276
<string name="nav_home">Home</string>
12771277
<string name="nav_activity">Activity</string>
1278+
<string name="activity_intro">Review recent calls and calls stopped by CallShield.</string>
12781279
<string name="activity_tab_recent">Recent</string>
12791280
<string name="activity_tab_blocked">Blocked</string>
12801281
<string name="nav_lookup">Lookup</string>

0 commit comments

Comments
 (0)