Skip to content

A rootless Android app that boots Alpine Linux: run containers (Podman/Docker/LXC) and GUI desktop apps.

feat: add terminal quick settings drawer, extra keys bar, haptic feedback, and animated boot progress

ExTvef3a1a502d80
diff --git a/app/src/main/java/com/excp/podroid/ui/HapticManager.kt b/app/src/main/java/com/excp/podroid/ui/HapticManager.kt
new file mode 100644
index 0000000..da04fe6
--- /dev/null
+++ b/app/src/main/java/com/excp/podroid/ui/HapticManager.kt
@@ -0,0 +1,119 @@
+package com.excp.podroid.ui
+
+import android.content.Context
+import android.os.Build
+import android.os.VibrationEffect
+import android.os.Vibrator
+import android.os.VibratorManager
+import kotlinx.coroutines.delay
+
+/**
+ * Centralized haptic feedback manager for Podroid terminal interactions.
+ * Provides various vibration patterns for different terminal events.
+ *
+ * Features debouncing to prevent haptic spam during rapid input.
+ */
+class HapticManager(private val context: Context) {
+
+ private val vibrator: Vibrator = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
+ (context.getSystemService(Context.VIBRATOR_MANAGER_SERVICE) as VibratorManager).defaultVibrator
+ } else {
+ @Suppress("DEPRECATION")
+ context.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator
+ }
+
+ // Debounce tracking
+ private var lastVibrateTime = 0L
+ private val debounceWindowMs = 30L // Minimum ms between vibrations
+
+ // Vibration enabled flag
+ var isEnabled: Boolean = true
+
+ /**
+ * Check if device can vibrate
+ */
+ private fun canVibrate(): Boolean {
+ return isEnabled && vibrator.hasVibrator()
+ }
+
+ /**
+ * Core vibration function with debouncing
+ */
+ private fun vibrate(effect: VibrationEffect) {
+ if (!canVibrate()) return
+
+ val now = System.currentTimeMillis()
+ if (now - lastVibrateTime < debounceWindowMs) return
+
+ lastVibrateTime = now
+ vibrator.vibrate(effect)
+ }
+
+ private fun vibrate(durationMs: Long) {
+ vibrate(VibrationEffect.createOneShot(durationMs, VibrationEffect.DEFAULT_AMPLITUDE))
+ }
+
+ /**
+ * Light tap for regular key presses
+ */
+ fun keyPress() {
+ vibrate(5)
+ }
+
+ /**
+ * Slightly stronger tick for extra keys bar presses
+ */
+ fun extraKeyPress() {
+ vibrate(10)
+ }
+
+ /**
+ * Medium pulse for long-press menu activation
+ */
+ fun longPressMenu() {
+ vibrate(30)
+ }
+
+ /**
+ * Double-tap confirmation for copy operations
+ */
+ fun copyConfirmation() {
+ if (!canVibrate()) return
+ val now = System.currentTimeMillis()
+ if (now - lastVibrateTime < debounceWindowMs) return
+ lastVibrateTime = now
+ vibrator.vibrate(VibrationEffect.createWaveform(longArrayOf(0, 20, 50, 20), -1))
+ }
+
+ /**
+ * Single tick for paste operations
+ */
+ fun pasteInput() {
+ vibrate(15)
+ }
+
+ /**
+ * Success feedback pulse
+ */
+ fun actionComplete() {
+ vibrate(25)
+ }
+
+ /**
+ * Error pattern: 50ms + pause + 50ms
+ */
+ fun error() {
+ if (!canVibrate()) return
+ val now = System.currentTimeMillis()
+ if (now - lastVibrateTime < debounceWindowMs) return
+ lastVibrateTime = now
+ vibrator.vibrate(VibrationEffect.createWaveform(longArrayOf(0, 50, 100, 50), -1))
+ }
+
+ /**
+ * Bell event (for terminal bell)
+ */
+ fun bell() {
+ vibrate(50)
+ }
+}
diff --git a/app/src/main/java/com/excp/podroid/ui/components/AdaptiveContainer.kt b/app/src/main/java/com/excp/podroid/ui/components/AdaptiveContainer.kt
new file mode 100644
index 0000000..329cda1
--- /dev/null
+++ b/app/src/main/java/com/excp/podroid/ui/components/AdaptiveContainer.kt
@@ -0,0 +1,41 @@
+package com.excp.podroid.ui.components
+
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.widthIn
+import androidx.compose.material3.windowsizeclass.WindowSizeClass
+import androidx.compose.material3.windowsizeclass.WindowWidthSizeClass
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+
+/**
+ * A container that constrains its content to a maximum width on large screens
+ * to follow Material 3 adaptive layout best practices.
+ */
+@Composable
+fun AdaptiveContainer(
+ windowSizeClass: WindowSizeClass,
+ modifier: Modifier = Modifier,
+ maxWidth: Int = 600,
+ content: @Composable () -> Unit
+) {
+ val isExpanded = windowSizeClass.widthSizeClass == WindowWidthSizeClass.Expanded
+ val isMedium = windowSizeClass.widthSizeClass == WindowWidthSizeClass.Medium
+
+ Box(
+ modifier = modifier.fillMaxWidth(),
+ contentAlignment = Alignment.TopCenter
+ ) {
+ Box(
+ modifier = if (isExpanded || isMedium) {
+ Modifier.widthIn(max = maxWidth.dp)
+ } else {
+ Modifier.fillMaxWidth()
+ }
+ ) {
+ content()
+ }
+ }
+}
diff --git a/app/src/main/java/com/excp/podroid/ui/screens/home/AnimatedBootProgress.kt b/app/src/main/java/com/excp/podroid/ui/screens/home/AnimatedBootProgress.kt
new file mode 100644
index 0000000..32b4296
--- /dev/null
+++ b/app/src/main/java/com/excp/podroid/ui/screens/home/AnimatedBootProgress.kt
@@ -0,0 +1,158 @@
+package com.excp.podroid.ui.screens.home
+
+import androidx.compose.animation.core.LinearEasing
+import androidx.compose.animation.core.RepeatMode
+import androidx.compose.animation.core.animateFloat
+import androidx.compose.animation.core.infiniteRepeatable
+import androidx.compose.animation.core.rememberInfiniteTransition
+import androidx.compose.animation.core.tween
+import androidx.compose.foundation.Canvas
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Spacer
+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.material3.LinearProgressIndicator
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableFloatStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.geometry.Size
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.StrokeCap
+import androidx.compose.ui.graphics.drawscope.Stroke
+import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+import kotlinx.coroutines.delay
+
+@Composable
+fun AnimatedBootProgress(bootStage: String, modifier: Modifier = Modifier) {
+ val infiniteTransition = rememberInfiniteTransition()
+
+ val pulseScale by infiniteTransition.animateFloat(
+ initialValue = 0.9f,
+ targetValue = 1.1f,
+ animationSpec = infiniteRepeatable(
+ animation = tween(600, easing = LinearEasing),
+ repeatMode = RepeatMode.Reverse
+ )
+ )
+
+ val rotationAngle by infiniteTransition.animateFloat(
+ initialValue = 0f,
+ targetValue = 360f,
+ animationSpec = infiniteRepeatable(
+ animation = tween(1500, easing = LinearEasing),
+ repeatMode = RepeatMode.Restart
+ )
+ )
+
+ var animatedProgress by remember { mutableFloatStateOf(0f) }
+ val isReady = bootStage == "Ready"
+
+ LaunchedEffect(bootStage) {
+ if (!isReady) {
+ animatedProgress = minOf(animatedProgress + 0.15f, 0.95f)
+ } else {
+ animatedProgress = 1f
+ }
+ }
+
+ val primaryColor = MaterialTheme.colorScheme.primary
+ val surfaceVariantColor = MaterialTheme.colorScheme.surfaceVariant
+
+ Column(
+ horizontalAlignment = Alignment.CenterHorizontally,
+ verticalArrangement = Arrangement.Center,
+ modifier = modifier
+ ) {
+ Box(
+ contentAlignment = Alignment.Center,
+ modifier = Modifier.size(120.dp)
+ ) {
+ Canvas(modifier = Modifier.size(120.dp)) {
+ val strokeWidth = 8.dp.toPx()
+ val radius = (size.minDimension - strokeWidth) / 2
+ val center = Offset(size.width / 2, size.height / 2)
+
+ drawCircle(
+ color = surfaceVariantColor,
+ radius = radius,
+ center = center,
+ style = Stroke(width = strokeWidth)
+ )
+
+ if (!isReady) {
+ drawArc(
+ color = primaryColor,
+ startAngle = rotationAngle,
+ sweepAngle = 270f,
+ useCenter = false,
+ topLeft = Offset(center.x - radius, center.y - radius),
+ size = Size(radius * 2, radius * 2),
+ style = Stroke(width = strokeWidth, cap = StrokeCap.Round)
+ )
+ } else {
+ drawArc(
+ color = primaryColor,
+ startAngle = 0f,
+ sweepAngle = 360f,
+ useCenter = false,
+ topLeft = Offset(center.x - radius, center.y - radius),
+ size = Size(radius * 2, radius * 2),
+ style = Stroke(width = strokeWidth, cap = StrokeCap.Round)
+ )
+ }
+ }
+
+ Column(horizontalAlignment = Alignment.CenterHorizontally) {
+ Text(
+ text = if (isReady) "✓" else "P",
+ color = primaryColor,
+ fontSize = if (isReady) 48.sp else (40 * pulseScale).sp,
+ fontWeight = FontWeight.Bold
+ )
+ }
+ }
+
+ Spacer(modifier = Modifier.height(16.dp))
+
+ LinearProgressIndicator(
+ progress = { animatedProgress },
+ modifier = Modifier
+ .fillMaxWidth(0.7f)
+ .height(6.dp),
+ color = primaryColor,
+ trackColor = surfaceVariantColor,
+ )
+
+ Spacer(modifier = Modifier.height(12.dp))
+
+ Text(
+ text = if (isReady) "Boot Complete!" else bootStage.ifEmpty { "Starting..." },
+ style = MaterialTheme.typography.titleMedium,
+ color = if (isReady) primaryColor else MaterialTheme.colorScheme.onSurfaceVariant,
+ fontWeight = FontWeight.SemiBold
+ )
+
+ if (!isReady) {
+ Spacer(modifier = Modifier.height(4.dp))
+ Text(
+ text = "Please wait...",
+ style = MaterialTheme.typography.bodySmall,
+ color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.7f)
+ )
+ }
+ }
+}
diff --git a/app/src/main/java/com/excp/podroid/ui/screens/terminal/DefaultKeyLayouts.kt b/app/src/main/java/com/excp/podroid/ui/screens/terminal/DefaultKeyLayouts.kt
new file mode 100644
index 0000000..ac8f275
--- /dev/null
+++ b/app/src/main/java/com/excp/podroid/ui/screens/terminal/DefaultKeyLayouts.kt
@@ -0,0 +1,77 @@
+package com.excp.podroid.ui.screens.terminal
+
+/**
+ * Default key layouts for the terminal extra keys bar.
+ */
+object DefaultKeyLayouts {
+
+ /**
+ * Minimal layout: ESC, TAB, CTRL, ALT, arrow cluster
+ */
+ val minimal = listOf(
+ ExtraKey("ESC", KeyAction.SendEscape("\u001B")),
+ ExtraKey("TAB", KeyAction.SendEscape("\u0009")),
+ ExtraKey("CTRL", KeyAction.ModifierOnly(Modifier.CTRL)),
+ ExtraKey("ALT", KeyAction.ModifierOnly(Modifier.ALT)),
+ ExtraKey("↑", KeyAction.SendEscape("\u001B[A")),
+ ExtraKey("↓", KeyAction.SendEscape("\u001B[B")),
+ ExtraKey("←", KeyAction.SendEscape("\u001B[D")),
+ ExtraKey("→", KeyAction.SendEscape("\u001B[C"))
+ )
+
+ /**
+ * Full layout: all keys including function keys and page navigation
+ */
+ val full = listOf(
+ // Row 1 - Basic controls
+ ExtraKey("ESC", KeyAction.SendEscape("\u001B")),
+ ExtraKey("TAB", KeyAction.SendEscape("\u0009")),
+ ExtraKey("CTRL", KeyAction.ModifierOnly(Modifier.CTRL)),
+ ExtraKey("ALT", KeyAction.ModifierOnly(Modifier.ALT)),
+ ExtraKey("↑", KeyAction.SendEscape("\u001B[A")),
+ ExtraKey("↓", KeyAction.SendEscape("\u001B[B")),
+ ExtraKey("←", KeyAction.SendEscape("\u001B[D")),
+ ExtraKey("→", KeyAction.SendEscape("\u001B[C")),
+
+ // Row 2 - Navigation
+ ExtraKey("HOME", KeyAction.SendEscape("\u001B[H")),
+ ExtraKey("END", KeyAction.SendEscape("\u001B[F")),
+ ExtraKey("PgUp", KeyAction.SendEscape("\u001B[5~")),
+ ExtraKey("PgDn", KeyAction.SendEscape("\u001B[6~")),
+
+ // Row 3 - Function keys F1-F4
+ ExtraKey("F1", KeyAction.SendEscape("\u001BOP")),
+ ExtraKey("F2", KeyAction.SendEscape("\u001BOQ")),
+ ExtraKey("F3", KeyAction.SendEscape("\u001BOR")),
+ ExtraKey("F4", KeyAction.SendEscape("\u001BOS")),
+
+ // Row 4 - F5-F12
+ ExtraKey("F5", KeyAction.SendEscape("\u001B[15~")),
+ ExtraKey("F6", KeyAction.SendEscape("\u001B[17~")),
+ ExtraKey("F7", KeyAction.SendEscape("\u001B[18~")),
+ ExtraKey("F8", KeyAction.SendEscape("\u001B[19~")),
+ ExtraKey("F9", KeyAction.SendEscape("\u001B[20~")),
+ ExtraKey("F10", KeyAction.SendEscape("\u001B[21~")),
+ ExtraKey("F11", KeyAction.SendEscape("\u001B[23~")),
+ ExtraKey("F12", KeyAction.SendEscape("\u001B[24~")),
+
+ // Row 5 - Symbols
+ ExtraKey("-", KeyAction.SendEscape("-")),
+ ExtraKey("/", KeyAction.SendEscape("/")),
+ ExtraKey("|", KeyAction.SendEscape("|")),
+
+ // Row 6 - Special
+ ExtraKey("^C", KeyAction.CtrlC),
+ ExtraKey("^D", KeyAction.CtrlD),
+ ExtraKey("^Z", KeyAction.CtrlZ)
+ )
+
+ /**
+ * Get layout by name.
+ */
+ fun getLayout(name: String): List<ExtraKey> = when (name) {
+ "minimal" -> minimal
+ "full" -> full
+ else -> minimal
+ }
+}
diff --git a/app/src/main/java/com/excp/podroid/ui/screens/terminal/ExtraKey.kt b/app/src/main/java/com/excp/podroid/ui/screens/terminal/ExtraKey.kt
new file mode 100644
index 0000000..e5714a8
--- /dev/null
+++ b/app/src/main/java/com/excp/podroid/ui/screens/terminal/ExtraKey.kt
@@ -0,0 +1,138 @@
+package com.excp.podroid.ui.screens.terminal
+
+import android.util.Base64
+
+/**
+ * Data model for customizable extra keys in the terminal toolbar.
+ */
+data class ExtraKey(
+ val label: String,
+ val action: KeyAction,
+ val modifier: Modifier? = null
+)
+
+/**
+ * Actions that an extra key can perform.
+ */
+sealed class KeyAction {
+ /** Send an escape sequence */
+ data class SendEscape(val sequence: String) : KeyAction()
+
+ /** Send Ctrl+C */
+ object CtrlC : KeyAction()
+
+ /** Send Ctrl+D */
+ object CtrlD : KeyAction()
+
+ /** Send Ctrl+Z */
+ object CtrlZ : KeyAction()
+
+ /** Send raw bytes */
+ data class Custom(val bytes: ByteArray) : KeyAction()
+
+ /** Toggle modifier only (Ctrl, Alt, Shift) */
+ data class ModifierOnly(val modifier: Modifier) : KeyAction()
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) return true
+ if (javaClass != other?.javaClass) return false
+ other as KeyAction
+ return when (this) {
+ is SendEscape -> other is SendEscape && sequence == other.sequence
+ is CtrlC -> other is CtrlC
+ is CtrlD -> other is CtrlD
+ is CtrlZ -> other is CtrlZ
+ is Custom -> other is Custom && bytes.contentEquals(other.bytes)
+ is ModifierOnly -> other is ModifierOnly && modifier == other.modifier
+ }
+ }
+
+ override fun hashCode(): Int {
+ return when (this) {
+ is SendEscape -> sequence.hashCode()
+ is CtrlC -> CtrlC.hashCode()
+ is CtrlD -> CtrlD.hashCode()
+ is CtrlZ -> CtrlZ.hashCode()
+ is Custom -> bytes.contentHashCode()
+ is ModifierOnly -> modifier.hashCode()
+ }
+ }
+}
+
+/**
+ * Modifier keys that can be toggled.
+ */
+enum class Modifier { CTRL, ALT, SHIFT }
+
+/**
+ * Serialization helpers for ExtraKey to/from JSON.
+ */
+object ExtraKeySerde {
+
+ /**
+ * Parse a JSON string into a list of ExtraKeys.
+ */
+ fun fromJson(json: String): List<ExtraKey> {
+ if (json.isBlank()) return emptyList()
+ return try {
+ val arr = org.json.JSONArray(json)
+ val list = mutableListOf<ExtraKey>()
+ for (i in 0 until arr.length()) {
+ val obj = arr.getJSONObject(i)
+ val label = obj.getString("label")
+ val mod = if (obj.has("modifier")) {
+ Modifier.valueOf(obj.getString("modifier"))
+ } else null
+
+ val actionObj = obj.getJSONObject("action")
+ val action: KeyAction = when (actionObj.getString("type")) {
+ "SendEscape" -> KeyAction.SendEscape(actionObj.getString("sequence"))
+ "CtrlC" -> KeyAction.CtrlC
+ "CtrlD" -> KeyAction.CtrlD
+ "CtrlZ" -> KeyAction.CtrlZ
+ "Custom" -> KeyAction.Custom(Base64.decode(actionObj.getString("bytes"), Base64.NO_WRAP))
+ "ModifierOnly" -> KeyAction.ModifierOnly(Modifier.valueOf(actionObj.getString("modifier")))
+ else -> KeyAction.CtrlC
+ }
+ list.add(ExtraKey(label, action, mod))
+ }
+ list
+ } catch (e: Exception) {
+ emptyList()
+ }
+ }
+
+ /**
+ * Serialize a list of ExtraKeys to JSON string.
+ */
+ fun toJson(keys: List<ExtraKey>): String {
+ val arr = org.json.JSONArray()
+ for (k in keys) {
+ val obj = org.json.JSONObject()
+ obj.put("label", k.label)
+ k.modifier?.let { obj.put("modifier", it.name) }
+
+ val actionObj = org.json.JSONObject()
+ when (val a = k.action) {
+ is KeyAction.SendEscape -> {
+ actionObj.put("type", "SendEscape")
+ actionObj.put("sequence", a.sequence)
+ }
+ is KeyAction.CtrlC -> actionObj.put("type", "CtrlC")
+ is KeyAction.CtrlD -> actionObj.put("type", "CtrlD")
+ is KeyAction.CtrlZ -> actionObj.put("type", "CtrlZ")
+ is KeyAction.Custom -> {
+ actionObj.put("type", "Custom")
+ actionObj.put("bytes", Base64.encodeToString(a.bytes, Base64.NO_WRAP))
+ }
+ is KeyAction.ModifierOnly -> {
+ actionObj.put("type", "ModifierOnly")
+ actionObj.put("modifier", a.modifier.name)
+ }
+ }
+ obj.put("action", actionObj)
+ arr.put(obj)
+ }
+ return arr.toString()
+ }
+}
diff --git a/app/src/main/java/com/excp/podroid/ui/screens/terminal/QuickSettingsDrawer.kt b/app/src/main/java/com/excp/podroid/ui/screens/terminal/QuickSettingsDrawer.kt
new file mode 100644
index 0000000..ed186a6
--- /dev/null
+++ b/app/src/main/java/com/excp/podroid/ui/screens/terminal/QuickSettingsDrawer.kt
@@ -0,0 +1,132 @@
+package com.excp.podroid.ui.screens.terminal
+
+import androidx.compose.foundation.background
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.horizontalScroll
+import androidx.compose.foundation.layout.*
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.material3.*
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+import androidx.compose.material3.Slider
+import androidx.compose.material3.Switch
+import androidx.compose.material3.SwitchDefaults
+import androidx.compose.material3.Text
+import androidx.compose.ui.text.style.TextAlign
+import androidx.compose.foundation.lazy.LazyRow
+import androidx.compose.foundation.lazy.items
+
+/**
+ * Quick Settings Drawer content for the Terminal screen.
+ * This composable is used as the sheet content of a bottom sheet.
+ */
+@Composable
+fun QuickSettingsDrawer(
+ isVisible: Boolean,
+ onDismiss: () -> Unit,
+ // Settings from SettingsRepository via ViewModel
+ fontSize: Int,
+ colorTheme: String,
+ onFontSizeChange: (Int) -> Unit,
+ onColorThemeChange: (String) -> Unit,
+ onToggleExtraKeys: (Boolean) -> Unit,
+ onToggleHaptics: (Boolean) -> Unit,
+ onToggleKeepScreen: (Boolean) -> Unit,
+ // Additional ephemeral UI state (from ViewModel)
+ showExtraKeys: Boolean,
+ hapticsEnabled: Boolean,
+ keepScreenOnEnabled: Boolean,
+){
+ // Only render when sheet is visible; the ModalBottomSheetLayout handles visibility, but we keep a guard for safety
+ if (!isVisible) return
+
+ Column(
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(16.dp)
+ ) {
+ Text(text = "Quick Settings", fontSize = 18.sp, fontWeight = FontWeight.Bold)
+ Spacer(modifier = Modifier.height(12.dp))
+
+ // Font size slider
+ Text(text = "Font size", fontSize = 14.sp, color = Color(0xFFCCCCCC))
+ Spacer(modifier = Modifier.height(6.dp))
+ Slider(
+ value = fontSize.toFloat(),
+ onValueChange = { onFontSizeChange(it.toInt()) },
+ valueRange = 16f..32f,
+ steps = 16
+ )
+ Spacer(modifier = Modifier.height(12.dp))
+
+ // Theme chips
+ Text(text = "Theme", fontSize = 14.sp, color = Color(0xFFCCCCCC))
+ Spacer(modifier = Modifier.height(6.dp))
+ val themes = listOf("default","Dracula","Nord","Gruvbox","Solarized","Tokyo Night")
+ LazyRow(
+ modifier = Modifier.fillMaxWidth(),
+ contentPadding = PaddingValues(horizontal = 4.dp)
+ ) {
+ items(themes) { t ->
+ val selected = t == colorTheme
+ Box(
+ modifier = Modifier
+ .padding(end = 8.dp)
+ .background(if (selected) Color(0xFF4FC3F7) else Color(0xFF333333), RoundedCornerShape(999.dp))
+ .clickable { onColorThemeChange(t) }
+ .padding(horizontal = 12.dp, vertical = 8.dp)
+ ) {
+ Text(text = t, fontSize = 12.sp, color = Color.White)
+ }
+ }
+ }
+ Spacer(modifier = Modifier.height(12.dp))
+
+ // Extra keys bar toggle
+ Row(
+ verticalAlignment = Alignment.CenterVertically,
+ modifier = Modifier.fillMaxWidth()
+ ) {
+ Text("Show extra keys bar", fontSize = 14.sp, color = Color(0xFFCCCCCC), modifier = Modifier.weight(1f))
+ Switch(
+ checked = showExtraKeys,
+ onCheckedChange = { checked -> onToggleExtraKeys(checked) },
+ colors = SwitchDefaults.colors(checkedThumbColor = Color.White)
+ )
+ }
+ Spacer(modifier = Modifier.height(8.dp))
+
+ // Haptic feedback
+ Row(
+ verticalAlignment = Alignment.CenterVertically,
+ modifier = Modifier.fillMaxWidth()
+ ) {
+ Text("Haptic feedback", fontSize = 14.sp, color = Color(0xFFCCCCCC), modifier = Modifier.weight(1f))
+ Switch(
+ checked = hapticsEnabled,
+ onCheckedChange = { enabled -> onToggleHaptics(enabled) },
+ )
+ }
+ Spacer(modifier = Modifier.height(8.dp))
+
+ // Keep screen on
+ Row(
+ verticalAlignment = Alignment.CenterVertically,
+ modifier = Modifier.fillMaxWidth()
+ ) {
+ Text("Keep screen on", fontSize = 14.sp, color = Color(0xFFCCCCCC), modifier = Modifier.weight(1f))
+ Switch(
+ checked = keepScreenOnEnabled,
+ onCheckedChange = { enabled -> onToggleKeepScreen(enabled) }
+ )
+ }
+ Spacer(modifier = Modifier.height(4.dp))
+ }
+}