feat(settings): разделы «Приложение» и «О проекте», редизайн SSH-лога
- «Приложение»: приватный режим, динамическая тема, карточка обновлений (статус + действие во всю ширину), сброс настроек - «О проекте»: лого, версия, описание, ссылки (контент инфо-шита с главного переезжает в настройки) - SSH-лог: терминальная панель на тональных ролях схемы, счётчик строк, промпт с курсором, действия отдельным рядом — шапка больше не переполняется на узких экранах
This commit is contained in:
1 parent
30d931230d
commit
a5c053629e
8 files changed
+701
-166
No files matched your search
@@ -45,7 +45,9 @@ import androidx.navigation.compose.rememberNavController
|
||||
import com.freeturn.app.ui.HapticUtil
|
||||
import com.freeturn.app.ui.theme.LocalReducedMotion
|
||||
import com.freeturn.app.ui.screens.CaptchaWebViewDialog
|
||||
import com.freeturn.app.ui.screens.AboutScreen
|
||||
import com.freeturn.app.ui.screens.AdvancedScreen
|
||||
import com.freeturn.app.ui.screens.AppScreen
|
||||
import com.freeturn.app.ui.screens.ClientSetupScreen
|
||||
import com.freeturn.app.ui.screens.ConnectionModeScreen
|
||||
import com.freeturn.app.ui.screens.HomeScreen
|
||||
@@ -80,6 +82,8 @@ object Routes {
|
||||
|
||||
// Settings-флоу: Настройки → Серверы → [сервер] → подключение / сервер
|
||||
const val SETTINGS = "settings"
|
||||
const val APP_SETTINGS = "app_settings"
|
||||
const val ABOUT = "about"
|
||||
const val ADVANCED = "advanced"
|
||||
const val SERVERS_LIST = "servers_list"
|
||||
const val SERVER_DETAIL = "server_detail/{profileId}"
|
||||
@@ -310,7 +314,10 @@ private fun AppNavHost(
|
||||
HomeScreen(
|
||||
settingsViewModel = settingsViewModel,
|
||||
proxyViewModel = proxyViewModel,
|
||||
onOpenLogs = { navController.navigate(Routes.LOGS) }
|
||||
onOpenLogs = { navController.navigate(Routes.LOGS) },
|
||||
// Хаб сервера живёт в графе настроек — нижний бар подсветит «Настройки»,
|
||||
// системный «назад» вернёт на главную.
|
||||
onOpenServerSettings = { id -> navController.navigate(Routes.serverDetail(id)) }
|
||||
)
|
||||
}
|
||||
composable(Routes.LOGS) {
|
||||
@@ -323,10 +330,23 @@ private fun AppNavHost(
|
||||
composable(Routes.SETTINGS) {
|
||||
SettingsScreen(
|
||||
onOpenServers = { navController.navigate(Routes.SERVERS_LIST) },
|
||||
onOpenAdvanced = { navController.navigate(Routes.ADVANCED) }
|
||||
onOpenApp = { navController.navigate(Routes.APP_SETTINGS) },
|
||||
onOpenAdvanced = { navController.navigate(Routes.ADVANCED) },
|
||||
onOpenAbout = { navController.navigate(Routes.ABOUT) }
|
||||
)
|
||||
}
|
||||
|
||||
composable(Routes.APP_SETTINGS) {
|
||||
AppScreen(
|
||||
settingsViewModel = settingsViewModel,
|
||||
onBack = { navController.popBackStack() }
|
||||
)
|
||||
}
|
||||
|
||||
composable(Routes.ABOUT) {
|
||||
AboutScreen(onBack = { navController.popBackStack() })
|
||||
}
|
||||
|
||||
composable(Routes.ADVANCED) {
|
||||
AdvancedScreen(
|
||||
settingsViewModel = settingsViewModel,
|
||||
|
||||
@@ -0,0 +1,446 @@
|
||||
@file:OptIn(
|
||||
androidx.compose.material3.ExperimentalMaterial3Api::class,
|
||||
androidx.compose.material3.ExperimentalMaterial3ExpressiveApi::class
|
||||
)
|
||||
|
||||
package com.freeturn.app.ui.screens
|
||||
|
||||
import androidx.compose.animation.AnimatedContent
|
||||
import androidx.compose.animation.fadeIn
|
||||
import androidx.compose.animation.fadeOut
|
||||
import androidx.compose.animation.togetherWith
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material3.AlertDialog
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.FilledTonalButton
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.LargeFlexibleTopAppBar
|
||||
import androidx.compose.material3.LinearWavyProgressIndicator
|
||||
import androidx.compose.material3.LoadingIndicator
|
||||
import androidx.compose.material3.MaterialShapes
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.material3.TopAppBarDefaults
|
||||
import androidx.compose.material3.toShape
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalUriHandler
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import com.freeturn.app.R
|
||||
import com.freeturn.app.ui.HapticUtil
|
||||
import com.freeturn.app.ui.components.SectionLabel
|
||||
import com.freeturn.app.ui.components.SettingsBackButton
|
||||
import com.freeturn.app.ui.components.SettingsCard
|
||||
import com.freeturn.app.ui.components.SettingsContentMaxWidth
|
||||
import com.freeturn.app.ui.components.SettingsEntryRow
|
||||
import com.freeturn.app.ui.components.SettingsGroup
|
||||
import com.freeturn.app.ui.components.SettingsGroupItem
|
||||
import com.freeturn.app.ui.components.SettingsRowIcon
|
||||
import com.freeturn.app.ui.components.SettingsSwitchRow
|
||||
import com.freeturn.app.ui.util.hapticClickable
|
||||
import com.freeturn.app.viewmodel.SettingsViewModel
|
||||
import com.freeturn.app.viewmodel.UpdateState
|
||||
|
||||
// Экраны «Приложение» и «О проекте» — бывшее содержимое инфо-шита главного экрана,
|
||||
// разложенное по разделам настроек на общих settings-блоках.
|
||||
|
||||
/** Версия приложения из PackageManager; "—" если недоступна. */
|
||||
@Composable
|
||||
private fun rememberAppVersion(): String {
|
||||
val context = LocalContext.current
|
||||
return remember {
|
||||
try {
|
||||
context.packageManager.getPackageInfo(context.packageName, 0).versionName ?: "—"
|
||||
} catch (_: Exception) {
|
||||
"—"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** «Приложение»: интерфейсные тоггл-настройки, обновление и сброс. */
|
||||
@Suppress("AssignedValueIsNeverRead") // showResetDialog пишется в лямбдах диалога
|
||||
@Composable
|
||||
fun AppScreen(
|
||||
settingsViewModel: SettingsViewModel,
|
||||
onBack: () -> Unit
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
val privacyMode by settingsViewModel.privacyMode.collectAsStateWithLifecycle()
|
||||
val dynamicTheme by settingsViewModel.dynamicTheme.collectAsStateWithLifecycle()
|
||||
val updateState by settingsViewModel.updateState.collectAsStateWithLifecycle()
|
||||
val appVersion = rememberAppVersion()
|
||||
var showResetDialog by rememberSaveable { mutableStateOf(false) }
|
||||
val scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior()
|
||||
|
||||
Scaffold(
|
||||
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
|
||||
topBar = {
|
||||
LargeFlexibleTopAppBar(
|
||||
title = { Text(stringResource(R.string.settings_app)) },
|
||||
navigationIcon = { SettingsBackButton(onBack) },
|
||||
scrollBehavior = scrollBehavior
|
||||
)
|
||||
},
|
||||
contentWindowInsets = WindowInsets(0, 0, 0, 0)
|
||||
) { padding ->
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(padding)
|
||||
.verticalScroll(rememberScrollState()),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.widthIn(max = SettingsContentMaxWidth)
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp, vertical = 12.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(16.dp)
|
||||
) {
|
||||
SectionLabel(stringResource(R.string.app_section_interface))
|
||||
SettingsGroup {
|
||||
SettingsGroupItem(0, 2) {
|
||||
SettingsSwitchRow(
|
||||
title = stringResource(R.string.privacy_mode_title),
|
||||
subtitle = stringResource(R.string.privacy_mode_desc),
|
||||
iconRes = R.drawable.visibility_off_24px,
|
||||
checked = privacyMode,
|
||||
onCheckedChange = { settingsViewModel.setPrivacyMode(it) }
|
||||
)
|
||||
}
|
||||
SettingsGroupItem(1, 2) {
|
||||
SettingsSwitchRow(
|
||||
title = stringResource(R.string.dynamic_theme_title),
|
||||
subtitle = stringResource(R.string.dynamic_theme_desc),
|
||||
iconRes = R.drawable.palette_24px,
|
||||
checked = dynamicTheme,
|
||||
onCheckedChange = { settingsViewModel.setDynamicTheme(it) }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
SectionLabel(stringResource(R.string.app_section_updates))
|
||||
UpdateCard(
|
||||
state = updateState,
|
||||
appVersion = appVersion,
|
||||
onCheck = {
|
||||
HapticUtil.perform(context, HapticUtil.Pattern.CLICK)
|
||||
settingsViewModel.checkForUpdate()
|
||||
},
|
||||
onDownload = {
|
||||
HapticUtil.perform(context, HapticUtil.Pattern.CLICK)
|
||||
settingsViewModel.downloadUpdate()
|
||||
},
|
||||
onInstall = {
|
||||
HapticUtil.perform(context, HapticUtil.Pattern.CLICK)
|
||||
settingsViewModel.installUpdate()
|
||||
}
|
||||
)
|
||||
|
||||
SectionLabel(stringResource(R.string.app_section_reset))
|
||||
SettingsCard {
|
||||
ResetRow(onClick = { showResetDialog = true })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (showResetDialog) {
|
||||
AlertDialog(
|
||||
onDismissRequest = { showResetDialog = false },
|
||||
title = { Text(stringResource(R.string.reset_all_settings_title)) },
|
||||
text = { Text(stringResource(R.string.reset_all_settings_desc)) },
|
||||
confirmButton = {
|
||||
TextButton(
|
||||
onClick = {
|
||||
showResetDialog = false
|
||||
settingsViewModel.resetAllSettings()
|
||||
},
|
||||
colors = ButtonDefaults.textButtonColors(
|
||||
contentColor = MaterialTheme.colorScheme.error
|
||||
)
|
||||
) { Text(stringResource(R.string.reset)) }
|
||||
},
|
||||
dismissButton = {
|
||||
TextButton(onClick = { showResetDialog = false }) {
|
||||
Text(stringResource(R.string.cancel))
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Карточка обновления. Двухэтажная (как SshLogCard): шапка — иконка, заголовок и статус
|
||||
* (анимированная смена), под ней действие во всю ширину — кнопка по состоянию либо
|
||||
* wavy-прогресс загрузки. В одну строку всё это не влезает на узких экранах.
|
||||
*/
|
||||
@Composable
|
||||
private fun UpdateCard(
|
||||
state: UpdateState,
|
||||
appVersion: String,
|
||||
onCheck: () -> Unit,
|
||||
onDownload: () -> Unit,
|
||||
onInstall: () -> Unit
|
||||
) {
|
||||
val statusText = when (state) {
|
||||
is UpdateState.Idle -> stringResource(R.string.update_current_version, "v$appVersion")
|
||||
is UpdateState.Checking -> stringResource(R.string.update_checking)
|
||||
is UpdateState.Available -> stringResource(R.string.update_available, state.version)
|
||||
is UpdateState.Downloading -> stringResource(R.string.update_downloading, state.progress)
|
||||
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)
|
||||
}
|
||||
|
||||
SettingsCard {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(16.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||
) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(16.dp),
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
SettingsRowIcon(R.drawable.cloud_download_24px)
|
||||
Column(modifier = Modifier.weight(1f)) {
|
||||
Text(stringResource(R.string.update_title), style = MaterialTheme.typography.bodyLarge)
|
||||
AnimatedContent(
|
||||
targetState = statusText,
|
||||
transitionSpec = { fadeIn() togetherWith fadeOut() },
|
||||
label = "update_status"
|
||||
) { text ->
|
||||
Text(
|
||||
text,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = if (state is UpdateState.Error) MaterialTheme.colorScheme.error
|
||||
else MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (state is UpdateState.Downloading) {
|
||||
LinearWavyProgressIndicator(
|
||||
progress = { state.progress / 100f },
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
)
|
||||
} else {
|
||||
val action = when (state) {
|
||||
is UpdateState.Available -> onDownload
|
||||
is UpdateState.ReadyToInstall -> onInstall
|
||||
else -> onCheck
|
||||
}
|
||||
FilledTonalButton(
|
||||
onClick = action,
|
||||
enabled = state !is UpdateState.Checking,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
if (state is UpdateState.Checking) {
|
||||
LoadingIndicator(modifier = Modifier.size(22.dp))
|
||||
} else {
|
||||
Text(
|
||||
when (state) {
|
||||
is UpdateState.Available -> stringResource(R.string.update_download)
|
||||
is UpdateState.ReadyToInstall -> stringResource(R.string.update_install)
|
||||
else -> stringResource(R.string.update_check)
|
||||
},
|
||||
maxLines = 1
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Опасная строка сброса: error-тинт иконки и заголовка, без trailing-шеврона. */
|
||||
@Composable
|
||||
private fun ResetRow(onClick: () -> Unit) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.hapticClickable(HapticUtil.Pattern.CLICK, onClick = onClick)
|
||||
.padding(horizontal = 16.dp, vertical = 14.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(16.dp)
|
||||
) {
|
||||
SettingsRowIcon(
|
||||
R.drawable.delete_24px,
|
||||
container = MaterialTheme.colorScheme.errorContainer,
|
||||
tint = MaterialTheme.colorScheme.onErrorContainer
|
||||
)
|
||||
Column(modifier = Modifier.weight(1f)) {
|
||||
Text(
|
||||
stringResource(R.string.reset_settings),
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = MaterialTheme.colorScheme.error
|
||||
)
|
||||
Text(
|
||||
stringResource(R.string.app_reset_desc),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** «О проекте»: hero с лого в expressive-форме, версия, описание и ссылки. */
|
||||
@Composable
|
||||
fun AboutScreen(onBack: () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
val uriHandler = LocalUriHandler.current
|
||||
val appVersion = rememberAppVersion()
|
||||
val scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior()
|
||||
|
||||
fun open(url: String) {
|
||||
HapticUtil.perform(context, HapticUtil.Pattern.SELECTION)
|
||||
uriHandler.openUri(url)
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
|
||||
topBar = {
|
||||
LargeFlexibleTopAppBar(
|
||||
title = { Text(stringResource(R.string.settings_about)) },
|
||||
navigationIcon = { SettingsBackButton(onBack) },
|
||||
scrollBehavior = scrollBehavior
|
||||
)
|
||||
},
|
||||
contentWindowInsets = WindowInsets(0, 0, 0, 0)
|
||||
) { padding ->
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(padding)
|
||||
.verticalScroll(rememberScrollState()),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.widthIn(max = SettingsContentMaxWidth)
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp, vertical = 12.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(16.dp)
|
||||
) {
|
||||
AboutHero(appVersion)
|
||||
|
||||
SectionLabel(stringResource(R.string.about_links))
|
||||
SettingsGroup {
|
||||
SettingsGroupItem(0, 3) {
|
||||
SettingsEntryRow(
|
||||
iconRes = R.drawable.code_24px,
|
||||
title = stringResource(R.string.android_client),
|
||||
subtitle = "samosvalishe/turn-proxy-android",
|
||||
trailingRes = R.drawable.open_in_new_24px,
|
||||
trailingTint = MaterialTheme.colorScheme.primary,
|
||||
onClick = { open("https://github.com/samosvalishe/turn-proxy-android") }
|
||||
)
|
||||
}
|
||||
SettingsGroupItem(1, 3) {
|
||||
SettingsEntryRow(
|
||||
iconRes = R.drawable.terminal_24px,
|
||||
title = stringResource(R.string.proxy_core),
|
||||
subtitle = "samosvalishe/free-turn-proxy",
|
||||
trailingRes = R.drawable.open_in_new_24px,
|
||||
trailingTint = MaterialTheme.colorScheme.primary,
|
||||
onClick = { open("https://github.com/samosvalishe/free-turn-proxy") }
|
||||
)
|
||||
}
|
||||
SettingsGroupItem(2, 3) {
|
||||
SettingsEntryRow(
|
||||
iconRes = R.drawable.public_24px,
|
||||
title = stringResource(R.string.tg_channel),
|
||||
trailingRes = R.drawable.open_in_new_24px,
|
||||
trailingTint = MaterialTheme.colorScheme.primary,
|
||||
onClick = { open("https://t.me/+53nh4UNiSv5lNTgy") }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Hero «О проекте»: ромб-лого в 9-гранной cookie (как пустой список серверов), имя, версия-пилюля, описание. */
|
||||
@Composable
|
||||
private fun AboutHero(appVersion: String) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(top = 12.dp, bottom = 4.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Surface(
|
||||
shape = MaterialShapes.Cookie9Sided.toShape(),
|
||||
color = MaterialTheme.colorScheme.primaryContainer,
|
||||
modifier = Modifier.size(112.dp)
|
||||
) {
|
||||
Box(contentAlignment = Alignment.Center, modifier = Modifier.fillMaxSize()) {
|
||||
Icon(
|
||||
painterResource(R.drawable.logo_diamond_24px),
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onPrimaryContainer,
|
||||
modifier = Modifier.size(52.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
Spacer(Modifier.height(16.dp))
|
||||
Text(
|
||||
stringResource(R.string.turn_proxy_title),
|
||||
style = MaterialTheme.typography.headlineSmall
|
||||
)
|
||||
Spacer(Modifier.height(8.dp))
|
||||
Surface(
|
||||
shape = CircleShape,
|
||||
color = MaterialTheme.colorScheme.secondaryContainer
|
||||
) {
|
||||
Text(
|
||||
"v$appVersion",
|
||||
style = MaterialTheme.typography.labelMedium.copy(fontFamily = FontFamily.Monospace),
|
||||
color = MaterialTheme.colorScheme.onSecondaryContainer,
|
||||
modifier = Modifier.padding(horizontal = 12.dp, vertical = 4.dp)
|
||||
)
|
||||
}
|
||||
Spacer(Modifier.height(16.dp))
|
||||
Text(
|
||||
stringResource(R.string.about_description),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
textAlign = TextAlign.Center,
|
||||
modifier = Modifier.padding(horizontal = 8.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -40,16 +40,16 @@ import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material3.AlertDialog
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.CircularProgressIndicator
|
||||
import androidx.compose.material3.DropdownMenu
|
||||
import androidx.compose.material3.DropdownMenuItem
|
||||
import androidx.compose.material3.FilledTonalButton
|
||||
import androidx.compose.material3.FilledTonalIconButton
|
||||
import androidx.compose.material3.LoadingIndicator
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.LargeFlexibleTopAppBar
|
||||
import androidx.compose.material3.LinearWavyProgressIndicator
|
||||
import androidx.compose.material3.MaterialShapes
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
import androidx.compose.material3.Scaffold
|
||||
@@ -57,7 +57,6 @@ import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.material3.TopAppBarDefaults
|
||||
import androidx.compose.material3.toShape
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
@@ -91,7 +90,10 @@ import com.freeturn.app.data.Profile
|
||||
import com.freeturn.app.domain.server.ServerCommand
|
||||
import com.freeturn.app.domain.server.ServerOptions
|
||||
import com.freeturn.app.ui.HapticUtil
|
||||
import com.freeturn.app.ui.components.EmptyServersState
|
||||
import com.freeturn.app.ui.components.SectionLabel
|
||||
import com.freeturn.app.ui.components.ServerRow
|
||||
import com.freeturn.app.ui.components.SettingsBackButton
|
||||
import com.freeturn.app.ui.components.SettingsCard
|
||||
import com.freeturn.app.ui.components.SettingsContentMaxWidth
|
||||
import com.freeturn.app.ui.components.SettingsEntryRow
|
||||
@@ -101,7 +103,6 @@ import com.freeturn.app.ui.components.SettingsSwitchRow
|
||||
import com.freeturn.app.ui.components.settingsItemShape
|
||||
import com.freeturn.app.ui.theme.LocalReducedMotion
|
||||
import com.freeturn.app.ui.theme.extendedColorScheme
|
||||
import com.freeturn.app.ui.util.hapticClickable
|
||||
import com.freeturn.app.viewmodel.ServerHubStatus
|
||||
import com.freeturn.app.viewmodel.ServerViewModel
|
||||
import com.freeturn.app.viewmodel.SettingsViewModel
|
||||
@@ -109,11 +110,13 @@ import com.freeturn.app.viewmodel.SshConnectionState
|
||||
import com.freeturn.app.viewmodel.serverSettingsAvailable
|
||||
|
||||
|
||||
/** Корневой экран настроек (нижнее меню). Пока единственный пункт — «Серверы». */
|
||||
/** Корневой экран настроек (нижнее меню): серверы, приложение, продвинутые, о проекте. */
|
||||
@Composable
|
||||
fun SettingsScreen(
|
||||
onOpenServers: () -> Unit,
|
||||
onOpenAdvanced: () -> Unit
|
||||
onOpenApp: () -> Unit,
|
||||
onOpenAdvanced: () -> Unit,
|
||||
onOpenAbout: () -> Unit
|
||||
) {
|
||||
val scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior()
|
||||
Scaffold(
|
||||
@@ -145,7 +148,7 @@ fun SettingsScreen(
|
||||
// наружные углы большие. Новые пункты добавляются строкой в группу,
|
||||
// при разрастании — разбиение на группы с SectionLabel.
|
||||
SettingsGroup {
|
||||
SettingsGroupItem(0, 2) {
|
||||
SettingsGroupItem(0, 4) {
|
||||
SettingsEntryRow(
|
||||
iconRes = R.drawable.database_24px,
|
||||
title = stringResource(R.string.settings_servers),
|
||||
@@ -153,7 +156,15 @@ fun SettingsScreen(
|
||||
onClick = onOpenServers
|
||||
)
|
||||
}
|
||||
SettingsGroupItem(1, 2) {
|
||||
SettingsGroupItem(1, 4) {
|
||||
SettingsEntryRow(
|
||||
iconRes = R.drawable.mobile_24px,
|
||||
title = stringResource(R.string.settings_app),
|
||||
subtitle = stringResource(R.string.settings_app_desc),
|
||||
onClick = onOpenApp
|
||||
)
|
||||
}
|
||||
SettingsGroupItem(2, 4) {
|
||||
SettingsEntryRow(
|
||||
iconRes = R.drawable.tune_24px,
|
||||
title = stringResource(R.string.settings_advanced),
|
||||
@@ -161,6 +172,14 @@ fun SettingsScreen(
|
||||
onClick = onOpenAdvanced
|
||||
)
|
||||
}
|
||||
SettingsGroupItem(3, 4) {
|
||||
SettingsEntryRow(
|
||||
iconRes = R.drawable.info_24px,
|
||||
title = stringResource(R.string.settings_about),
|
||||
subtitle = stringResource(R.string.settings_about_desc),
|
||||
onClick = onOpenAbout
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -184,7 +203,7 @@ fun AdvancedScreen(
|
||||
topBar = {
|
||||
LargeFlexibleTopAppBar(
|
||||
title = { Text(stringResource(R.string.settings_advanced)) },
|
||||
navigationIcon = { BackButton(onBack) },
|
||||
navigationIcon = { SettingsBackButton(onBack) },
|
||||
scrollBehavior = scrollBehavior
|
||||
)
|
||||
},
|
||||
@@ -234,7 +253,7 @@ fun ServersListScreen(
|
||||
topBar = {
|
||||
LargeFlexibleTopAppBar(
|
||||
title = { Text(stringResource(R.string.settings_servers)) },
|
||||
navigationIcon = { BackButton(onBack) },
|
||||
navigationIcon = { SettingsBackButton(onBack) },
|
||||
scrollBehavior = scrollBehavior
|
||||
)
|
||||
},
|
||||
@@ -242,7 +261,7 @@ fun ServersListScreen(
|
||||
contentWindowInsets = WindowInsets(0, 0, 0, 0)
|
||||
) { padding ->
|
||||
if (snapshot.loaded && snapshot.list.isEmpty()) {
|
||||
EmptyServers(modifier = Modifier.fillMaxSize().padding(padding))
|
||||
EmptyServersState(modifier = Modifier.fillMaxSize().padding(padding))
|
||||
return@Scaffold
|
||||
}
|
||||
Column(
|
||||
@@ -292,71 +311,14 @@ private fun ServerListRow(
|
||||
profile.client.serverAddress.takeIf { it.isNotBlank() }?.redact(privacyMode),
|
||||
stringResource(R.string.profile_has_ssh).takeIf { profile.ssh.ip.isNotBlank() }
|
||||
).joinToString(" · ").ifBlank { "—" }
|
||||
|
||||
// «Активный» = выбранный профиль (а не статус SSH-подключения). Текстового бейджа нет —
|
||||
// он сжимал заголовок на узких экранах; выбранность несёт тон контейнера
|
||||
// (secondaryContainer, как у selected-элементов M3) + насыщенный аватар.
|
||||
// Для TalkBack статус остаётся в contentDescription.
|
||||
val activeBadge = stringResource(R.string.profile_active_badge)
|
||||
val rowDesc = if (isActive) "${profile.name}, $activeBadge" else profile.name
|
||||
|
||||
val container = if (isActive) MaterialTheme.colorScheme.secondaryContainer
|
||||
else MaterialTheme.colorScheme.surfaceContainerLow
|
||||
val titleColor = if (isActive) MaterialTheme.colorScheme.onSecondaryContainer
|
||||
else MaterialTheme.colorScheme.onSurface
|
||||
val subColor = if (isActive) MaterialTheme.colorScheme.onSecondaryContainer.copy(alpha = 0.8f)
|
||||
else MaterialTheme.colorScheme.onSurfaceVariant
|
||||
val iconContainer = if (isActive) MaterialTheme.colorScheme.primary
|
||||
else MaterialTheme.colorScheme.surfaceContainerHighest
|
||||
val iconTint = if (isActive) MaterialTheme.colorScheme.onPrimary
|
||||
else MaterialTheme.colorScheme.onSurfaceVariant
|
||||
|
||||
Surface(shape = shape, color = container, modifier = Modifier.fillMaxWidth()) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.hapticClickable(HapticUtil.Pattern.CLICK, onClick = onClick)
|
||||
.semantics { contentDescription = rowDesc }
|
||||
.padding(horizontal = 16.dp, vertical = 14.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(16.dp)
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(44.dp)
|
||||
.background(iconContainer, CircleShape),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Icon(
|
||||
painterResource(R.drawable.database_24px),
|
||||
contentDescription = null,
|
||||
tint = iconTint,
|
||||
modifier = Modifier.size(22.dp)
|
||||
)
|
||||
}
|
||||
Column(modifier = Modifier.weight(1f)) {
|
||||
Text(
|
||||
profile.name,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = titleColor,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
Text(
|
||||
sub,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = subColor,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
}
|
||||
Icon(
|
||||
painterResource(R.drawable.chevron_right_24px),
|
||||
contentDescription = null,
|
||||
tint = subColor
|
||||
)
|
||||
}
|
||||
}
|
||||
ServerRow(
|
||||
name = profile.name,
|
||||
subtitle = sub,
|
||||
isActive = isActive,
|
||||
shape = shape,
|
||||
onClick = onClick,
|
||||
trailingIconRes = R.drawable.chevron_right_24px
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -435,7 +397,7 @@ fun ServerDetailScreen(
|
||||
subtitle = headerSubtitle?.let { sub ->
|
||||
{ Text(sub, maxLines = 1, overflow = TextOverflow.Ellipsis) }
|
||||
},
|
||||
navigationIcon = { BackButton(onBack) },
|
||||
navigationIcon = { SettingsBackButton(onBack) },
|
||||
scrollBehavior = scrollBehavior,
|
||||
actions = {
|
||||
Box {
|
||||
@@ -949,7 +911,7 @@ fun NerdScreen(
|
||||
topBar = {
|
||||
LargeFlexibleTopAppBar(
|
||||
title = { Text(stringResource(R.string.nerd_section_title)) },
|
||||
navigationIcon = { BackButton(onBack) },
|
||||
navigationIcon = { SettingsBackButton(onBack) },
|
||||
scrollBehavior = scrollBehavior
|
||||
)
|
||||
},
|
||||
@@ -1206,7 +1168,11 @@ private fun LogPane(text: String, color: Color = MaterialTheme.colorScheme.onSur
|
||||
|
||||
/**
|
||||
* Единый SSH-лог: весь вывод команд сопряжения/управления + server.log (тянется кнопкой
|
||||
* «Журнал сервера») — всё идёт сюда через runCmd. Автопрокрутка к свежим строкам.
|
||||
* «Журнал сервера») — всё идёт сюда через runCmd.
|
||||
*
|
||||
* Раскладка трёхэтажная, чтобы ничего не толкалось в одной строке: шапка (заголовок +
|
||||
* счётчик строк), терминал, ряд действий во всю ширину. Терминал на inverseSurface —
|
||||
* настоящая тёмная консоль в светлой теме, с приглашением «❯» и мигающим курсором.
|
||||
*/
|
||||
@Composable
|
||||
private fun SshLogCard(
|
||||
@@ -1221,7 +1187,10 @@ private fun SshLogCard(
|
||||
color = MaterialTheme.colorScheme.surfaceContainerLow,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Column(modifier = Modifier.padding(20.dp)) {
|
||||
Column(
|
||||
modifier = Modifier.padding(20.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||
) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth()) {
|
||||
Text(
|
||||
stringResource(R.string.ssh_log_title),
|
||||
@@ -1229,83 +1198,142 @@ private fun SshLogCard(
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
if (lines.isNotEmpty()) {
|
||||
IconButton(onClick = onClear) {
|
||||
Icon(
|
||||
painterResource(R.drawable.delete_24px),
|
||||
contentDescription = stringResource(R.string.clear)
|
||||
)
|
||||
}
|
||||
}
|
||||
if (canFetchJournal) {
|
||||
FilledTonalButton(onClick = onFetchJournal, enabled = !journalLoading) {
|
||||
if (journalLoading) {
|
||||
CircularProgressIndicator(
|
||||
modifier = Modifier.size(18.dp),
|
||||
strokeWidth = 2.dp
|
||||
)
|
||||
} else {
|
||||
Icon(
|
||||
painterResource(R.drawable.cloud_download_24px),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(18.dp)
|
||||
AnimatedContent(
|
||||
targetState = lines.size,
|
||||
transitionSpec = {
|
||||
(fadeIn() togetherWith fadeOut()).using(SizeTransform(clip = false))
|
||||
},
|
||||
label = "ssh_log_count"
|
||||
) { count ->
|
||||
Surface(
|
||||
shape = CircleShape,
|
||||
color = MaterialTheme.colorScheme.secondaryContainer
|
||||
) {
|
||||
Text(
|
||||
"$count",
|
||||
style = MaterialTheme.typography.labelMedium.copy(fontFamily = FontFamily.Monospace),
|
||||
color = MaterialTheme.colorScheme.onSecondaryContainer,
|
||||
modifier = Modifier.padding(horizontal = 10.dp, vertical = 4.dp)
|
||||
)
|
||||
}
|
||||
Spacer(Modifier.width(8.dp))
|
||||
Text(stringResource(R.string.ssh_log_fetch_journal))
|
||||
}
|
||||
}
|
||||
}
|
||||
Spacer(Modifier.height(12.dp))
|
||||
|
||||
SshTerminalPane(lines)
|
||||
|
||||
// Действия отдельным рядом во всю ширину — в шапке им тесно на узких экранах.
|
||||
if (canFetchJournal || lines.isNotEmpty()) {
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
if (canFetchJournal) {
|
||||
FilledTonalButton(
|
||||
onClick = onFetchJournal,
|
||||
enabled = !journalLoading,
|
||||
modifier = Modifier.weight(1f)
|
||||
) {
|
||||
if (journalLoading) {
|
||||
LoadingIndicator(modifier = Modifier.size(22.dp))
|
||||
} else {
|
||||
Icon(
|
||||
painterResource(R.drawable.cloud_download_24px),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(18.dp)
|
||||
)
|
||||
}
|
||||
Spacer(Modifier.width(8.dp))
|
||||
Text(stringResource(R.string.ssh_log_fetch_journal), maxLines = 1)
|
||||
}
|
||||
}
|
||||
if (lines.isNotEmpty()) {
|
||||
if (canFetchJournal) {
|
||||
FilledTonalIconButton(onClick = onClear) {
|
||||
Icon(
|
||||
painterResource(R.drawable.delete_24px),
|
||||
contentDescription = stringResource(R.string.clear)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
// Оффлайн: журнал не потянуть, очистка — единственное действие.
|
||||
FilledTonalButton(onClick = onClear, modifier = Modifier.weight(1f)) {
|
||||
Icon(
|
||||
painterResource(R.drawable.delete_24px),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(18.dp)
|
||||
)
|
||||
Spacer(Modifier.width(8.dp))
|
||||
Text(stringResource(R.string.clear))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Консоль SSH-лога: тёмная (inverseSurface) моноширинная панель с приглашением «❯» и
|
||||
* мигающим курсором в конце — пустой лог выглядит как ждущий терминал, а не дырка.
|
||||
* Автопрокрутка к свежим строкам.
|
||||
*/
|
||||
@Composable
|
||||
private fun SshTerminalPane(lines: List<String>) {
|
||||
// Тональные роли M3 — как у LogPane соседних карточек: панель живёт в теме
|
||||
// (light/dark/dynamic color), консольность несут моно-шрифт, промпт и курсор.
|
||||
val fg = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
val accent = MaterialTheme.colorScheme.primary
|
||||
Surface(
|
||||
shape = MaterialTheme.shapes.medium,
|
||||
color = MaterialTheme.colorScheme.surfaceContainerHighest,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
val scroll = rememberScrollState()
|
||||
LaunchedEffect(lines.size) { scroll.scrollTo(scroll.maxValue) }
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.heightIn(min = 88.dp, max = 400.dp)
|
||||
.verticalScroll(scroll)
|
||||
.padding(horizontal = 12.dp, vertical = 10.dp)
|
||||
) {
|
||||
val mono = MaterialTheme.typography.bodySmall.copy(fontFamily = FontFamily.Monospace)
|
||||
if (lines.isEmpty()) {
|
||||
Text(
|
||||
stringResource(R.string.ssh_log_empty),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
"# ${stringResource(R.string.ssh_log_empty)}",
|
||||
style = mono,
|
||||
color = fg.copy(alpha = 0.55f)
|
||||
)
|
||||
} else {
|
||||
LogPane(lines.joinToString("\n"), autoScroll = true)
|
||||
// Склейка дорогая (кап 500 строк) — кэшируем по содержимому лога.
|
||||
val text = remember(lines) { lines.joinToString("\n") }
|
||||
Text(text, style = mono, color = fg)
|
||||
}
|
||||
Row {
|
||||
Text("❯ ", style = mono, color = accent)
|
||||
if (LocalReducedMotion.current) {
|
||||
Text("▍", style = mono, color = accent)
|
||||
} else {
|
||||
// Альфа в draw-фазе через graphicsLayer: чтение анимации в композиции
|
||||
// рекомпозило бы строку на каждом кадре мигания.
|
||||
val blink = rememberInfiniteTransition(label = "ssh_cursor")
|
||||
.animateFloat(
|
||||
initialValue = 1f,
|
||||
targetValue = 0.1f,
|
||||
animationSpec = infiniteRepeatable(tween(600), RepeatMode.Reverse),
|
||||
label = "ssh_cursor_alpha"
|
||||
)
|
||||
Text(
|
||||
"▍",
|
||||
style = mono,
|
||||
color = accent,
|
||||
modifier = Modifier.graphicsLayer { alpha = blink.value }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun BackButton(onBack: () -> Unit) {
|
||||
IconButton(onClick = onBack) {
|
||||
Icon(
|
||||
painterResource(R.drawable.arrow_back_24px),
|
||||
contentDescription = stringResource(R.string.back)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun EmptyServers(modifier: Modifier = Modifier) {
|
||||
Column(
|
||||
modifier = modifier.padding(horizontal = 32.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center
|
||||
) {
|
||||
Surface(
|
||||
shape = MaterialShapes.Cookie9Sided.toShape(),
|
||||
color = MaterialTheme.colorScheme.primaryContainer,
|
||||
modifier = Modifier.size(112.dp)
|
||||
) {
|
||||
Box(contentAlignment = Alignment.Center, modifier = Modifier.fillMaxSize()) {
|
||||
Icon(
|
||||
painterResource(R.drawable.database_outlined_24px),
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onPrimaryContainer,
|
||||
modifier = Modifier.size(48.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
Spacer(Modifier.height(16.dp))
|
||||
Text(
|
||||
stringResource(R.string.settings_empty_servers),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M320,720L80,480L320,240L377,297L193,481L376,664L320,720ZM640,720L583,663L767,479L584,296L640,240L880,480L640,720Z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,12 @@
|
||||
<!-- Ромб из ic_launcher_foreground, но тинтуемый и без вшитого launcher-паддинга:
|
||||
для hero-блока «О проекте». -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,17.306L6.693,12L12,6.693L17.306,12L12,17.306ZM13.688,23.306C13.467,23.528 13.206,23.698 12.905,23.819C12.603,23.94 12.302,24 12,24C11.698,24 11.397,23.94 11.095,23.819C10.794,23.698 10.533,23.528 10.312,23.306L0.693,13.688C0.472,13.467 0.302,13.206 0.181,12.905C0.06,12.603 0,12.302 0,12C0,11.698 0.06,11.397 0.181,11.095C0.302,10.794 0.472,10.533 0.693,10.312L10.281,0.724C10.523,0.482 10.789,0.302 11.08,0.181C11.372,0.06 11.678,0 12,0C12.322,0 12.628,0.06 12.92,0.181C13.211,0.302 13.477,0.482 13.719,0.724L23.306,10.312C23.528,10.533 23.698,10.794 23.819,11.095C23.94,11.397 24,11.698 24,12C24,12.302 23.94,12.603 23.819,12.905C23.698,13.206 23.528,13.467 23.306,13.688L13.688,23.306ZM12,20.683L20.683,12L12,3.317L3.317,12L12,20.683Z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M480,880Q398,880 325,848.5Q252,817 197.5,762.5Q143,708 111.5,635Q80,562 80,480Q80,397 112.5,324Q145,251 200.5,197Q256,143 330,111.5Q404,80 488,80Q568,80 639,107.5Q710,135 763.5,183.5Q817,232 848.5,298.5Q880,365 880,442Q880,557 810,618.5Q740,680 640,680L566,680Q557,680 553.5,685Q550,690 550,696Q550,708 565,730.5Q580,753 580,782Q580,832 552.5,856Q525,880 480,880ZM480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480L480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480ZM303,503Q320,486 320,460Q320,434 303,417Q286,400 260,400Q234,400 217,417Q200,434 200,460Q200,486 217,503Q234,520 260,520Q286,520 303,503ZM423,343Q440,326 440,300Q440,274 423,257Q406,240 380,240Q354,240 337,257Q320,274 320,300Q320,326 337,343Q354,360 380,360Q406,360 423,343ZM623,343Q640,326 640,300Q640,274 623,257Q606,240 580,240Q554,240 537,257Q520,274 520,300Q520,326 537,343Q554,360 580,360Q606,360 623,343ZM743,503Q760,486 760,460Q760,434 743,417Q726,400 700,400Q674,400 657,417Q640,434 640,460Q640,486 657,503Q674,520 700,520Q726,520 743,503ZM480,800Q489,800 494.5,795Q500,790 500,782Q500,768 485,749Q470,730 470,692Q470,650 499,625Q528,600 570,600L640,600Q706,600 753,561.5Q800,523 800,442Q800,321 707.5,240.5Q615,160 488,160Q352,160 256,253Q160,346 160,480Q160,613 253.5,706.5Q347,800 480,800Z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M324,848.5Q251,817 197,763Q143,709 111.5,636Q80,563 80,480Q80,397 111.5,324Q143,251 197,197Q251,143 324,111.5Q397,80 480,80Q563,80 636,111.5Q709,143 763,197Q817,251 848.5,324Q880,397 880,480Q880,563 848.5,636Q817,709 763,763Q709,817 636,848.5Q563,880 480,880Q397,880 324,848.5ZM440,798L440,720Q407,720 383.5,696.5Q360,673 360,640L360,600L168,408Q165,426 162.5,444Q160,462 160,480Q160,601 239.5,692Q319,783 440,798ZM716,696Q757,651 778.5,595.5Q800,540 800,480Q800,382 745.5,301Q691,220 600,184L600,200Q600,233 576.5,256.5Q553,280 520,280L440,280L440,360Q440,377 428.5,388.5Q417,400 400,400L320,400L320,480L560,480Q577,480 588.5,491.5Q600,503 600,520L600,640L640,640Q666,640 687,655.5Q708,671 716,696Z"/>
|
||||
</vector>
|
||||
@@ -4,7 +4,6 @@
|
||||
<!-- HomeScreen -->
|
||||
<string name="nav_home">Главная</string>
|
||||
<string name="turn_proxy_title">Free Turn</string>
|
||||
<string name="info_desc">Информация</string>
|
||||
<string name="proxy_active">Прокси активен</string>
|
||||
<string name="proxy_connecting">Подключение…</string>
|
||||
<string name="proxy_press_to_start">Нажмите для запуска</string>
|
||||
@@ -21,7 +20,6 @@
|
||||
<string name="start_proxy">Запустить прокси</string>
|
||||
<string name="android_client">Android-клиент</string>
|
||||
<string name="proxy_core">Прокси-ядро</string>
|
||||
<string name="btn_open">Открыть</string>
|
||||
<string name="reset_settings">Сбросить настройки</string>
|
||||
<string name="reset">Сбросить</string>
|
||||
<string name="reset_all_settings_title">Сбросить все настройки?</string>
|
||||
@@ -140,7 +138,6 @@
|
||||
<!-- Update -->
|
||||
<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_available_title">Доступно обновление</string>
|
||||
<string name="update_available">Доступна версия %1$s</string>
|
||||
@@ -188,21 +185,8 @@
|
||||
<string name="tg_not_now">Не сейчас</string>
|
||||
|
||||
<!-- Profiles -->
|
||||
<string name="profiles_empty_title">Пока нет сохранённых профилей</string>
|
||||
<string name="profiles_empty_desc">Сохраните текущие настройки как профиль или импортируйте ссылку, чтобы переключаться между разными профилями.</string>
|
||||
<string name="profile_save_current">Сохранить текущие настройки</string>
|
||||
<string name="profile_save_dialog_title">Новый профиль</string>
|
||||
<string name="profile_name_label">Название профиля</string>
|
||||
<string name="profile_name_placeholder">Например, «Мой VPS»</string>
|
||||
<string name="profile_save">Сохранить</string>
|
||||
<string name="profile_rename">Переименовать</string>
|
||||
<string name="profile_delete">Удалить</string>
|
||||
<string name="profile_delete_title">Удалить профиль?</string>
|
||||
<string name="profile_delete_desc">Профиль «%1$s» будет удалён. Это действие нельзя отменить.</string>
|
||||
<string name="profile_more">Ещё</string>
|
||||
<string name="profile_default_name">Новый профиль</string>
|
||||
<string name="profile_name_taken">Профиль с таким именем уже существует</string>
|
||||
<string name="profile_unsaved_label">Несохранённая конфигурация</string>
|
||||
<string name="profile_unsaved_label">Не сохранено</string>
|
||||
|
||||
<!-- Notification & Tile -->
|
||||
<string name="notif_proxy_stop_action">Отключить</string>
|
||||
@@ -256,7 +240,7 @@
|
||||
<string name="settings_title">Настройки</string>
|
||||
<string name="settings_servers">Серверы</string>
|
||||
<string name="settings_servers_desc">Управление добавленными серверами и их настройками</string>
|
||||
<string name="settings_empty_servers">Нет добавленных серверов. Сохраните конфигурацию на главном экране.</string>
|
||||
<string name="settings_empty_servers">Нет добавленных серверов</string>
|
||||
<string name="provider_vk_calls">VK Звонки</string>
|
||||
<string name="server_delete_confirm_title">Удалить сервер?</string>
|
||||
<string name="server_delete_confirm_desc">Сервер «%1$s» и все его настройки будут удалены из приложения.</string>
|
||||
@@ -297,4 +281,19 @@
|
||||
<string name="load_wg_conf">Загрузить из файла</string>
|
||||
<string name="connection_config_section">Конфигурация туннеля</string>
|
||||
<string name="change_server">Сменить сервер</string>
|
||||
|
||||
<!-- Приложение -->
|
||||
<string name="settings_app">Приложение</string>
|
||||
<string name="settings_app_desc">Тема, приватность и обновления</string>
|
||||
<string name="app_section_interface">Интерфейс</string>
|
||||
<string name="app_section_updates">Обновления</string>
|
||||
<string name="app_section_reset">Сброс</string>
|
||||
<string name="app_reset_desc">Удалить все данные приложения</string>
|
||||
<string name="update_current_version">Текущая версия %1$s</string>
|
||||
|
||||
<!-- О проекте -->
|
||||
<string name="settings_about">О проекте</string>
|
||||
<string name="settings_about_desc">Версия, описание и ссылки</string>
|
||||
<string name="about_description">Free Turn проксирует WireGuard и Xray-трафик через публичные TURN-сервера. Открытый исходный код и никакой телеметрии: все настройки хранятся только на вашем устройстве.</string>
|
||||
<string name="about_links">Ссылки</string>
|
||||
</resources>
|
||||
Reference in new issue
Block a user