diff --git a/app/src/androidTest/java/com/example/sw0b_001/AboutAppBarTest.kt b/app/src/androidTest/java/com/example/sw0b_001/AboutAppBarTest.kt new file mode 100644 index 00000000..b38ce6c7 --- /dev/null +++ b/app/src/androidTest/java/com/example/sw0b_001/AboutAppBarTest.kt @@ -0,0 +1,57 @@ +package com.example.sw0b_001 + +import androidx.compose.ui.test.junit4.createComposeRule +import androidx.compose.ui.test.onNodeWithContentDescription +import androidx.compose.ui.test.onNodeWithTag +import androidx.compose.ui.test.onNodeWithText +import androidx.compose.ui.test.performClick +import androidx.navigation.compose.rememberNavController +import com.example.sw0b_001.ui.appbars.AboutAppBar +import com.example.sw0b_001.ui.theme.AppTheme +import org.junit.Rule +import org.junit.Test + +class AboutAppBarTest { + + @get:Rule + val composeTestRule = createComposeRule() + + @Test + fun aboutAppBar_displaysAllMainElements() { + + composeTestRule.setContent { + AppTheme { + AboutAppBar(navController = rememberNavController()) + } + } + + composeTestRule + .onNodeWithText("About") + .assertExists() + + + composeTestRule + .onNodeWithContentDescription("Back") + .assertExists() + + + composeTestRule + .onNodeWithTag("bug_report_button") + .assertExists() + } + + @Test + fun aboutAppBar_bugReportButton_isClickable() { + + composeTestRule.setContent { + AppTheme { + AboutAppBar(navController = rememberNavController()) + } + } + + composeTestRule + .onNodeWithTag("bug_report_button") + .assertExists() + .performClick() + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/sw0b_001/ui/appbars/AboutAppBar.kt b/app/src/main/java/com/example/sw0b_001/ui/appbars/AboutAppBar.kt index 6eadb54d..e0fb0fff 100644 --- a/app/src/main/java/com/example/sw0b_001/ui/appbars/AboutAppBar.kt +++ b/app/src/main/java/com/example/sw0b_001/ui/appbars/AboutAppBar.kt @@ -3,6 +3,7 @@ package com.example.sw0b_001.ui.appbars import android.content.Context import android.content.Intent import android.net.Uri +import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer @@ -29,6 +30,7 @@ import androidx.compose.ui.unit.dp import androidx.navigation.NavController import com.example.sw0b_001.R import com.example.sw0b_001.ui.theme.AppTheme +import androidx.compose.ui.platform.testTag @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -42,11 +44,13 @@ fun AboutAppBar( Text( text = stringResource(R.string.about), style = MaterialTheme.typography.titleLarge, - fontWeight = FontWeight.Bold + fontWeight = FontWeight.SemiBold ) }, navigationIcon = { - IconButton(onClick = { navController.popBackStack() }) { + IconButton( + onClick = { navController.popBackStack() } + ) { Icon( imageVector = Icons.AutoMirrored.Filled.ArrowBack, contentDescription = stringResource(R.string.back) @@ -54,27 +58,40 @@ fun AboutAppBar( } }, actions = { + Row( verticalAlignment = Alignment.CenterVertically, modifier = Modifier - .padding(end = 16.dp) + .padding(end = 12.dp) + .background( + color = MaterialTheme.colorScheme.surfaceContainerHigh, + shape = MaterialTheme.shapes.large + ) .clickable { sendBugReportEmail(context) } + .padding(horizontal = 12.dp, vertical = 6.dp) + .testTag("bug_report_button") ) { - Text( - text = stringResource(R.string.bug_report), - style = MaterialTheme.typography.bodySmall, - ) - Spacer(modifier = Modifier.width(4.dp)) + Icon( imageVector = Icons.Default.Email, - contentDescription = stringResource(R.string.report_bug_feedback) + contentDescription = stringResource(R.string.report_bug_feedback), + tint = MaterialTheme.colorScheme.primary + ) + + Spacer(modifier = Modifier.width(6.dp)) + + Text( + text = stringResource(R.string.bug_report), + style = MaterialTheme.typography.labelMedium, + color = MaterialTheme.colorScheme.primary ) } }, - colors = TopAppBarDefaults.topAppBarColors() + colors = TopAppBarDefaults.centerAlignedTopAppBarColors( + containerColor = MaterialTheme.colorScheme.surface + ) ) } - private fun sendBugReportEmail(context: Context) { val emailIntent = Intent(Intent.ACTION_SENDTO).apply { data = Uri.parse("mailto:") diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt index 19235c77..cf445b7f 100644 --- a/fastlane/metadata/android/en-US/full_description.txt +++ b/fastlane/metadata/android/en-US/full_description.txt @@ -1,5 +1,5 @@ -SWOB (SMSWithoutBorders aka SMS without Borders) is a platforms which enables users with a smartphone to communicate with online third-party platforms using SMS messages. +SWOB ("SMSWithoutBorders", AKA "SMS Sithout Borders") is a platform which enables users with a smartphone to communicate with online third-party platforms using SMS messages. -A typical use-case of the platforms is sending out emails from platforms such as Gmail accounts. This becomes a useful tool in cases where access to the internet is limited or completely unavailable. Usage of SWOB intales having a proactive approach to maintaining your communications; the features that SWOB supports require the users to take delebrate actions prior to usage. +A typical use-case of the platforms is sending out emails from platforms such as Gmail accounts. This becomes a useful tool in cases where access to the internet is limited or completely unavailable. Usage of SWOB entails having a proactive approach to maintaining your communications; the features that SWOB supports require the users to take delebrate actions prior to usage. -Our goal is not to replace the internet; for the most part, the internet is an already efficient method of communication with many abilities that surpass what's possible with simple SMS. Unfortunately, we still have a good portion of telecom users in the world who will have to rely on SMS for task built for the internet. Based on value, internet based communications are cheaper than SMS based communications. We are using SWOB on the bases of accessibility to a communication medium. \ No newline at end of file +Our goal is not to replace the internet; for the most part, the internet is an already efficient method of communication with many abilities that surpass what's possible with simple SMS. Unfortunately, we still have a good portion of telecom users in the world who will have to rely on SMS for tasks built for the internet. Based on value, internet based communications are cheaper than SMS based communications. We are using SWOB on the basis of accessibility of a communication medium.