fix: небольшая коррекция верстки в bottom sheet modal
This commit is contained in:
1 parent
e82076447e
commit
36c2eb713b
4 files changed
+83
-81
No files matched your search
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"Bash(git add:*)",
|
||||||
|
"Bash(git commit:*)",
|
||||||
|
"Bash(xargs grep:*)",
|
||||||
|
"Bash(ls:*)"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -40,7 +40,7 @@ import androidx.compose.material3.CircularWavyProgressIndicator
|
|||||||
import androidx.compose.material3.HorizontalDivider
|
import androidx.compose.material3.HorizontalDivider
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
import androidx.compose.material3.LinearProgressIndicator
|
import androidx.compose.material3.LinearWavyProgressIndicator
|
||||||
import androidx.compose.material3.ListItem
|
import androidx.compose.material3.ListItem
|
||||||
import androidx.compose.material3.ListItemColors
|
import androidx.compose.material3.ListItemColors
|
||||||
import androidx.compose.material3.ListItemDefaults
|
import androidx.compose.material3.ListItemDefaults
|
||||||
@@ -78,7 +78,6 @@ import androidx.compose.ui.draw.scale
|
|||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.LocalUriHandler
|
import androidx.compose.ui.platform.LocalUriHandler
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||||
@@ -358,7 +357,7 @@ private fun UpdateDialogs(viewModel: MainViewModel) {
|
|||||||
Column {
|
Column {
|
||||||
Text(stringResource(R.string.update_downloading, state.progress))
|
Text(stringResource(R.string.update_downloading, state.progress))
|
||||||
Spacer(Modifier.height(12.dp))
|
Spacer(Modifier.height(12.dp))
|
||||||
LinearProgressIndicator(
|
LinearWavyProgressIndicator(
|
||||||
progress = { state.progress / 100f },
|
progress = { state.progress / 100f },
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth()
|
||||||
)
|
)
|
||||||
@@ -672,99 +671,56 @@ private fun UpdateListItem(
|
|||||||
onDownload: () -> Unit,
|
onDownload: () -> Unit,
|
||||||
onInstall: () -> Unit
|
onInstall: () -> Unit
|
||||||
) {
|
) {
|
||||||
when (state) {
|
val supportingText = when (state) {
|
||||||
is UpdateState.Idle -> {
|
is UpdateState.Idle -> stringResource(R.string.update_tap_to_check)
|
||||||
ListItem(
|
is UpdateState.Checking -> stringResource(R.string.update_checking)
|
||||||
headlineContent = { Text(stringResource(R.string.update_check)) },
|
is UpdateState.Available -> stringResource(R.string.update_available, state.version)
|
||||||
colors = colors,
|
is UpdateState.Downloading -> stringResource(R.string.update_downloading, state.progress)
|
||||||
modifier = Modifier.clickable(onClick = onCheck)
|
is UpdateState.ReadyToInstall -> stringResource(R.string.update_ready_desc_short)
|
||||||
)
|
is UpdateState.NoUpdate -> stringResource(R.string.update_no_update)
|
||||||
|
is UpdateState.Error -> stringResource(R.string.update_error, state.message)
|
||||||
}
|
}
|
||||||
|
|
||||||
is UpdateState.Checking -> {
|
|
||||||
ListItem(
|
|
||||||
headlineContent = { Text(stringResource(R.string.update_checking)) },
|
|
||||||
colors = colors
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
is UpdateState.Available -> {
|
|
||||||
ListItem(
|
ListItem(
|
||||||
headlineContent = {
|
headlineContent = {
|
||||||
Text(stringResource(R.string.update_available, state.version))
|
Text(stringResource(R.string.update_title), style = MaterialTheme.typography.titleSmall)
|
||||||
},
|
|
||||||
supportingContent = if (state.changelog.isNotEmpty()) {
|
|
||||||
{
|
|
||||||
Text(
|
|
||||||
state.changelog,
|
|
||||||
style = MaterialTheme.typography.bodySmall,
|
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
|
||||||
maxLines = 3,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} else null,
|
|
||||||
colors = colors,
|
|
||||||
trailingContent = {
|
|
||||||
TextButton(onClick = onDownload) {
|
|
||||||
Text(stringResource(R.string.update_download))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
is UpdateState.Downloading -> {
|
|
||||||
ListItem(
|
|
||||||
headlineContent = {
|
|
||||||
Text(stringResource(R.string.update_downloading, state.progress))
|
|
||||||
},
|
},
|
||||||
supportingContent = {
|
supportingContent = {
|
||||||
LinearProgressIndicator(
|
Column {
|
||||||
|
Text(
|
||||||
|
supportingText,
|
||||||
|
color = if (state is UpdateState.Error) MaterialTheme.colorScheme.error
|
||||||
|
else MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
|
)
|
||||||
|
if (state is UpdateState.Downloading) {
|
||||||
|
LinearWavyProgressIndicator(
|
||||||
progress = { state.progress / 100f },
|
progress = { state.progress / 100f },
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(top = 8.dp)
|
.padding(top = 8.dp)
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
trailingContent = {
|
||||||
|
when (state) {
|
||||||
|
is UpdateState.Available -> TextButton(onClick = onDownload) {
|
||||||
|
Text(stringResource(R.string.update_download))
|
||||||
|
}
|
||||||
|
is UpdateState.ReadyToInstall -> TextButton(onClick = onInstall) {
|
||||||
|
Text(stringResource(R.string.update_install))
|
||||||
|
}
|
||||||
|
is UpdateState.Idle, is UpdateState.NoUpdate, is UpdateState.Error ->
|
||||||
|
TextButton(onClick = onCheck) {
|
||||||
|
Text(stringResource(R.string.update_check))
|
||||||
|
}
|
||||||
|
else -> {}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
colors = colors
|
colors = colors
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
is UpdateState.ReadyToInstall -> {
|
|
||||||
ListItem(
|
|
||||||
headlineContent = { Text(stringResource(R.string.update_ready_title)) },
|
|
||||||
colors = colors,
|
|
||||||
trailingContent = {
|
|
||||||
TextButton(onClick = onInstall) {
|
|
||||||
Text(stringResource(R.string.update_install))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
is UpdateState.NoUpdate -> {
|
|
||||||
ListItem(
|
|
||||||
headlineContent = { Text(stringResource(R.string.update_no_update)) },
|
|
||||||
colors = colors,
|
|
||||||
modifier = Modifier.clickable(onClick = onCheck)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
is UpdateState.Error -> {
|
|
||||||
ListItem(
|
|
||||||
headlineContent = {
|
|
||||||
Text(
|
|
||||||
stringResource(R.string.update_error, state.message),
|
|
||||||
color = MaterialTheme.colorScheme.error
|
|
||||||
)
|
|
||||||
},
|
|
||||||
colors = colors,
|
|
||||||
modifier = Modifier.clickable(onClick = onCheck)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ── Общие компоненты ──────────────────────────────────────────────────────
|
// ── Общие компоненты ──────────────────────────────────────────────────────
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
|||||||
@@ -122,7 +122,9 @@
|
|||||||
<string name="skip_setup">Пропустить настройки</string>
|
<string name="skip_setup">Пропустить настройки</string>
|
||||||
|
|
||||||
<!-- Update -->
|
<!-- Update -->
|
||||||
<string name="update_check">Проверить обновления</string>
|
<string name="update_title">Обновление</string>
|
||||||
|
<string name="update_check">Проверить</string>
|
||||||
|
<string name="update_tap_to_check">Нажмите для проверки</string>
|
||||||
<string name="update_checking">Проверка…</string>
|
<string name="update_checking">Проверка…</string>
|
||||||
<string name="update_available_title">Доступно обновление</string>
|
<string name="update_available_title">Доступно обновление</string>
|
||||||
<string name="update_available">Доступна версия %1$s</string>
|
<string name="update_available">Доступна версия %1$s</string>
|
||||||
@@ -131,6 +133,7 @@
|
|||||||
<string name="update_downloading">Загрузка: %1$d%%</string>
|
<string name="update_downloading">Загрузка: %1$d%%</string>
|
||||||
<string name="update_ready_title">Обновление загружено</string>
|
<string name="update_ready_title">Обновление загружено</string>
|
||||||
<string name="update_ready_desc">APK готов к установке. Установить сейчас?</string>
|
<string name="update_ready_desc">APK готов к установке. Установить сейчас?</string>
|
||||||
|
<string name="update_ready_desc_short">Готово к установке</string>
|
||||||
<string name="update_install">Установить</string>
|
<string name="update_install">Установить</string>
|
||||||
<string name="update_no_update">Установлена последняя версия</string>
|
<string name="update_no_update">Установлена последняя версия</string>
|
||||||
<string name="update_error">Ошибка: %1$s</string>
|
<string name="update_error">Ошибка: %1$s</string>
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## v1.3.0
|
||||||
|
|
||||||
|
### Что нового
|
||||||
|
|
||||||
|
**Приватный режим**
|
||||||
|
При включении скрывает IP-адрес сервера, VK-ссылку и порты на экране настроек — поля заменяются звёздочками. Удобно для скриншотов и демонстрации экрана без раскрытия конфигурации.
|
||||||
|
|
||||||
|
**Кастомное ядро — улучшенный интерфейс**
|
||||||
|
Карточка загрузки собственного ядра полностью переработана: теперь файл проверяется на корректность ELF-формата перед использованием. Если файл не подходит — сразу видна понятная ошибка прямо в карточке, без скрытых сбоев.
|
||||||
|
|
||||||
|
**Обновлённое ядро**
|
||||||
|
Встроенное ядро обновлено (сборка от cacggghp). Размер уменьшился с 9.5 МБ до 8.8 МБ.
|
||||||
|
|
||||||
|
### Улучшения интерфейса
|
||||||
|
|
||||||
|
- Переключатель TCP/UDP заменён на `SegmentedButton` — стало нагляднее и удобнее
|
||||||
|
- На главном экране в карточке настроек теперь отображается текущий транспорт (TCP/UDP)
|
||||||
|
- Поле VK-ссылки стало однострочным — без лишнего пространства
|
||||||
|
- Поле порта принимает только цифры
|
||||||
|
- Терминология SSH: «подключено» → «сопряжено» — точнее отражает состояние соединения
|
||||||
|
|
||||||
|
### Исправления
|
||||||
|
|
||||||
|
- Слайдер потоков больше не обрезает значения из-за ошибки округления (`roundToInt` вместо `toInt`)
|
||||||
|
- Исправлено условие показа онбординг-экрана при первом запуске
|
||||||
|
- Устранена лишняя вибрация на splash-экране
|
||||||
|
- Устранена утечка coroutine scope в ProxyService
|
||||||
|
|
||||||
|
### Безопасность
|
||||||
|
|
||||||
|
- Закрыта возможность shell-инъекции через параметры `listen`/`connect` при управлении сервером
|
||||||
Reference in new issue
Block a user