mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-28 02:37:02 +02:00
Adds payment animation to Polls
This commit is contained in:
@@ -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
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user