refactor: удаление пасхалки

This commit is contained in:
samosvalishe committed 2026-06-03 10:40:46 +03:00
1 parent 129b2bf2ae
commit cb2e41d3fd
2 files changed
+1 -1295

No files matched your search

@@ -54,7 +54,6 @@ import androidx.compose.material3.Surface
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TextButton import androidx.compose.material3.TextButton
import androidx.compose.material3.TopAppBar import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.rememberBottomSheetScaffoldState import androidx.compose.material3.rememberBottomSheetScaffoldState
import androidx.compose.material3.rememberModalBottomSheetState import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.material3.rememberStandardBottomSheetState import androidx.compose.material3.rememberStandardBottomSheetState
@@ -80,7 +79,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.scale import androidx.compose.ui.draw.scale
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.semantics.contentDescription import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.semantics import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
@@ -166,7 +164,6 @@ fun HomeScreen(
val profilesSnapshot by settingsViewModel.profilesSnapshot.collectAsStateWithLifecycle() val profilesSnapshot by settingsViewModel.profilesSnapshot.collectAsStateWithLifecycle()
val showBottomSheet = rememberSaveable { mutableStateOf(false) } val showBottomSheet = rememberSaveable { mutableStateOf(false) }
val showSplitSheet = rememberSaveable { mutableStateOf(false) } val showSplitSheet = rememberSaveable { mutableStateOf(false) }
var showEasterEgg by rememberSaveable { mutableStateOf(false) }
val bottomSheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true) val bottomSheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
val splitSheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true) val splitSheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
val snackbarHostState = remember { SnackbarHostState() } val snackbarHostState = remember { SnackbarHostState() }
@@ -389,11 +386,7 @@ fun HomeScreen(
settingsViewModel = settingsViewModel, settingsViewModel = settingsViewModel,
containerColor = sheetColor, containerColor = sheetColor,
privacyMode = privacyMode, privacyMode = privacyMode,
onPrivacyModeChange = { settingsViewModel.setPrivacyMode(it) }, onPrivacyModeChange = { settingsViewModel.setPrivacyMode(it) }
onEasterEgg = {
showBottomSheet.value = false
showEasterEgg = true
}
) )
} }
} }
@@ -417,12 +410,6 @@ fun HomeScreen(
} }
UpdateDialogs(settingsViewModel) UpdateDialogs(settingsViewModel)
if (showEasterEgg) {
com.freeturn.app.ui.screens.easteregg.EasterEggDialog(
onDismiss = { showEasterEgg = false }
)
}
} }
// Диалоги обновления // Диалоги обновления
@@ -591,14 +578,12 @@ private fun ProxyToggleButton(state: ProxyState, onClick: () -> Unit) {
// Bottom sheet // Bottom sheet
@Suppress("AssignedValueIsNeverRead")
@Composable @Composable
private fun InfoBottomSheet( private fun InfoBottomSheet(
settingsViewModel: SettingsViewModel, settingsViewModel: SettingsViewModel,
containerColor: Color, containerColor: Color,
privacyMode: Boolean, privacyMode: Boolean,
onPrivacyModeChange: (Boolean) -> Unit, onPrivacyModeChange: (Boolean) -> Unit,
onEasterEgg: () -> Unit = {}
) { ) {
val context = LocalContext.current val context = LocalContext.current
val uriHandler = LocalUriHandler.current val uriHandler = LocalUriHandler.current
@@ -745,26 +730,11 @@ private fun InfoBottomSheet(
) )
} }
// Версия — 7 быстрых тапов открывают пасхалку
item { item {
val tapTimes = remember { mutableStateOf<List<Long>>(emptyList()) }
Text( Text(
text = "v$appVersion", text = "v$appVersion",
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.clickable(
indication = null,
interactionSource = remember { androidx.compose.foundation.interaction.MutableInteractionSource() }
) {
val now = android.os.SystemClock.uptimeMillis()
val recent = (tapTimes.value + now).filter { now - it <= 2500 }
tapTimes.value = recent
if (recent.size >= 7) {
tapTimes.value = emptyList()
HapticUtil.perform(context, HapticUtil.Pattern.TOGGLE_ON)
onEasterEgg()
}
}
.padding(vertical = 16.dp), .padding(vertical = 16.dp),
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
style = MaterialTheme.typography.labelSmall, style = MaterialTheme.typography.labelSmall,
File diff suppressed because it is too large. Load diff