diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/support/SupportScreen.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/support/SupportScreen.kt index 30c8bd5..a8f919c 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/support/SupportScreen.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/support/SupportScreen.kt @@ -1,10 +1,12 @@ package com.zaneschepke.wireguardautotunnel.ui.screens.support +import android.os.Build import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.AttachMoney import androidx.compose.material.icons.filled.Book import androidx.compose.material.icons.filled.LineStyle import androidx.compose.material.icons.filled.Mail @@ -19,6 +21,7 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.vectorResource import androidx.compose.ui.unit.dp +import com.zaneschepke.wireguardautotunnel.BuildConfig import com.zaneschepke.wireguardautotunnel.R import com.zaneschepke.wireguardautotunnel.ui.Route import com.zaneschepke.wireguardautotunnel.ui.common.button.surface.SelectionItem @@ -101,54 +104,83 @@ fun SupportScreen() { ), ) SurfaceSelectionGroupButton( - listOf( - SelectionItem( - ImageVector.vectorResource(R.drawable.telegram), - title = { - Text( - stringResource(R.string.chat_description), - style = MaterialTheme.typography.bodyMedium.copy(MaterialTheme.colorScheme.onSurface), - ) - }, - trailing = { - ForwardButton { - context.openWebUrl(context.getString(R.string.telegram_url)) - } - }, - onClick = { - context.openWebUrl(context.getString(R.string.telegram_url)) - }, - ), - SelectionItem( - ImageVector.vectorResource(R.drawable.github), - title = { Text(stringResource(R.string.open_issue), style = MaterialTheme.typography.bodyMedium.copy(MaterialTheme.colorScheme.onSurface)) }, - trailing = { - ForwardButton { - context.openWebUrl(context.getString(R.string.github_url)) - } - }, - onClick = { - context.openWebUrl(context.getString(R.string.github_url)) - }, - ), - SelectionItem( - Icons.Filled.Mail, - title = { - Text( - stringResource(R.string.email_description), - style = MaterialTheme.typography.bodyMedium.copy(MaterialTheme.colorScheme.onSurface), - ) - }, - trailing = { - ForwardButton { - context.launchSupportEmail() - } - }, - onClick = { - context.launchSupportEmail() - }, - ), - ), + buildList { + addAll( + listOf( + SelectionItem( + ImageVector.vectorResource(R.drawable.telegram), + title = { + Text( + stringResource(R.string.chat_description), + style = MaterialTheme.typography.bodyMedium.copy(MaterialTheme.colorScheme.onSurface), + ) + }, + trailing = { + ForwardButton { + context.openWebUrl(context.getString(R.string.telegram_url)) + } + }, + onClick = { + context.openWebUrl(context.getString(R.string.telegram_url)) + }, + ), + SelectionItem( + ImageVector.vectorResource(R.drawable.github), + title = { + Text( + stringResource(R.string.open_issue), + style = MaterialTheme.typography.bodyMedium.copy(MaterialTheme.colorScheme.onSurface)) + }, + trailing = { + ForwardButton { + context.openWebUrl(context.getString(R.string.github_url)) + } + }, + onClick = { + context.openWebUrl(context.getString(R.string.github_url)) + }, + ), + SelectionItem( + Icons.Filled.Mail, + title = { + Text( + stringResource(R.string.email_description), + style = MaterialTheme.typography.bodyMedium.copy(MaterialTheme.colorScheme.onSurface), + ) + }, + trailing = { + ForwardButton { + context.launchSupportEmail() + } + }, + onClick = { + context.launchSupportEmail() + }, + ), + ) + ) + if (BuildConfig.FLAVOR == "fdroid") { + add( + SelectionItem( + Icons.Filled.AttachMoney, + title = { + Text( + stringResource(R.string.donate), + style = MaterialTheme.typography.bodyMedium.copy(MaterialTheme.colorScheme.onSurface), + ) + }, + trailing = { + ForwardButton { + context.openWebUrl(context.getString(R.string.donate_url)) + } + }, + onClick = { + context.openWebUrl(context.getString(R.string.donate_url)) + }, + ), + ) + } + } ) VersionLabel() } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 04e744e..eb65e79 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -9,6 +9,7 @@ https://zaneschepke.com/wgtunnel-docs/features.html https://zaneschepke.com/wgtunnel-docs/privacypolicy.html https://zaneschepke.com/wgtunnel-docs/features.html#wildcard-wi-fi-name-support + https://zaneschepke.com/donate/ File is not a .conf or .zip Action requires tunnel off No tunnels added yet! @@ -227,4 +228,5 @@ Stop auto-tunnel Tunnel running Monitoring state changes + Donate to project