[#1082] Remove Side Navigation Drawer menu
- Closes #1082 - Closes #1086 - Added TODO links to the missing Settings actions - Fixed About screen versionCode displaying - Added app name to the About screen debug menu, as the Home screen does not contain it anymore - Changelog updated
This commit is contained in:
parent
ff0757b818
commit
f67c3fde8f
|
@ -9,6 +9,9 @@ directly impact users rather than highlighting other key architectural updates.*
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- Home screen side menu navigation was removed in favor of the Settings screen
|
||||||
|
|
||||||
## [2.0.2 (491)] - 2023-12-01
|
## [2.0.2 (491)] - 2023-12-01
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -13,34 +13,16 @@ class HomeTestSetup(
|
||||||
private val isShowFiatConversion: Boolean,
|
private val isShowFiatConversion: Boolean,
|
||||||
private val isCircularProgressBar: Boolean
|
private val isCircularProgressBar: Boolean
|
||||||
) {
|
) {
|
||||||
private val onAboutCount = AtomicInteger(0)
|
|
||||||
private val onSeedCount = AtomicInteger(0)
|
|
||||||
private val onSettingsCount = AtomicInteger(0)
|
private val onSettingsCount = AtomicInteger(0)
|
||||||
private val onSupportCount = AtomicInteger(0)
|
|
||||||
private val onReceiveCount = AtomicInteger(0)
|
private val onReceiveCount = AtomicInteger(0)
|
||||||
private val onSendCount = AtomicInteger(0)
|
private val onSendCount = AtomicInteger(0)
|
||||||
private val onHistoryCount = AtomicInteger(0)
|
private val onHistoryCount = AtomicInteger(0)
|
||||||
|
|
||||||
fun getOnAboutCount(): Int {
|
|
||||||
composeTestRule.waitForIdle()
|
|
||||||
return onAboutCount.get()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getOnSettingsCount(): Int {
|
fun getOnSettingsCount(): Int {
|
||||||
composeTestRule.waitForIdle()
|
composeTestRule.waitForIdle()
|
||||||
return onSettingsCount.get()
|
return onSettingsCount.get()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getOnSupportCount(): Int {
|
|
||||||
composeTestRule.waitForIdle()
|
|
||||||
return onSupportCount.get()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getOnSeedCount(): Int {
|
|
||||||
composeTestRule.waitForIdle()
|
|
||||||
return onSeedCount.get()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getOnReceiveCount(): Int {
|
fun getOnReceiveCount(): Int {
|
||||||
composeTestRule.waitForIdle()
|
composeTestRule.waitForIdle()
|
||||||
return onReceiveCount.get()
|
return onReceiveCount.get()
|
||||||
|
@ -64,7 +46,6 @@ class HomeTestSetup(
|
||||||
@Composable
|
@Composable
|
||||||
@Suppress("TestFunctionName")
|
@Suppress("TestFunctionName")
|
||||||
fun DefaultContent() {
|
fun DefaultContent() {
|
||||||
val drawerValues = drawerBackHandler()
|
|
||||||
Home(
|
Home(
|
||||||
walletSnapshot,
|
walletSnapshot,
|
||||||
isUpdateAvailable = false,
|
isUpdateAvailable = false,
|
||||||
|
@ -74,15 +55,6 @@ class HomeTestSetup(
|
||||||
goSettings = {
|
goSettings = {
|
||||||
onSettingsCount.incrementAndGet()
|
onSettingsCount.incrementAndGet()
|
||||||
},
|
},
|
||||||
goSeedPhrase = {
|
|
||||||
onSeedCount.incrementAndGet()
|
|
||||||
},
|
|
||||||
goSupport = {
|
|
||||||
onSupportCount.incrementAndGet()
|
|
||||||
},
|
|
||||||
goAbout = {
|
|
||||||
onAboutCount.incrementAndGet()
|
|
||||||
},
|
|
||||||
goReceive = {
|
goReceive = {
|
||||||
onReceiveCount.incrementAndGet()
|
onReceiveCount.incrementAndGet()
|
||||||
},
|
},
|
||||||
|
@ -92,8 +64,6 @@ class HomeTestSetup(
|
||||||
goHistory = {
|
goHistory = {
|
||||||
onHistoryCount.incrementAndGet()
|
onHistoryCount.incrementAndGet()
|
||||||
},
|
},
|
||||||
drawerState = drawerValues.drawerState,
|
|
||||||
scope = drawerValues.scope
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,65 +0,0 @@
|
||||||
package co.electriccoin.zcash.ui.screen.home.integration
|
|
||||||
|
|
||||||
import androidx.compose.ui.test.assertIsDisplayed
|
|
||||||
import androidx.compose.ui.test.assertIsNotDisplayed
|
|
||||||
import androidx.compose.ui.test.junit4.createAndroidComposeRule
|
|
||||||
import androidx.compose.ui.test.onNodeWithTag
|
|
||||||
import androidx.compose.ui.test.performClick
|
|
||||||
import androidx.test.espresso.Espresso
|
|
||||||
import androidx.test.filters.MediumTest
|
|
||||||
import cash.z.ecc.android.sdk.Synchronizer
|
|
||||||
import cash.z.ecc.android.sdk.model.PercentDecimal
|
|
||||||
import co.electriccoin.zcash.test.UiTestPrerequisites
|
|
||||||
import co.electriccoin.zcash.ui.common.UiTestingActivity
|
|
||||||
import co.electriccoin.zcash.ui.fixture.WalletSnapshotFixture
|
|
||||||
import co.electriccoin.zcash.ui.screen.home.HomeTag
|
|
||||||
import co.electriccoin.zcash.ui.screen.home.HomeTestSetup
|
|
||||||
import co.electriccoin.zcash.ui.screen.home.model.WalletSnapshot
|
|
||||||
import org.junit.Rule
|
|
||||||
import org.junit.Test
|
|
||||||
|
|
||||||
class HomeActivityTest : UiTestPrerequisites() {
|
|
||||||
|
|
||||||
@get:Rule
|
|
||||||
val composeTestRule = createAndroidComposeRule<UiTestingActivity>()
|
|
||||||
|
|
||||||
private fun newTestSetup(walletSnapshot: WalletSnapshot) = HomeTestSetup(
|
|
||||||
composeTestRule,
|
|
||||||
walletSnapshot,
|
|
||||||
isShowFiatConversion = false,
|
|
||||||
isCircularProgressBar = false
|
|
||||||
)
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@MediumTest
|
|
||||||
fun open_close_drawer_menu_test() {
|
|
||||||
val walletSnapshot = WalletSnapshotFixture.new(
|
|
||||||
status = Synchronizer.Status.SYNCING,
|
|
||||||
progress = PercentDecimal(0.5f)
|
|
||||||
)
|
|
||||||
val testSetup = newTestSetup(walletSnapshot)
|
|
||||||
testSetup.setDefaultContent()
|
|
||||||
|
|
||||||
composeTestRule.onNodeWithTag(HomeTag.DRAWER_MENU).also {
|
|
||||||
it.assertIsNotDisplayed()
|
|
||||||
}
|
|
||||||
composeTestRule.onNodeWithTag(HomeTag.DRAWER_MENU_OPEN_BUTTON).also {
|
|
||||||
it.assertIsDisplayed()
|
|
||||||
it.performClick()
|
|
||||||
}
|
|
||||||
|
|
||||||
composeTestRule.waitForIdle()
|
|
||||||
|
|
||||||
composeTestRule.onNodeWithTag(HomeTag.DRAWER_MENU).also {
|
|
||||||
it.assertIsDisplayed()
|
|
||||||
}
|
|
||||||
|
|
||||||
Espresso.pressBack()
|
|
||||||
|
|
||||||
composeTestRule.waitForIdle()
|
|
||||||
|
|
||||||
composeTestRule.onNodeWithTag(HomeTag.DRAWER_MENU).also {
|
|
||||||
it.assertIsNotDisplayed()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -133,22 +133,6 @@ class HomeViewTest : UiTestPrerequisites() {
|
||||||
assertEquals(1, testSetup.getOnHistoryCount())
|
assertEquals(1, testSetup.getOnHistoryCount())
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@MediumTest
|
|
||||||
fun hamburger_seed() {
|
|
||||||
val testSetup = newTestSetup()
|
|
||||||
|
|
||||||
assertEquals(0, testSetup.getOnReceiveCount())
|
|
||||||
|
|
||||||
composeTestRule.openNavigationDrawer()
|
|
||||||
|
|
||||||
composeTestRule.onNodeWithText(getStringResource(R.string.home_menu_seed_phrase)).also {
|
|
||||||
it.performClick()
|
|
||||||
}
|
|
||||||
|
|
||||||
assertEquals(1, testSetup.getOnSeedCount())
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@MediumTest
|
@MediumTest
|
||||||
fun hamburger_settings() {
|
fun hamburger_settings() {
|
||||||
|
@ -156,47 +140,11 @@ class HomeViewTest : UiTestPrerequisites() {
|
||||||
|
|
||||||
assertEquals(0, testSetup.getOnReceiveCount())
|
assertEquals(0, testSetup.getOnReceiveCount())
|
||||||
|
|
||||||
composeTestRule.openNavigationDrawer()
|
composeTestRule.openSettings()
|
||||||
|
|
||||||
composeTestRule.onNodeWithText(getStringResource(R.string.home_menu_settings)).also {
|
|
||||||
it.performClick()
|
|
||||||
}
|
|
||||||
|
|
||||||
assertEquals(1, testSetup.getOnSettingsCount())
|
assertEquals(1, testSetup.getOnSettingsCount())
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@MediumTest
|
|
||||||
fun hamburger_support() {
|
|
||||||
val testSetup = newTestSetup()
|
|
||||||
|
|
||||||
assertEquals(0, testSetup.getOnReceiveCount())
|
|
||||||
|
|
||||||
composeTestRule.openNavigationDrawer()
|
|
||||||
|
|
||||||
composeTestRule.onNodeWithText(getStringResource(R.string.home_menu_support)).also {
|
|
||||||
it.performClick()
|
|
||||||
}
|
|
||||||
|
|
||||||
assertEquals(1, testSetup.getOnSupportCount())
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@MediumTest
|
|
||||||
fun hamburger_about() {
|
|
||||||
val testSetup = newTestSetup()
|
|
||||||
|
|
||||||
assertEquals(0, testSetup.getOnReceiveCount())
|
|
||||||
|
|
||||||
composeTestRule.openNavigationDrawer()
|
|
||||||
|
|
||||||
composeTestRule.onNodeWithText(getStringResource(R.string.home_menu_about)).also {
|
|
||||||
it.performClick()
|
|
||||||
}
|
|
||||||
|
|
||||||
assertEquals(1, testSetup.getOnAboutCount())
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun newTestSetup(
|
private fun newTestSetup(
|
||||||
isShowFiatConversion: Boolean = true,
|
isShowFiatConversion: Boolean = true,
|
||||||
isCircularProgressBar: Boolean = true,
|
isCircularProgressBar: Boolean = true,
|
||||||
|
@ -211,7 +159,7 @@ class HomeViewTest : UiTestPrerequisites() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun ComposeContentTestRule.openNavigationDrawer() {
|
private fun ComposeContentTestRule.openSettings() {
|
||||||
onNodeWithContentDescription(getStringResource(R.string.home_menu_content_description)).also {
|
onNodeWithContentDescription(getStringResource(R.string.home_menu_content_description)).also {
|
||||||
it.performClick()
|
it.performClick()
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,13 +52,10 @@ internal fun MainActivity.Navigation() {
|
||||||
NavHost(navController = navController, startDestination = HOME) {
|
NavHost(navController = navController, startDestination = HOME) {
|
||||||
composable(HOME) {
|
composable(HOME) {
|
||||||
WrapHome(
|
WrapHome(
|
||||||
goAbout = { navController.navigateJustOnce(ABOUT) },
|
|
||||||
goHistory = { navController.navigateJustOnce(HISTORY) },
|
goHistory = { navController.navigateJustOnce(HISTORY) },
|
||||||
goReceive = { navController.navigateJustOnce(RECEIVE) },
|
goReceive = { navController.navigateJustOnce(RECEIVE) },
|
||||||
goSeedPhrase = { navController.navigateJustOnce(SEED_RECOVERY) },
|
|
||||||
goSend = { navController.navigateJustOnce(SEND) },
|
goSend = { navController.navigateJustOnce(SEND) },
|
||||||
goSettings = { navController.navigateJustOnce(SETTINGS) },
|
goSettings = { navController.navigateJustOnce(SETTINGS) },
|
||||||
goSupport = { navController.navigateJustOnce(SUPPORT) },
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if (ConfigurationEntries.IS_APP_UPDATE_CHECK_ENABLED.getValue(RemoteConfig.current)) {
|
if (ConfigurationEntries.IS_APP_UPDATE_CHECK_ENABLED.getValue(RemoteConfig.current)) {
|
||||||
|
@ -80,9 +77,20 @@ internal fun MainActivity.Navigation() {
|
||||||
goBack = {
|
goBack = {
|
||||||
navController.popBackStackJustOnce(SETTINGS)
|
navController.popBackStackJustOnce(SETTINGS)
|
||||||
},
|
},
|
||||||
|
goDocumentation = {
|
||||||
|
// TODO [#1084]: Documentation screen
|
||||||
|
// TODO [#1084]: https://github.com/Electric-Coin-Company/zashi-android/issues/1084
|
||||||
|
},
|
||||||
goExportPrivateData = {
|
goExportPrivateData = {
|
||||||
navController.navigateJustOnce(EXPORT_PRIVATE_DATA)
|
navController.navigateJustOnce(EXPORT_PRIVATE_DATA)
|
||||||
},
|
},
|
||||||
|
goFeedback = {
|
||||||
|
navController.navigateJustOnce(SUPPORT)
|
||||||
|
},
|
||||||
|
goPrivacyPolicy = {
|
||||||
|
// TODO [#1083]: Privacy Policy screen
|
||||||
|
// TODO [#1083]: https://github.com/Electric-Coin-Company/zashi-android/issues/1083
|
||||||
|
},
|
||||||
goSeedRecovery = {
|
goSeedRecovery = {
|
||||||
navController.navigateJustOnce(SEED_RECOVERY)
|
navController.navigateJustOnce(SEED_RECOVERY)
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,6 +122,12 @@ private fun DebugMenu(
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = {
|
text = {
|
||||||
Column {
|
Column {
|
||||||
|
Text(
|
||||||
|
stringResource(
|
||||||
|
id = R.string.about_debug_menu_app_name,
|
||||||
|
stringResource(id = R.string.app_name)
|
||||||
|
)
|
||||||
|
)
|
||||||
Text(stringResource(R.string.about_debug_menu_build, versionInfo.gitSha))
|
Text(stringResource(R.string.about_debug_menu_build, versionInfo.gitSha))
|
||||||
Text(configInfo.toSupportString())
|
Text(configInfo.toSupportString())
|
||||||
}
|
}
|
||||||
|
@ -167,8 +173,7 @@ fun AboutMainContent(
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(
|
text = stringResource(
|
||||||
R.string.about_version_format,
|
R.string.about_version_format,
|
||||||
versionInfo.versionName,
|
versionInfo.versionName
|
||||||
versionInfo.versionCode
|
|
||||||
),
|
),
|
||||||
style = ZcashTheme.typography.primary.titleSmall
|
style = ZcashTheme.typography.primary.titleSmall
|
||||||
)
|
)
|
||||||
|
|
|
@ -26,20 +26,14 @@ import kotlinx.coroutines.CoroutineScope
|
||||||
@Composable
|
@Composable
|
||||||
@Suppress("LongParameterList")
|
@Suppress("LongParameterList")
|
||||||
internal fun MainActivity.WrapHome(
|
internal fun MainActivity.WrapHome(
|
||||||
goSeedPhrase: () -> Unit,
|
|
||||||
goSettings: () -> Unit,
|
goSettings: () -> Unit,
|
||||||
goSupport: () -> Unit,
|
|
||||||
goAbout: () -> Unit,
|
|
||||||
goReceive: () -> Unit,
|
goReceive: () -> Unit,
|
||||||
goSend: () -> Unit,
|
goSend: () -> Unit,
|
||||||
goHistory: () -> Unit
|
goHistory: () -> Unit
|
||||||
) {
|
) {
|
||||||
WrapHome(
|
WrapHome(
|
||||||
this,
|
this,
|
||||||
goSeedPhrase = goSeedPhrase,
|
|
||||||
goSettings = goSettings,
|
goSettings = goSettings,
|
||||||
goSupport = goSupport,
|
|
||||||
goAbout = goAbout,
|
|
||||||
goReceive = goReceive,
|
goReceive = goReceive,
|
||||||
goSend = goSend,
|
goSend = goSend,
|
||||||
goHistory = goHistory,
|
goHistory = goHistory,
|
||||||
|
@ -50,10 +44,7 @@ internal fun MainActivity.WrapHome(
|
||||||
@Suppress("LongParameterList")
|
@Suppress("LongParameterList")
|
||||||
internal fun WrapHome(
|
internal fun WrapHome(
|
||||||
activity: ComponentActivity,
|
activity: ComponentActivity,
|
||||||
goSeedPhrase: () -> Unit,
|
|
||||||
goSettings: () -> Unit,
|
goSettings: () -> Unit,
|
||||||
goSupport: () -> Unit,
|
|
||||||
goAbout: () -> Unit,
|
|
||||||
goReceive: () -> Unit,
|
goReceive: () -> Unit,
|
||||||
goSend: () -> Unit,
|
goSend: () -> Unit,
|
||||||
goHistory: () -> Unit,
|
goHistory: () -> Unit,
|
||||||
|
@ -82,23 +73,16 @@ internal fun WrapHome(
|
||||||
if (null == walletSnapshot) {
|
if (null == walletSnapshot) {
|
||||||
// Display loading indicator
|
// Display loading indicator
|
||||||
} else {
|
} else {
|
||||||
val drawerValues = drawerBackHandler()
|
|
||||||
|
|
||||||
Home(
|
Home(
|
||||||
walletSnapshot = walletSnapshot,
|
walletSnapshot = walletSnapshot,
|
||||||
isUpdateAvailable = updateAvailable,
|
isUpdateAvailable = updateAvailable,
|
||||||
isKeepScreenOnDuringSync = isKeepScreenOnWhileSyncing,
|
isKeepScreenOnDuringSync = isKeepScreenOnWhileSyncing,
|
||||||
isFiatConversionEnabled = isFiatConversionEnabled,
|
isFiatConversionEnabled = isFiatConversionEnabled,
|
||||||
isCircularProgressBarEnabled = isCircularProgressBarEnabled,
|
isCircularProgressBarEnabled = isCircularProgressBarEnabled,
|
||||||
goSeedPhrase = goSeedPhrase,
|
|
||||||
goSettings = goSettings,
|
goSettings = goSettings,
|
||||||
goSupport = goSupport,
|
|
||||||
goAbout = goAbout,
|
|
||||||
goReceive = goReceive,
|
goReceive = goReceive,
|
||||||
goSend = goSend,
|
goSend = goSend,
|
||||||
goHistory = goHistory,
|
goHistory = goHistory
|
||||||
drawerState = drawerValues.drawerState,
|
|
||||||
scope = drawerValues.scope
|
|
||||||
)
|
)
|
||||||
|
|
||||||
activity.reportFullyDrawn()
|
activity.reportFullyDrawn()
|
||||||
|
|
|
@ -8,6 +8,5 @@ object HomeTag {
|
||||||
const val PROGRESS = "progress_bar"
|
const val PROGRESS = "progress_bar"
|
||||||
const val SINGLE_LINE_TEXT = "single_line_text"
|
const val SINGLE_LINE_TEXT = "single_line_text"
|
||||||
const val FIAT_CONVERSION = "fiat_conversion"
|
const val FIAT_CONVERSION = "fiat_conversion"
|
||||||
const val DRAWER_MENU = "drawer_menu"
|
const val SETTINGS_TOP_BAR_BUTTON = "settings_top_bar_button"
|
||||||
const val DRAWER_MENU_OPEN_BUTTON = "drawer_menu_open_button"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,34 +14,18 @@ import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.wrapContentSize
|
import androidx.compose.foundation.layout.wrapContentSize
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.foundation.verticalScroll
|
import androidx.compose.foundation.verticalScroll
|
||||||
import androidx.compose.material.icons.Icons
|
|
||||||
import androidx.compose.material.icons.filled.ContactSupport
|
|
||||||
import androidx.compose.material.icons.filled.Info
|
|
||||||
import androidx.compose.material.icons.filled.Menu
|
|
||||||
import androidx.compose.material.icons.filled.Password
|
|
||||||
import androidx.compose.material.icons.filled.Settings
|
|
||||||
import androidx.compose.material3.CircularProgressIndicator
|
import androidx.compose.material3.CircularProgressIndicator
|
||||||
import androidx.compose.material3.DrawerState
|
|
||||||
import androidx.compose.material3.DrawerValue
|
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
import androidx.compose.material3.ModalDrawerSheet
|
|
||||||
import androidx.compose.material3.ModalNavigationDrawer
|
|
||||||
import androidx.compose.material3.NavigationDrawerItem
|
|
||||||
import androidx.compose.material3.NavigationDrawerItemDefaults
|
|
||||||
import androidx.compose.material3.Scaffold
|
import androidx.compose.material3.Scaffold
|
||||||
import androidx.compose.material3.Text
|
|
||||||
import androidx.compose.material3.TopAppBar
|
|
||||||
import androidx.compose.material3.rememberDrawerState
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.rememberCoroutineScope
|
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.platform.LocalConfiguration
|
import androidx.compose.ui.platform.LocalConfiguration
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.testTag
|
import androidx.compose.ui.platform.testTag
|
||||||
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
@ -50,21 +34,19 @@ import cash.z.ecc.android.sdk.model.FiatCurrencyConversionRateState
|
||||||
import cash.z.ecc.android.sdk.model.PercentDecimal
|
import cash.z.ecc.android.sdk.model.PercentDecimal
|
||||||
import co.electriccoin.zcash.ui.R
|
import co.electriccoin.zcash.ui.R
|
||||||
import co.electriccoin.zcash.ui.common.DisableScreenTimeout
|
import co.electriccoin.zcash.ui.common.DisableScreenTimeout
|
||||||
import co.electriccoin.zcash.ui.common.closeDrawerMenu
|
|
||||||
import co.electriccoin.zcash.ui.common.openDrawerMenu
|
|
||||||
import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
|
import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
|
||||||
import co.electriccoin.zcash.ui.design.component.Body
|
import co.electriccoin.zcash.ui.design.component.Body
|
||||||
import co.electriccoin.zcash.ui.design.component.BodyWithFiatCurrencySymbol
|
import co.electriccoin.zcash.ui.design.component.BodyWithFiatCurrencySymbol
|
||||||
import co.electriccoin.zcash.ui.design.component.GradientSurface
|
import co.electriccoin.zcash.ui.design.component.GradientSurface
|
||||||
import co.electriccoin.zcash.ui.design.component.HeaderWithZecIcon
|
import co.electriccoin.zcash.ui.design.component.HeaderWithZecIcon
|
||||||
import co.electriccoin.zcash.ui.design.component.PrimaryButton
|
import co.electriccoin.zcash.ui.design.component.PrimaryButton
|
||||||
|
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
|
||||||
import co.electriccoin.zcash.ui.design.component.TertiaryButton
|
import co.electriccoin.zcash.ui.design.component.TertiaryButton
|
||||||
import co.electriccoin.zcash.ui.design.theme.ZcashTheme
|
import co.electriccoin.zcash.ui.design.theme.ZcashTheme
|
||||||
import co.electriccoin.zcash.ui.fixture.WalletSnapshotFixture
|
import co.electriccoin.zcash.ui.fixture.WalletSnapshotFixture
|
||||||
import co.electriccoin.zcash.ui.screen.home.HomeTag
|
import co.electriccoin.zcash.ui.screen.home.HomeTag
|
||||||
import co.electriccoin.zcash.ui.screen.home.model.WalletDisplayValues
|
import co.electriccoin.zcash.ui.screen.home.model.WalletDisplayValues
|
||||||
import co.electriccoin.zcash.ui.screen.home.model.WalletSnapshot
|
import co.electriccoin.zcash.ui.screen.home.model.WalletSnapshot
|
||||||
import kotlinx.coroutines.CoroutineScope
|
|
||||||
|
|
||||||
@Preview("Home")
|
@Preview("Home")
|
||||||
@Composable
|
@Composable
|
||||||
|
@ -77,15 +59,10 @@ private fun ComposablePreview() {
|
||||||
isKeepScreenOnDuringSync = false,
|
isKeepScreenOnDuringSync = false,
|
||||||
isFiatConversionEnabled = false,
|
isFiatConversionEnabled = false,
|
||||||
isCircularProgressBarEnabled = false,
|
isCircularProgressBarEnabled = false,
|
||||||
goSeedPhrase = {},
|
|
||||||
goSettings = {},
|
goSettings = {},
|
||||||
goSupport = {},
|
|
||||||
goAbout = {},
|
|
||||||
goReceive = {},
|
goReceive = {},
|
||||||
goSend = {},
|
goSend = {},
|
||||||
goHistory = {},
|
goHistory = {}
|
||||||
drawerState = rememberDrawerState(DrawerValue.Closed),
|
|
||||||
scope = rememberCoroutineScope()
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,130 +76,53 @@ fun Home(
|
||||||
isKeepScreenOnDuringSync: Boolean?,
|
isKeepScreenOnDuringSync: Boolean?,
|
||||||
isFiatConversionEnabled: Boolean,
|
isFiatConversionEnabled: Boolean,
|
||||||
isCircularProgressBarEnabled: Boolean,
|
isCircularProgressBarEnabled: Boolean,
|
||||||
goSeedPhrase: () -> Unit,
|
|
||||||
goSettings: () -> Unit,
|
goSettings: () -> Unit,
|
||||||
goSupport: () -> Unit,
|
|
||||||
goAbout: () -> Unit,
|
|
||||||
goReceive: () -> Unit,
|
goReceive: () -> Unit,
|
||||||
goSend: () -> Unit,
|
goSend: () -> Unit,
|
||||||
goHistory: () -> Unit,
|
goHistory: () -> Unit
|
||||||
drawerState: DrawerState,
|
|
||||||
scope: CoroutineScope
|
|
||||||
) {
|
) {
|
||||||
ModalNavigationDrawer(
|
Scaffold(topBar = {
|
||||||
drawerState = drawerState,
|
HomeTopAppBar(onSettings = goSettings)
|
||||||
drawerContent = {
|
}) { paddingValues ->
|
||||||
HomeDrawer(
|
HomeMainContent(
|
||||||
onCloseDrawer = { drawerState.closeDrawerMenu(scope) },
|
walletSnapshot = walletSnapshot,
|
||||||
goSeedPhrase = goSeedPhrase,
|
isUpdateAvailable = isUpdateAvailable,
|
||||||
goSettings = goSettings,
|
isKeepScreenOnDuringSync = isKeepScreenOnDuringSync,
|
||||||
goSupport = goSupport,
|
isFiatConversionEnabled = isFiatConversionEnabled,
|
||||||
goAbout = goAbout
|
isCircularProgressBarEnabled = isCircularProgressBarEnabled,
|
||||||
|
goReceive = goReceive,
|
||||||
|
goSend = goSend,
|
||||||
|
goHistory = goHistory,
|
||||||
|
modifier = Modifier.padding(
|
||||||
|
top = paddingValues.calculateTopPadding() + ZcashTheme.dimens.spacingDefault,
|
||||||
|
bottom = paddingValues.calculateBottomPadding() + ZcashTheme.dimens.spacingHuge,
|
||||||
|
start = ZcashTheme.dimens.screenHorizontalSpacing,
|
||||||
|
end = ZcashTheme.dimens.screenHorizontalSpacing
|
||||||
)
|
)
|
||||||
},
|
|
||||||
content = {
|
|
||||||
Scaffold(topBar = {
|
|
||||||
HomeTopAppBar(
|
|
||||||
openDrawer = { drawerState.openDrawerMenu(scope) }
|
|
||||||
)
|
|
||||||
}) { paddingValues ->
|
|
||||||
HomeMainContent(
|
|
||||||
walletSnapshot = walletSnapshot,
|
|
||||||
isUpdateAvailable = isUpdateAvailable,
|
|
||||||
isKeepScreenOnDuringSync = isKeepScreenOnDuringSync,
|
|
||||||
isFiatConversionEnabled = isFiatConversionEnabled,
|
|
||||||
isCircularProgressBarEnabled = isCircularProgressBarEnabled,
|
|
||||||
goReceive = goReceive,
|
|
||||||
goSend = goSend,
|
|
||||||
goHistory = goHistory,
|
|
||||||
modifier = Modifier.padding(
|
|
||||||
top = paddingValues.calculateTopPadding() + ZcashTheme.dimens.spacingDefault,
|
|
||||||
bottom = paddingValues.calculateBottomPadding() + ZcashTheme.dimens.spacingHuge,
|
|
||||||
start = ZcashTheme.dimens.screenHorizontalSpacing,
|
|
||||||
end = ZcashTheme.dimens.screenHorizontalSpacing
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
|
||||||
private fun HomeTopAppBar(
|
|
||||||
openDrawer: () -> Unit
|
|
||||||
) {
|
|
||||||
TopAppBar(
|
|
||||||
title = { Text(text = stringResource(id = R.string.app_name)) },
|
|
||||||
navigationIcon = {
|
|
||||||
IconButton(
|
|
||||||
onClick = openDrawer,
|
|
||||||
modifier = Modifier.testTag(HomeTag.DRAWER_MENU_OPEN_BUTTON)
|
|
||||||
) {
|
|
||||||
Icon(
|
|
||||||
imageVector = Icons.Filled.Menu,
|
|
||||||
contentDescription = stringResource(R.string.home_menu_content_description)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
private fun HomeDrawer(
|
|
||||||
onCloseDrawer: () -> Unit,
|
|
||||||
goSeedPhrase: () -> Unit,
|
|
||||||
goSettings: () -> Unit,
|
|
||||||
goSupport: () -> Unit,
|
|
||||||
goAbout: () -> Unit,
|
|
||||||
) {
|
|
||||||
ModalDrawerSheet(
|
|
||||||
modifier = Modifier.testTag(HomeTag.DRAWER_MENU)
|
|
||||||
) {
|
|
||||||
Spacer(Modifier.height(ZcashTheme.dimens.spacingDefault))
|
|
||||||
NavigationDrawerItem(
|
|
||||||
icon = { Icon(Icons.Default.Password, contentDescription = null) },
|
|
||||||
label = { Text(stringResource(id = R.string.home_menu_seed_phrase)) },
|
|
||||||
selected = false,
|
|
||||||
onClick = {
|
|
||||||
onCloseDrawer()
|
|
||||||
goSeedPhrase()
|
|
||||||
},
|
|
||||||
modifier = Modifier.padding(NavigationDrawerItemDefaults.ItemPadding)
|
|
||||||
)
|
|
||||||
NavigationDrawerItem(
|
|
||||||
icon = { Icon(Icons.Default.Settings, contentDescription = null) },
|
|
||||||
label = { Text(stringResource(id = R.string.home_menu_settings)) },
|
|
||||||
selected = false,
|
|
||||||
onClick = {
|
|
||||||
onCloseDrawer()
|
|
||||||
goSettings()
|
|
||||||
},
|
|
||||||
modifier = Modifier.padding(NavigationDrawerItemDefaults.ItemPadding)
|
|
||||||
)
|
|
||||||
NavigationDrawerItem(
|
|
||||||
icon = { Icon(Icons.Default.ContactSupport, contentDescription = null) },
|
|
||||||
label = { Text(stringResource(id = R.string.home_menu_support)) },
|
|
||||||
selected = false,
|
|
||||||
onClick = {
|
|
||||||
onCloseDrawer()
|
|
||||||
goSupport()
|
|
||||||
},
|
|
||||||
modifier = Modifier.padding(NavigationDrawerItemDefaults.ItemPadding)
|
|
||||||
)
|
|
||||||
NavigationDrawerItem(
|
|
||||||
icon = { Icon(Icons.Default.Info, contentDescription = null) },
|
|
||||||
label = { Text(stringResource(id = R.string.home_menu_about)) },
|
|
||||||
selected = false,
|
|
||||||
onClick = {
|
|
||||||
onCloseDrawer()
|
|
||||||
goAbout()
|
|
||||||
},
|
|
||||||
modifier = Modifier.padding(NavigationDrawerItemDefaults.ItemPadding)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun HomeTopAppBar(
|
||||||
|
onSettings: () -> Unit
|
||||||
|
) {
|
||||||
|
SmallTopAppBar(
|
||||||
|
showTitleLogo = true,
|
||||||
|
hamburgerMenuActions = {
|
||||||
|
IconButton(
|
||||||
|
onClick = onSettings,
|
||||||
|
modifier = Modifier.testTag(HomeTag.SETTINGS_TOP_BAR_BUTTON)
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
painter = painterResource(id = co.electriccoin.zcash.ui.design.R.drawable.hamburger_menu_icon),
|
||||||
|
contentDescription = stringResource(id = R.string.home_menu_content_description)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Suppress("LongParameterList")
|
@Suppress("LongParameterList")
|
||||||
@Composable
|
@Composable
|
||||||
private fun HomeMainContent(
|
private fun HomeMainContent(
|
||||||
|
|
|
@ -16,27 +16,38 @@ import co.electriccoin.zcash.ui.screen.settings.view.Settings
|
||||||
import co.electriccoin.zcash.ui.screen.settings.viewmodel.SettingsViewModel
|
import co.electriccoin.zcash.ui.screen.settings.viewmodel.SettingsViewModel
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
@Suppress("LongParameterList")
|
||||||
internal fun MainActivity.WrapSettings(
|
internal fun MainActivity.WrapSettings(
|
||||||
goAbout: () -> Unit,
|
goAbout: () -> Unit,
|
||||||
goBack: () -> Unit,
|
goBack: () -> Unit,
|
||||||
|
goDocumentation: () -> Unit,
|
||||||
goExportPrivateData: () -> Unit,
|
goExportPrivateData: () -> Unit,
|
||||||
|
goFeedback: () -> Unit,
|
||||||
|
goPrivacyPolicy: () -> Unit,
|
||||||
goSeedRecovery: () -> Unit,
|
goSeedRecovery: () -> Unit,
|
||||||
) {
|
) {
|
||||||
WrapSettings(
|
WrapSettings(
|
||||||
activity = this,
|
activity = this,
|
||||||
goAbout = goAbout,
|
goAbout = goAbout,
|
||||||
goBack = goBack,
|
goBack = goBack,
|
||||||
|
goDocumentation = goDocumentation,
|
||||||
goExportPrivateData = goExportPrivateData,
|
goExportPrivateData = goExportPrivateData,
|
||||||
|
goFeedback = goFeedback,
|
||||||
|
goPrivacyPolicy = goPrivacyPolicy,
|
||||||
goSeedRecovery = goSeedRecovery
|
goSeedRecovery = goSeedRecovery
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
@Suppress("LongParameterList")
|
||||||
private fun WrapSettings(
|
private fun WrapSettings(
|
||||||
activity: ComponentActivity,
|
activity: ComponentActivity,
|
||||||
goBack: () -> Unit,
|
|
||||||
goAbout: () -> Unit,
|
goAbout: () -> Unit,
|
||||||
|
goBack: () -> Unit,
|
||||||
|
goDocumentation: () -> Unit,
|
||||||
goExportPrivateData: () -> Unit,
|
goExportPrivateData: () -> Unit,
|
||||||
|
goFeedback: () -> Unit,
|
||||||
|
goPrivacyPolicy: () -> Unit,
|
||||||
goSeedRecovery: () -> Unit,
|
goSeedRecovery: () -> Unit,
|
||||||
) {
|
) {
|
||||||
val walletViewModel by activity.viewModels<WalletViewModel>()
|
val walletViewModel by activity.viewModels<WalletViewModel>()
|
||||||
|
@ -67,9 +78,9 @@ private fun WrapSettings(
|
||||||
),
|
),
|
||||||
onBack = goBack,
|
onBack = goBack,
|
||||||
onSeedRecovery = goSeedRecovery,
|
onSeedRecovery = goSeedRecovery,
|
||||||
onDocumentation = {},
|
onDocumentation = goDocumentation,
|
||||||
onPrivacyPolicy = {},
|
onPrivacyPolicy = goPrivacyPolicy,
|
||||||
onFeedback = {},
|
onFeedback = goFeedback,
|
||||||
onAbout = goAbout,
|
onAbout = goAbout,
|
||||||
onExportPrivateData = goExportPrivateData,
|
onExportPrivateData = goExportPrivateData,
|
||||||
onRescanWallet = {
|
onRescanWallet = {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import kotlinx.datetime.Instant
|
||||||
data class ConfigInfo(val configurationUpdatedAt: Instant?) {
|
data class ConfigInfo(val configurationUpdatedAt: Instant?) {
|
||||||
|
|
||||||
fun toSupportString() = buildString {
|
fun toSupportString() = buildString {
|
||||||
appendLine("Configuration: $configurationUpdatedAt")
|
append("Configuration: $configurationUpdatedAt")
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
<string name="about_back">Back</string>
|
<string name="about_back">Back</string>
|
||||||
<string name="about_back_content_description">Back</string>
|
<string name="about_back_content_description">Back</string>
|
||||||
<string name="about_version_format" formatted="true">Version <xliff:g example="1.0" id="version_name">%1$s
|
<string name="about_version_format" formatted="true">Version <xliff:g example="1.0" id="version_name">%1$s
|
||||||
</xliff:g> (<xliff:g example="1.0" id="version_code">%2$d</xliff:g>)</string>
|
</xliff:g></string>
|
||||||
|
<string name="about_debug_menu_app_name">App name:
|
||||||
|
<xliff:g example="Zashi (D)" id="app_name">%1$s</xliff:g></string>
|
||||||
<string name="about_debug_menu_build">Build: <xliff:g example="635dac0eb9ddc2bc6da5177f0dd495d8b76af4dc"
|
<string name="about_debug_menu_build">Build: <xliff:g example="635dac0eb9ddc2bc6da5177f0dd495d8b76af4dc"
|
||||||
id="git_commit_hash">%1$s</xliff:g></string>
|
id="git_commit_hash">%1$s</xliff:g></string>
|
||||||
<string name="about_description">Send and receive ZEC on Zashi! Zashi is a minimal-design, self-custody, ZEC-only
|
<string name="about_description">Send and receive ZEC on Zashi! Zashi is a minimal-design, self-custody, ZEC-only
|
||||||
|
|
|
@ -1,14 +1,9 @@
|
||||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<string name="home_menu_content_description">Open menu</string>
|
<string name="home_menu_content_description">Open Settings</string>
|
||||||
<string name="home_button_receive">Receive</string>
|
<string name="home_button_receive">Receive</string>
|
||||||
<string name="home_button_send">Send</string>
|
<string name="home_button_send">Send</string>
|
||||||
<string name="home_button_history">Transaction History</string>
|
<string name="home_button_history">Transaction History</string>
|
||||||
|
|
||||||
<string name="home_menu_seed_phrase">My secret phrase</string>
|
|
||||||
<string name="home_menu_settings">Settings</string>
|
|
||||||
<string name="home_menu_about">About</string>
|
|
||||||
<string name="home_menu_support">Contact support</string>
|
|
||||||
|
|
||||||
<string name="home_status_syncing_format" formatted="true">Syncing - <xliff:g id="synced_percent" example="50.25">
|
<string name="home_status_syncing_format" formatted="true">Syncing - <xliff:g id="synced_percent" example="50.25">
|
||||||
%1$s</xliff:g>%%</string> <!-- double %% for escaping -->
|
%1$s</xliff:g>%%</string> <!-- double %% for escaping -->
|
||||||
<string name="home_status_syncing_catchup">Syncing</string>
|
<string name="home_status_syncing_catchup">Syncing</string>
|
||||||
|
|
|
@ -7,7 +7,6 @@ import android.os.Build
|
||||||
import android.os.LocaleList
|
import android.os.LocaleList
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
import androidx.compose.ui.test.assertIsEnabled
|
import androidx.compose.ui.test.assertIsEnabled
|
||||||
import androidx.compose.ui.test.hasContentDescription
|
|
||||||
import androidx.compose.ui.test.hasTestTag
|
import androidx.compose.ui.test.hasTestTag
|
||||||
import androidx.compose.ui.test.hasText
|
import androidx.compose.ui.test.hasText
|
||||||
import androidx.compose.ui.test.junit4.AndroidComposeTestRule
|
import androidx.compose.ui.test.junit4.AndroidComposeTestRule
|
||||||
|
@ -262,25 +261,28 @@ class ScreenshotTest : UiTestPrerequisites() {
|
||||||
navigateTo(NavigationTargets.RECEIVE)
|
navigateTo(NavigationTargets.RECEIVE)
|
||||||
receiveZecScreenshots(resContext, tag, composeTestRule)
|
receiveZecScreenshots(resContext, tag, composeTestRule)
|
||||||
|
|
||||||
// These are the hamburger menu items
|
|
||||||
// We could manually click on each one, which is a better integration test but a worse screenshot test
|
|
||||||
navigateTo(NavigationTargets.SEED_RECOVERY)
|
|
||||||
seedScreenshots(resContext, tag, composeTestRule)
|
|
||||||
|
|
||||||
navigateTo(NavigationTargets.SETTINGS)
|
|
||||||
settingsScreenshots(tag, composeTestRule)
|
|
||||||
|
|
||||||
navigateTo(NavigationTargets.SUPPORT)
|
|
||||||
supportScreenshots(resContext, tag, composeTestRule)
|
|
||||||
|
|
||||||
navigateTo(NavigationTargets.ABOUT)
|
|
||||||
aboutScreenshots(resContext, tag, composeTestRule)
|
|
||||||
|
|
||||||
navigateTo(NavigationTargets.WALLET_ADDRESS_DETAILS)
|
navigateTo(NavigationTargets.WALLET_ADDRESS_DETAILS)
|
||||||
addressDetailsScreenshots(resContext, tag, composeTestRule)
|
addressDetailsScreenshots(resContext, tag, composeTestRule)
|
||||||
|
|
||||||
navigateTo(NavigationTargets.HISTORY)
|
navigateTo(NavigationTargets.HISTORY)
|
||||||
transactionHistoryScreenshots(resContext, tag, composeTestRule)
|
transactionHistoryScreenshots(resContext, tag, composeTestRule)
|
||||||
|
|
||||||
|
navigateTo(NavigationTargets.SETTINGS)
|
||||||
|
settingsScreenshots(tag, composeTestRule)
|
||||||
|
|
||||||
|
// These are the Settings screen items
|
||||||
|
// We could manually click on each one, which is a better integration test but a worse screenshot test
|
||||||
|
navigateTo(NavigationTargets.SEED_RECOVERY)
|
||||||
|
seedScreenshots(resContext, tag, composeTestRule)
|
||||||
|
|
||||||
|
navigateTo(NavigationTargets.SUPPORT)
|
||||||
|
supportScreenshots(resContext, tag, composeTestRule)
|
||||||
|
|
||||||
|
navigateTo(NavigationTargets.EXPORT_PRIVATE_DATA)
|
||||||
|
exportPrivateDataScreenshots(resContext, tag, composeTestRule)
|
||||||
|
|
||||||
|
navigateTo(NavigationTargets.ABOUT)
|
||||||
|
aboutScreenshots(resContext, tag, composeTestRule)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,12 +363,6 @@ private fun homeScreenshots(
|
||||||
it.assertExists()
|
it.assertExists()
|
||||||
ScreenshotTest.takeScreenshot(tag, "Home 1")
|
ScreenshotTest.takeScreenshot(tag, "Home 1")
|
||||||
}
|
}
|
||||||
|
|
||||||
composeTestRule.onNode(hasContentDescription(resContext.getString(R.string.home_menu_content_description))).also {
|
|
||||||
it.assertExists()
|
|
||||||
it.performClick()
|
|
||||||
ScreenshotTest.takeScreenshot(tag, "Home 2 - Menu")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun settingsScreenshots(tag: String, composeTestRule: ComposeTestRule) {
|
private fun settingsScreenshots(tag: String, composeTestRule: ComposeTestRule) {
|
||||||
|
@ -506,6 +502,14 @@ private fun supportScreenshots(resContext: Context, tag: String, composeTestRule
|
||||||
ScreenshotTest.takeScreenshot(tag, "Support 1")
|
ScreenshotTest.takeScreenshot(tag, "Support 1")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun exportPrivateDataScreenshots(resContext: Context, tag: String, composeTestRule: ComposeTestRule) {
|
||||||
|
composeTestRule.onNode(hasText(resContext.getString(R.string.export_data_header))).also {
|
||||||
|
it.assertExists()
|
||||||
|
}
|
||||||
|
|
||||||
|
ScreenshotTest.takeScreenshot(tag, "Export Private Data 1")
|
||||||
|
}
|
||||||
|
|
||||||
private fun aboutScreenshots(resContext: Context, tag: String, composeTestRule: ComposeTestRule) {
|
private fun aboutScreenshots(resContext: Context, tag: String, composeTestRule: ComposeTestRule) {
|
||||||
composeTestRule.onNode(
|
composeTestRule.onNode(
|
||||||
hasText(resContext.getString(R.string.about_title).uppercase())
|
hasText(resContext.getString(R.string.about_title).uppercase())
|
||||||
|
|
Loading…
Reference in New Issue