|
| 1 | +package neth.iecal.trease.ui.dialogs |
| 2 | + |
| 3 | +import androidx.compose.foundation.Image |
| 4 | +import androidx.compose.foundation.layout.* |
| 5 | +import androidx.compose.foundation.rememberScrollState |
| 6 | +import androidx.compose.foundation.shape.RoundedCornerShape |
| 7 | +import androidx.compose.foundation.verticalScroll |
| 8 | +import androidx.compose.material3.* |
| 9 | +import androidx.compose.runtime.Composable |
| 10 | +import androidx.compose.runtime.collectAsState |
| 11 | +import androidx.compose.runtime.getValue |
| 12 | +import androidx.compose.ui.Alignment |
| 13 | +import androidx.compose.ui.Modifier |
| 14 | +import androidx.compose.ui.graphics.Color |
| 15 | +import androidx.compose.ui.graphics.painter.Painter |
| 16 | +import androidx.compose.ui.layout.ContentScale |
| 17 | +import androidx.compose.ui.platform.LocalUriHandler |
| 18 | +import androidx.compose.ui.text.font.FontWeight |
| 19 | +import androidx.compose.ui.text.style.TextAlign |
| 20 | +import androidx.compose.ui.unit.dp |
| 21 | +import androidx.compose.ui.window.Dialog |
| 22 | +import coil3.compose.AsyncImage |
| 23 | +import neth.iecal.trease.Constants |
| 24 | +import neth.iecal.trease.viewmodels.HomeScreenViewModel |
| 25 | +import org.jetbrains.compose.resources.painterResource |
| 26 | +import trease.composeapp.generated.resources.Res |
| 27 | +import trease.composeapp.generated.resources.coin |
| 28 | +import trease.composeapp.generated.resources.grid |
| 29 | +import trease.composeapp.generated.resources.rounded_clock_loader_10_24 |
| 30 | + |
| 31 | +@Composable |
| 32 | +fun AppInfoDialog(onDismiss: () -> Unit) { |
| 33 | + val uriHandler = LocalUriHandler.current |
| 34 | + |
| 35 | + Dialog(onDismissRequest = { onDismiss() }) { |
| 36 | + Card( |
| 37 | + shape = RoundedCornerShape(24.dp), |
| 38 | + colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface) , |
| 39 | + modifier = Modifier |
| 40 | + .fillMaxWidth() |
| 41 | + .padding(16.dp) |
| 42 | + .height(600.dp) |
| 43 | + ) { |
| 44 | + Column( |
| 45 | + modifier = Modifier |
| 46 | + .padding(24.dp) |
| 47 | + .fillMaxWidth() |
| 48 | + .verticalScroll(rememberScrollState()), |
| 49 | + horizontalAlignment = Alignment.CenterHorizontally, |
| 50 | + verticalArrangement = Arrangement.spacedBy(8.dp), |
| 51 | + |
| 52 | + ) { |
| 53 | + Column(horizontalAlignment = Alignment.CenterHorizontally) { |
| 54 | + Text( |
| 55 | + text = "Trease", |
| 56 | + style = MaterialTheme.typography.headlineMedium, |
| 57 | + fontWeight = FontWeight.Bold, |
| 58 | + textAlign = TextAlign.Center, |
| 59 | + ) |
| 60 | + Text( |
| 61 | + text = "A cross platform, open source and free focus tool.", |
| 62 | + style = MaterialTheme.typography.labelSmall, |
| 63 | + textAlign = TextAlign.Center, |
| 64 | + ) |
| 65 | + } |
| 66 | + Spacer(Modifier.size(8.dp)) |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + Text("I’m Nethical, the 17-year-old developer behind Digipaws, Questphone, and Trease.\n" + |
| 71 | + "\n" + |
| 72 | + "I was tired of seeing essential tools locked behind greedy paywalls, so I built these free, open-source alternatives to empower masses.\n" + |
| 73 | + "\n" + |
| 74 | + "Your support keeps me independent and ensures this software stays free forever.\n" + |
| 75 | + "\n" + |
| 76 | + "Support via: PayPal • Patreon • Crypto • Card (GitHub Sponsers) • UPI", |
| 77 | + textAlign = TextAlign.Center, |
| 78 | + ) |
| 79 | + Button( |
| 80 | + onClick = { uriHandler.openUri("https://digipaws.life/donate") }, |
| 81 | + modifier = Modifier.fillMaxWidth(), |
| 82 | + shape = RoundedCornerShape(12.dp), |
| 83 | + colors = ButtonDefaults.buttonColors( |
| 84 | + containerColor = MaterialTheme.colorScheme.primary, |
| 85 | + contentColor = MaterialTheme.colorScheme.onPrimary |
| 86 | + ) |
| 87 | + ) { |
| 88 | + Text( |
| 89 | + text = "Donate", |
| 90 | + modifier = Modifier.padding(vertical = 6.dp), |
| 91 | + style = MaterialTheme.typography.titleMedium, |
| 92 | + textAlign = TextAlign.Center, |
| 93 | + |
| 94 | + ) |
| 95 | + } |
| 96 | + |
| 97 | + Button( |
| 98 | + onClick = { uriHandler.openUri("https://github.com/Trease-Focus/trease-app") }, |
| 99 | + modifier = Modifier.fillMaxWidth(), |
| 100 | + shape = RoundedCornerShape(12.dp), |
| 101 | + colors = ButtonDefaults.buttonColors( |
| 102 | + containerColor = MaterialTheme.colorScheme.primary, |
| 103 | + contentColor = MaterialTheme.colorScheme.onPrimary |
| 104 | + ) |
| 105 | + ) { |
| 106 | + Text( |
| 107 | + text = "Star project on GitHub", |
| 108 | + modifier = Modifier.padding(vertical = 6.dp), |
| 109 | + style = MaterialTheme.typography.titleMedium, |
| 110 | + textAlign = TextAlign.Center, |
| 111 | + |
| 112 | + ) |
| 113 | + } |
| 114 | + |
| 115 | + Spacer(Modifier.size(8.dp)) |
| 116 | + |
| 117 | + Text( |
| 118 | + text = "Trease is community-maintained, and we warmly welcome artists to contribute new tree designs!", |
| 119 | + modifier = Modifier.padding(vertical = 6.dp), |
| 120 | + style = MaterialTheme.typography.titleMedium, |
| 121 | + textAlign = TextAlign.Center, |
| 122 | + |
| 123 | + ) |
| 124 | + OutlinedButton( |
| 125 | + onClick = { uriHandler.openUri("https://github.com/Trease-Focus/trease-artwork") }, |
| 126 | + modifier = Modifier.fillMaxWidth(), |
| 127 | + shape = RoundedCornerShape(12.dp), |
| 128 | + colors = ButtonDefaults.buttonColors( |
| 129 | + containerColor = MaterialTheme.colorScheme.primary, |
| 130 | + contentColor = MaterialTheme.colorScheme.onPrimary |
| 131 | + ) |
| 132 | + ) { |
| 133 | + Text( |
| 134 | + text = "Submit a new tree design", |
| 135 | + modifier = Modifier.padding(vertical = 6.dp), |
| 136 | + style = MaterialTheme.typography.titleMedium, |
| 137 | + textAlign = TextAlign.Center, |
| 138 | + |
| 139 | + ) |
| 140 | + } |
| 141 | + } |
| 142 | + } |
| 143 | + } |
| 144 | +} |
0 commit comments