Adds payment animation to Polls

This commit is contained in:
Vitor Pamplona
2023-04-04 12:25:32 -04:00
parent e10c5771d8
commit efd2ddba71

View File

@@ -282,6 +282,7 @@ fun ZapVote(
clickablePrepend() clickablePrepend()
if (pollViewModel.isPollOptionZappedBy(pollOption, accountViewModel.userProfile())) { if (pollViewModel.isPollOptionZappedBy(pollOption, accountViewModel.userProfile())) {
zappingProgress = 1f
Icon( Icon(
imageVector = Icons.Default.Bolt, imageVector = Icons.Default.Bolt,
contentDescription = stringResource(R.string.zaps), contentDescription = stringResource(R.string.zaps),
@@ -289,12 +290,21 @@ fun ZapVote(
tint = BitcoinOrange tint = BitcoinOrange
) )
} else { } else {
Icon( if (zappingProgress < 0.1 || zappingProgress > 0.99) {
imageVector = Icons.Outlined.Bolt, Icon(
contentDescription = stringResource(id = R.string.zaps), imageVector = Icons.Outlined.Bolt,
modifier = Modifier.size(20.dp), contentDescription = stringResource(id = R.string.zaps),
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) modifier = Modifier.size(20.dp),
) tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f)
)
} else {
Spacer(Modifier.width(3.dp))
CircularProgressIndicator(
progress = zappingProgress,
modifier = Modifier.size(14.dp),
strokeWidth = 2.dp
)
}
} }
} }