mirror of
https://github.com/kalarina-bit/Sparkledns.git
synced 2026-11-22 07:36:09 +00:00
Add donation links to servers next to the privacy policy
This commit is contained in:
@@ -290,6 +290,7 @@ fun HomeScreen(modifier: Modifier = Modifier) {
|
||||
subtitle = hostOf(p.url),
|
||||
selected = selected == p.id,
|
||||
onPolicy = p.policy?.let { url -> { openUrl(context, url) } },
|
||||
onDonate = p.donate?.let { url -> { openUrl(context, url) } },
|
||||
) { select(p.id) }
|
||||
}
|
||||
RowDivider()
|
||||
@@ -571,6 +572,7 @@ private fun ProviderRow(
|
||||
subtitle: String,
|
||||
selected: Boolean,
|
||||
onPolicy: (() -> Unit)? = null,
|
||||
onDonate: (() -> Unit)? = null,
|
||||
onClick: () -> Unit,
|
||||
) {
|
||||
val highlight by animateColorAsState(
|
||||
@@ -598,6 +600,16 @@ private fun ProviderRow(
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
)
|
||||
}
|
||||
if (onDonate != null) {
|
||||
IconButton(onClick = onDonate, modifier = Modifier.size(40.dp)) {
|
||||
Icon(
|
||||
painterResource(R.drawable.ic_donate),
|
||||
contentDescription = stringResource(R.string.donate),
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.size(18.dp),
|
||||
)
|
||||
}
|
||||
}
|
||||
if (onPolicy != null) {
|
||||
IconButton(onClick = onPolicy, modifier = Modifier.size(40.dp)) {
|
||||
Icon(
|
||||
|
||||
Reference in New Issue
Block a user