Release WDTT Plus v1

Prepare WDTT Plus for the public fork repository: update release links, refresh the displayed release date, and publish the current WDTT Plus source tree on top of the original project history.
This commit is contained in:
Ivan4537 committed 2026-07-01 18:25:54 +03:00
1 parent d82483ae36
commit 9b69abe3d5
127 files changed
+17412 -6579

No files matched your search

+129
View File
@@ -0,0 +1,129 @@
package com.wdtt.plus.ui
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Update
import androidx.compose.material3.Button
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogProperties
import com.wdtt.plus.AppReleaseInfo
import com.wdtt.plus.RemoteVersionSource
@Composable
fun AppUpdateDialog(
release: AppReleaseInfo,
onPostpone: () -> Unit,
onUpdate: () -> Unit
) {
val isTagOnly = release.source == RemoteVersionSource.Tag
val title = if (isTagOnly) "Найден новый tag" else "Доступно обновление"
val description = if (isTagOnly) {
"На GitHub обнаружен более новый tag ${release.versionTag}. Похоже, опубликованный release ещё не догнал его."
} else {
"Вышла новая версия приложения ${release.versionTag}. Можно открыть страницу релиза и обновиться вручную."
}
Dialog(
onDismissRequest = {},
properties = DialogProperties(
usePlatformDefaultWidth = false,
dismissOnBackPress = false,
dismissOnClickOutside = false
)
) {
Surface(
shape = RoundedCornerShape(28.dp),
color = MaterialTheme.colorScheme.surface,
contentColor = MaterialTheme.colorScheme.onSurface,
tonalElevation = 8.dp,
modifier = Modifier.fillMaxWidth(0.92f)
) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 22.dp, vertical = 20.dp),
verticalArrangement = Arrangement.spacedBy(14.dp)
) {
Row(verticalAlignment = Alignment.CenterVertically) {
Icon(
imageVector = Icons.Default.Update,
contentDescription = null,
tint = MaterialTheme.colorScheme.primary,
modifier = Modifier.size(20.dp)
)
Spacer(Modifier.width(10.dp))
Column(verticalArrangement = Arrangement.spacedBy(2.dp)) {
Text(
text = title,
style = MaterialTheme.typography.titleMedium,
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.primary
)
Text(
text = release.versionTag,
style = MaterialTheme.typography.bodyMedium,
fontWeight = FontWeight.SemiBold,
color = MaterialTheme.colorScheme.onSurfaceVariant
)
}
}
Text(
text = description,
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant,
lineHeight = 20.sp
)
HorizontalDivider(color = MaterialTheme.colorScheme.outlineVariant.copy(alpha = 0.35f))
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(12.dp)
) {
OutlinedButton(
onClick = onPostpone,
modifier = Modifier
.weight(1f)
.heightIn(min = 50.dp),
shape = RoundedCornerShape(22.dp)
) {
Text("Позже", fontWeight = FontWeight.SemiBold)
}
Button(
onClick = onUpdate,
modifier = Modifier
.weight(1f)
.heightIn(min = 50.dp),
shape = RoundedCornerShape(22.dp)
) {
Text("Обновить", fontWeight = FontWeight.Bold)
}
}
}
}
}
}