Code cleanup

Closes #532
Closes #578
This commit is contained in:
Milan Cerovsky 2024-07-26 10:21:23 +02:00
parent ec47c2625d
commit 2e2ba4f123
5 changed files with 18 additions and 11 deletions

View File

@ -69,7 +69,7 @@ class SendViewTestSetup(
}
@Composable
@Suppress("TestFunctionName")
@Suppress("TestFunctionName", "LongMethod")
fun DefaultContent() {
val context = LocalContext.current

View File

@ -1,3 +1,5 @@
@file:Suppress("TooManyFunctions")
package co.electriccoin.zcash.ui
import androidx.compose.animation.animateContentSize
@ -31,6 +33,7 @@ import co.electriccoin.zcash.ui.util.getValue
import co.electriccoin.zcash.ui.util.stringRes
import kotlinx.datetime.Clock
@Suppress("LongParameterList")
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun StyledExchangeBalance(
@ -80,7 +83,9 @@ fun StyledExchangeBalance(
is FiatCurrencyConversionRateState.Current -> state.formattedFiatValue
is FiatCurrencyConversionRateState.Stale -> state.formattedFiatValue
FiatCurrencyConversionRateState.Unavailable ->
stringResource(co.electriccoin.zcash.ui.R.string.fiat_currency_conversion_rate_unavailable)
stringResource(
co.electriccoin.zcash.ui.R.string.fiat_currency_conversion_rate_unavailable
)
}
},
textColor = textColor,
@ -94,9 +99,9 @@ fun StyledExchangeBalance(
@Composable
private fun StyledExchangeText(
text: String,
modifier: Modifier = Modifier,
textColor: Color,
style: TextStyle
style: TextStyle,
modifier: Modifier = Modifier,
) {
Text(
text = text,

View File

@ -27,6 +27,7 @@ sealed interface AmountState {
data class Invalid(override val value: String, override val fiatValue: String) : AmountState
companion object {
@Suppress("LongParameterList")
fun newFromZec(
context: Context,
monetarySeparators: MonetarySeparators,
@ -67,6 +68,7 @@ sealed interface AmountState {
}
}
@Suppress("LongParameterList")
fun newFromFiat(
context: Context,
monetarySeparators: MonetarySeparators,

View File

@ -711,7 +711,7 @@ fun SendFormAmountTextField(
FormTextField(
textStyle = ZcashTheme.extendedTypography.textFieldValue.copy(fontSize = 14.sp),
value = amountState.fiatValue,
onValueChange = { newValue -> // TODO
onValueChange = { newValue ->
setAmountState(
AmountState.newFromFiat(
context = context,

View File

@ -329,14 +329,14 @@ private fun SendConfirmationTopAppBar(
@Composable
@Suppress("LongParameterList")
private fun SendConfirmationMainContent(
onBack: () -> Unit,
onContactSupport: () -> Unit,
onConfirmation: () -> Unit,
stage: SendConfirmationStage,
submissionResults: ImmutableList<TransactionSubmitResult>,
zecSend: ZecSend,
onBack: () -> Unit,
onContactSupport: () -> Unit,
onConfirmation: () -> Unit,
exchangeRate: FiatCurrencyResult,
modifier: Modifier = Modifier,
exchangeRate: FiatCurrencyResult
) {
when (stage) {
SendConfirmationStage.Confirmation, SendConfirmationStage.Sending, is SendConfirmationStage.Failure -> {
@ -366,13 +366,13 @@ private fun SendConfirmationMainContent(
}
@Composable
@Suppress("LongMethod")
@Suppress("LongMethod", "LongParameterList")
private fun SendConfirmationContent(
zecSend: ZecSend,
exchangeRate: FiatCurrencyResult,
isSending: Boolean,
onConfirmation: () -> Unit,
onBack: () -> Unit,
isSending: Boolean,
modifier: Modifier = Modifier,
) {
Column(