[network/kdeconnect-android] src/main/java/org/kde/kdeconnect/plugins/runcommand: [RunCommand] Wait 1 second to show the stop button

Albert Vaca Cintora <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 76f66e5eef9224728e34dd27be390d6358069c98 by Albert Vaca Cintora.
Committed on 09/08/2026 at 14:24.
Pushed by albertvaka into branch 'master'.

[RunCommand] Wait 1 second to show the stop button

M  +12   -1    src/main/java/org/kde/kdeconnect/plugins/runcommand/RunCommandScreen.kt

https://invent.kde.org/network/kdeconnect-android/-/commit/76f66e5eef9224728e34dd27be390d6358069c98

diff --git a/src/main/java/org/kde/kdeconnect/plugins/runcommand/RunCommandScreen.kt b/src/main/java/org/kde/kdeconnect/plugins/runcommand/RunCommandScreen.kt
index 53e494579..c24a0a8a5 100644
--- a/src/main/java/org/kde/kdeconnect/plugins/runcommand/RunCommandScreen.kt
+++ b/src/main/java/org/kde/kdeconnect/plugins/runcommand/RunCommandScreen.kt
@@ -58,6 +58,7 @@ import androidx.compose.ui.text.style.TextOverflow
 import androidx.compose.ui.unit.IntOffset
 import androidx.compose.ui.unit.dp
 import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.delay
 import kotlinx.coroutines.launch
 import org.kde.kdeconnect.Device
 import org.kde.kdeconnect.ui.compose.KdeTheme
@@ -250,7 +251,17 @@ private fun OutputCard(
 ) {
     val state = rememberLazyListState()
     val coroutineScope = rememberCoroutineScope()
-    val showStopButton by remember { plugin.commandRunning }
+    val commandRunning by plugin.commandRunning
+    var showStopButton by remember { mutableStateOf(false) }
+
+    LaunchedEffect(commandRunning) {
+        if (commandRunning) {
+            delay(1000)
+            showStopButton = true
+        } else {
+            showStopButton = false
+        }
+    }
 
     Card(
         modifier = Modifier
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.