secant-android-wallet/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/address/view/WalletAddressView.kt

296 lines
9.7 KiB
Kotlin
Raw Normal View History

2022-06-22 02:48:19 -07:00
@file:Suppress("TooManyFunctions")
2022-06-22 02:48:19 -07:00
package co.electriccoin.zcash.ui.screen.address.view
import androidx.compose.foundation.Image
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.IntrinsicSize
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.fillMaxHeight
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.ArrowDropDownCircle
2022-02-21 06:33:40 -08:00
import androidx.compose.material3.Divider
import androidx.compose.material3.ExperimentalMaterial3Api
2022-02-21 06:33:40 -08:00
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.rotate
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.ColorPainter
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
2023-02-17 03:05:23 -08:00
import cash.z.ecc.android.sdk.fixture.WalletAddressesFixture
import cash.z.ecc.android.sdk.model.WalletAddresses
import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
import co.electriccoin.zcash.ui.design.component.Body
import co.electriccoin.zcash.ui.design.component.GradientSurface
import co.electriccoin.zcash.ui.design.component.ListHeader
import co.electriccoin.zcash.ui.design.component.ListItem
import co.electriccoin.zcash.ui.design.theme.ZcashTheme
import co.electriccoin.zcash.ui.screen.address.WalletAddressesTag
2022-01-13 09:49:08 -08:00
import kotlinx.coroutines.runBlocking
@Preview("WalletAddresses")
@Composable
private fun ComposablePreview() {
ZcashTheme(forceDarkMode = false) {
GradientSurface {
WalletAddresses(
2022-01-13 09:49:08 -08:00
runBlocking { WalletAddressesFixture.new() },
onBack = {},
onCopyToClipboard = {}
)
}
}
}
@Composable
fun WalletAddresses(
walletAddresses: WalletAddresses,
onBack: () -> Unit,
onCopyToClipboard: (String) -> Unit
) {
Column {
WalletDetailTopAppBar(onBack)
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
WalletDetailAddresses(
walletAddresses = walletAddresses,
onCopyToClipboard = onCopyToClipboard,
modifier =
Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
)
}
}
@Composable
@OptIn(ExperimentalMaterial3Api::class)
private fun WalletDetailTopAppBar(onBack: () -> Unit) {
TopAppBar(
title = {
Text(
text = stringResource(id = R.string.wallet_address_title)
)
},
navigationIcon = {
IconButton(
onClick = onBack
) {
Icon(
imageVector = Icons.Filled.ArrowBack,
contentDescription = stringResource(R.string.wallet_address_back_content_description)
)
}
}
)
}
private val BIG_INDICATOR_WIDTH = 24.dp
private val SMALL_INDICATOR_WIDTH = 16.dp
@Composable
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
private fun WalletDetailAddresses(
walletAddresses: WalletAddresses,
onCopyToClipboard: (String) -> Unit,
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
modifier: Modifier = Modifier
) {
Column(modifier) {
Row(
Modifier
.fillMaxWidth()
.height(IntrinsicSize.Min)
) {
Image(
painter = ColorPainter(ZcashTheme.colors.highlight),
contentDescription = "",
modifier =
Modifier
.fillMaxHeight()
.width(BIG_INDICATOR_WIDTH)
)
Column(Modifier.fillMaxWidth()) {
ExpandableRow(
title = stringResource(R.string.wallet_address_unified),
2022-01-13 09:49:08 -08:00
content = walletAddresses.unified.address,
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
isInitiallyExpanded = true,
onCopyToClipboard = onCopyToClipboard
)
Box(Modifier.height(IntrinsicSize.Min)) {
Divider(modifier = Modifier.fillMaxHeight())
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
ListHeader(
text = stringResource(R.string.wallet_address_header_includes),
modifier = Modifier.padding(all = ZcashTheme.dimens.spacingSmall)
)
}
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
SaplingAddress(
saplingAddress = walletAddresses.sapling.address,
onCopyToClipboard = onCopyToClipboard,
modifier =
Modifier
.fillMaxWidth()
.height(IntrinsicSize.Min)
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
)
TransparentAddress(
transparentAddress = walletAddresses.transparent.address,
onCopyToClipboard = onCopyToClipboard,
modifier =
Modifier
.fillMaxWidth()
.height(IntrinsicSize.Min)
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
)
}
}
}
}
// Note: The addresses code below has opportunities to be made more DRY.
// Refactoring that is being held off until issue #160 is fixed, since knowledge
// of row position will be needed.
@Composable
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
private fun SaplingAddress(
saplingAddress: String,
onCopyToClipboard: (String) -> Unit,
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
modifier: Modifier = Modifier
) {
Row(modifier) {
SmallIndicator(ZcashTheme.colors.addressHighlightSapling)
ExpandableRow(
title = stringResource(R.string.wallet_address_sapling),
content = saplingAddress,
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
isInitiallyExpanded = false,
onCopyToClipboard = onCopyToClipboard
)
}
}
@Composable
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
private fun TransparentAddress(
transparentAddress: String,
onCopyToClipboard: (String) -> Unit,
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
modifier: Modifier = Modifier
) {
Row(modifier) {
SmallIndicator(ZcashTheme.colors.addressHighlightTransparent)
ExpandableRow(
title = stringResource(R.string.wallet_address_transparent),
content = transparentAddress,
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
isInitiallyExpanded = false,
onCopyToClipboard = onCopyToClipboard
)
}
}
@Composable
private fun ExpandableRow(
title: String,
content: String,
isInitiallyExpanded: Boolean,
onCopyToClipboard: (String) -> Unit
) {
var expandedState by rememberSaveable { mutableStateOf(isInitiallyExpanded) }
Column {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier =
Modifier
.defaultMinSize(minHeight = 48.dp)
.clickable { expandedState = !expandedState }
.padding(
horizontal = ZcashTheme.dimens.spacingDefault,
vertical = ZcashTheme.dimens.spacingTiny
)
) {
ListItem(text = title)
Spacer(
modifier =
Modifier
.fillMaxWidth()
.weight(MINIMAL_WEIGHT)
)
ExpandableArrow(expandedState)
}
if (expandedState) {
Body(
content,
modifier =
Modifier
.clickable { onCopyToClipboard(content) }
.padding(
horizontal = ZcashTheme.dimens.spacingDefault,
vertical = ZcashTheme.dimens.spacingTiny
)
.testTag(WalletAddressesTag.WALLET_ADDRESS)
)
}
}
}
@Composable
private fun SmallIndicator(color: Color) {
// TODO [#160]: Border is not the right implementation here, as it causes double thickness for the middle item
// TODO [#160]: https://github.com/Electric-Coin-Company/zashi-android/issues/160
Image(
modifier =
Modifier
.fillMaxHeight()
.width(SMALL_INDICATOR_WIDTH)
.border(1.dp, ZcashTheme.colors.addressHighlightBorder),
painter = ColorPainter(color),
contentDescription = ""
)
}
private const val NINETY_DEGREES = 90f
@Composable
private fun ExpandableArrow(isExpanded: Boolean) {
Icon(
imageVector = Icons.Filled.ArrowDropDownCircle,
contentDescription =
if (isExpanded) {
stringResource(id = R.string.wallet_address_hide)
} else {
stringResource(id = R.string.wallet_address_show)
},
modifier =
if (isExpanded) {
Modifier
} else {
Modifier.rotate(NINETY_DEGREES)
},
2022-02-21 06:33:40 -08:00
tint = MaterialTheme.colorScheme.onBackground
)
}