refactor: Add defaults for AboutScreenContent

This commit is contained in:
LooKeR
2025-11-19 21:02:36 +05:30
committed by Sylvia van Os
parent 94beaef74b
commit f683b6bdb6
2 changed files with 6 additions and 21 deletions

View File

@@ -16,12 +16,7 @@ class ComposeAboutActivityTest {
@Test
fun testPasses(): Unit = with(rule) {
setContent {
AboutScreenContent(
content = AboutContent(LocalContext.current),
showDonate = true,
showRateOnGooglePlay = false,
onBackPressedDispatcher = null
)
AboutScreenContent(AboutContent(LocalContext.current))
}
onNodeWithTag("topbar_catima").assertIsDisplayed()
@@ -30,12 +25,7 @@ class ComposeAboutActivityTest {
@Test
fun testFails(): Unit = with(rule) {
setContent {
AboutScreenContent(
content = AboutContent(LocalContext.current),
showDonate = true,
showRateOnGooglePlay = false,
onBackPressedDispatcher = null
)
AboutScreenContent(AboutContent(LocalContext.current))
}
onNodeWithTag("topbar_catima").assertIsNotDisplayed()

View File

@@ -54,9 +54,9 @@ class AboutActivity : ComponentActivity() {
@Composable
fun AboutScreenContent(
content: AboutContent,
showDonate: Boolean,
showRateOnGooglePlay: Boolean,
onBackPressedDispatcher: OnBackPressedDispatcher?,
showDonate: Boolean = true,
showRateOnGooglePlay: Boolean = true,
onBackPressedDispatcher: OnBackPressedDispatcher? = null,
) {
CatimaTheme {
Scaffold(
@@ -166,10 +166,5 @@ fun AboutScreenContent(
@Preview
@Composable
fun AboutActivityPreview() {
AboutScreenContent(
content = AboutContent(LocalContext.current),
showDonate = true,
showRateOnGooglePlay = true,
onBackPressedDispatcher = null
)
AboutScreenContent(AboutContent(LocalContext.current))
}