Auto-commit after successful build: update app gameplay/UI, improve build setup
Changed files:\napp/build.gradle.kts app/src/main/java/com/kawomi/githugandroid/Terminal.kt
This commit is contained in:
@@ -18,8 +18,6 @@ import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.relocation.BringIntoViewRequester
|
||||
import androidx.compose.foundation.relocation.bringIntoViewRequester
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.text.BasicTextField
|
||||
import androidx.compose.foundation.text.KeyboardActions
|
||||
@@ -32,7 +30,6 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.key
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.focus.FocusRequester
|
||||
@@ -51,8 +48,6 @@ import androidx.compose.ui.text.input.KeyboardType
|
||||
import androidx.compose.ui.text.input.TextFieldValue
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@OptIn(ExperimentalFoundationApi::class)
|
||||
@Composable
|
||||
@@ -71,7 +66,6 @@ fun TerminalPane(
|
||||
) {
|
||||
val configuration = LocalConfiguration.current
|
||||
val focusRequester = remember { FocusRequester() }
|
||||
val bringIntoViewRequester = remember { BringIntoViewRequester() }
|
||||
val focusManager = LocalFocusManager.current
|
||||
val keyboardController = LocalSoftwareKeyboardController.current
|
||||
val horizontalScroll = rememberScrollState()
|
||||
@@ -90,13 +84,13 @@ fun TerminalPane(
|
||||
}
|
||||
|
||||
LaunchedEffect(output.size) {
|
||||
//outputVerticalScroll.animateScrollTo(outputVerticalScroll.maxValue)
|
||||
outputVerticalScroll.animateScrollTo(outputVerticalScroll.maxValue)
|
||||
}
|
||||
|
||||
LaunchedEffect(output.size, commandInput.text) {
|
||||
if (output.isNotEmpty() && commandInput.text.isEmpty()) {
|
||||
//if (output.isNotEmpty() && commandInput.text.isEmpty()) {
|
||||
horizontalScroll.scrollTo(0)
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
fun submitCommand() {
|
||||
@@ -147,7 +141,6 @@ fun TerminalPane(
|
||||
)
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.bringIntoViewRequester(bringIntoViewRequester)
|
||||
.fillMaxWidth()
|
||||
.widthIn(min = terminalMinWidth)
|
||||
.background(PanelPrimary, RoundedCornerShape(8.dp))
|
||||
@@ -167,7 +160,6 @@ fun TerminalPane(
|
||||
commandInput = commandInput,
|
||||
onValueChange = onValueChange,
|
||||
focusRequester = focusRequester,
|
||||
bringIntoViewRequester = bringIntoViewRequester,
|
||||
keyboardController = keyboardController,
|
||||
onSubmit = { submitCommand() },
|
||||
)
|
||||
@@ -183,12 +175,9 @@ private fun RowScope.TerminalInputField(
|
||||
commandInput: TextFieldValue,
|
||||
onValueChange: (TextFieldValue) -> Unit,
|
||||
focusRequester: FocusRequester,
|
||||
bringIntoViewRequester: BringIntoViewRequester,
|
||||
keyboardController: androidx.compose.ui.platform.SoftwareKeyboardController?,
|
||||
onSubmit: () -> Unit,
|
||||
) {
|
||||
val scope = rememberCoroutineScope()
|
||||
|
||||
key(inputFieldVersion) {
|
||||
BasicTextField(
|
||||
value = commandInput,
|
||||
@@ -196,14 +185,9 @@ private fun RowScope.TerminalInputField(
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.focusRequester(focusRequester)
|
||||
.bringIntoViewRequester(bringIntoViewRequester)
|
||||
.onFocusChanged { state ->
|
||||
if (state.isFocused) {
|
||||
keyboardController?.show()
|
||||
scope.launch {
|
||||
delay(150)
|
||||
bringIntoViewRequester.bringIntoView()
|
||||
}
|
||||
}
|
||||
},
|
||||
singleLine = true,
|
||||
|
||||
Reference in New Issue
Block a user