feat: пасхалка
This commit is contained in:
1 parent
0557c31152
commit
c43cbad491
2 files changed
+1278
-3
No files matched your search
@@ -152,6 +152,7 @@ fun HomeScreen(
|
|||||||
val profilesSnapshot by viewModel.profilesSnapshot.collectAsStateWithLifecycle()
|
val profilesSnapshot by viewModel.profilesSnapshot.collectAsStateWithLifecycle()
|
||||||
val showBottomSheet = rememberSaveable { mutableStateOf(false) }
|
val showBottomSheet = rememberSaveable { mutableStateOf(false) }
|
||||||
val showProfilesSheet = rememberSaveable { mutableStateOf(false) }
|
val showProfilesSheet = rememberSaveable { mutableStateOf(false) }
|
||||||
|
var showEasterEgg by rememberSaveable { mutableStateOf(false) }
|
||||||
val bottomSheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
|
val bottomSheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
|
||||||
val profilesSheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
|
val profilesSheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
|
||||||
val snackbarHostState = remember { SnackbarHostState() }
|
val snackbarHostState = remember { SnackbarHostState() }
|
||||||
@@ -340,7 +341,11 @@ fun HomeScreen(
|
|||||||
viewModel = viewModel,
|
viewModel = viewModel,
|
||||||
containerColor = sheetColor,
|
containerColor = sheetColor,
|
||||||
privacyMode = privacyMode,
|
privacyMode = privacyMode,
|
||||||
onPrivacyModeChange = { viewModel.setPrivacyMode(it) }
|
onPrivacyModeChange = { viewModel.setPrivacyMode(it) },
|
||||||
|
onEasterEgg = {
|
||||||
|
showBottomSheet.value = false
|
||||||
|
showEasterEgg = true
|
||||||
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -363,6 +368,11 @@ fun HomeScreen(
|
|||||||
|
|
||||||
UpdateDialogs(viewModel)
|
UpdateDialogs(viewModel)
|
||||||
|
|
||||||
|
if (showEasterEgg) {
|
||||||
|
com.freeturn.app.ui.screens.easteregg.EasterEggDialog(
|
||||||
|
onDismiss = { showEasterEgg = false }
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Диалоги обновления
|
// Диалоги обновления
|
||||||
@@ -537,7 +547,8 @@ private fun InfoBottomSheet(
|
|||||||
viewModel: MainViewModel,
|
viewModel: MainViewModel,
|
||||||
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
|
||||||
@@ -684,12 +695,26 @@ 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
Reference in new issue
Block a user