Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace progress circle for zaps with outbox icon #853

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions app/src/main/java/com/vitorpamplona/amethyst/ui/note/Icons.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import androidx.compose.material.icons.automirrored.filled.OpenInNew
import androidx.compose.material.icons.automirrored.filled.VolumeOff
import androidx.compose.material.icons.automirrored.filled.VolumeUp
import androidx.compose.material.icons.filled.Bolt
import androidx.compose.material.icons.filled.Outbox
import androidx.compose.material.icons.filled.Cancel
import androidx.compose.material.icons.filled.Clear
import androidx.compose.material.icons.filled.ContentCopy
Expand Down Expand Up @@ -232,6 +233,20 @@ fun ZapIcon(
)
}

@Composable
fun OutboxIcon(
modifier: Modifier,
tint: Color = Color.Unspecified,
contentDescriptor: Int = R.string.zap_description,
) {
Icon(
imageVector = Icons.Default.Outbox,
contentDescription = stringResource(contentDescriptor),
tint = tint,
modifier = modifier,
)
}

@Composable
fun CashuIcon(modifier: Modifier) {
Icon(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,12 +472,7 @@ fun ZapVote(
tint = MaterialTheme.colorScheme.placeholderText,
)
} else {
Spacer(Modifier.width(3.dp))
CircularProgressIndicator(
progress = zappingProgress,
modifier = Modifier.size(14.dp),
strokeWidth = 2.dp,
)
OutboxIcon(iconSizeModifier, grayTint)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1062,19 +1062,7 @@ fun ZapReaction(
}

if (zappingProgress > 0.00001 && zappingProgress < 0.99999) {
Spacer(ModifierWidth3dp)

CircularProgressIndicator(
progress =
animateFloatAsState(
targetValue = zappingProgress,
animationSpec = ProgressIndicatorDefaults.ProgressAnimationSpec,
label = "ZapIconIndicator",
)
.value,
modifier = remember { Modifier.size(animationSize) },
strokeWidth = 2.dp,
)
OutboxIcon(iconSizeModifier, grayTint)
} else {
ObserveZapIcon(
baseNote,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,20 +403,7 @@ fun ZapDonationButton(
modifier = iconSizeModifier,
) {
if (zappingProgress > 0.00001 && zappingProgress < 0.99999) {
Spacer(ModifierWidth3dp)

CircularProgressIndicator(
progress =
animateFloatAsState(
targetValue = zappingProgress,
animationSpec = ProgressIndicatorDefaults.ProgressAnimationSpec,
label = "ZapIconIndicator",
)
.value,
modifier = remember { Modifier.size(animationSize) },
strokeWidth = 2.dp,
color = grayTint,
)
OutboxIcon(iconSizeModifier, grayTint)
} else {
ObserveZapIcon(
baseNote,
Expand Down