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:
@@ -11,8 +11,8 @@ android {
|
|||||||
applicationId = "com.kawomi.githugandroid"
|
applicationId = "com.kawomi.githugandroid"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 51
|
versionCode = 55
|
||||||
versionName = "0.1.50"
|
versionName = "0.1.54"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ import androidx.compose.foundation.layout.padding
|
|||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.layout.widthIn
|
import androidx.compose.foundation.layout.widthIn
|
||||||
import androidx.compose.foundation.rememberScrollState
|
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.shape.RoundedCornerShape
|
||||||
import androidx.compose.foundation.text.BasicTextField
|
import androidx.compose.foundation.text.BasicTextField
|
||||||
import androidx.compose.foundation.text.KeyboardActions
|
import androidx.compose.foundation.text.KeyboardActions
|
||||||
@@ -32,7 +30,6 @@ import androidx.compose.runtime.Composable
|
|||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
import androidx.compose.runtime.key
|
import androidx.compose.runtime.key
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.rememberCoroutineScope
|
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.focus.FocusRequester
|
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.text.input.TextFieldValue
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import kotlinx.coroutines.delay
|
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
|
|
||||||
@OptIn(ExperimentalFoundationApi::class)
|
@OptIn(ExperimentalFoundationApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
@@ -71,7 +66,6 @@ fun TerminalPane(
|
|||||||
) {
|
) {
|
||||||
val configuration = LocalConfiguration.current
|
val configuration = LocalConfiguration.current
|
||||||
val focusRequester = remember { FocusRequester() }
|
val focusRequester = remember { FocusRequester() }
|
||||||
val bringIntoViewRequester = remember { BringIntoViewRequester() }
|
|
||||||
val focusManager = LocalFocusManager.current
|
val focusManager = LocalFocusManager.current
|
||||||
val keyboardController = LocalSoftwareKeyboardController.current
|
val keyboardController = LocalSoftwareKeyboardController.current
|
||||||
val horizontalScroll = rememberScrollState()
|
val horizontalScroll = rememberScrollState()
|
||||||
@@ -90,13 +84,13 @@ fun TerminalPane(
|
|||||||
}
|
}
|
||||||
|
|
||||||
LaunchedEffect(output.size) {
|
LaunchedEffect(output.size) {
|
||||||
//outputVerticalScroll.animateScrollTo(outputVerticalScroll.maxValue)
|
outputVerticalScroll.animateScrollTo(outputVerticalScroll.maxValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
LaunchedEffect(output.size, commandInput.text) {
|
LaunchedEffect(output.size, commandInput.text) {
|
||||||
if (output.isNotEmpty() && commandInput.text.isEmpty()) {
|
//if (output.isNotEmpty() && commandInput.text.isEmpty()) {
|
||||||
horizontalScroll.scrollTo(0)
|
horizontalScroll.scrollTo(0)
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun submitCommand() {
|
fun submitCommand() {
|
||||||
@@ -147,7 +141,6 @@ fun TerminalPane(
|
|||||||
)
|
)
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.bringIntoViewRequester(bringIntoViewRequester)
|
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.widthIn(min = terminalMinWidth)
|
.widthIn(min = terminalMinWidth)
|
||||||
.background(PanelPrimary, RoundedCornerShape(8.dp))
|
.background(PanelPrimary, RoundedCornerShape(8.dp))
|
||||||
@@ -167,7 +160,6 @@ fun TerminalPane(
|
|||||||
commandInput = commandInput,
|
commandInput = commandInput,
|
||||||
onValueChange = onValueChange,
|
onValueChange = onValueChange,
|
||||||
focusRequester = focusRequester,
|
focusRequester = focusRequester,
|
||||||
bringIntoViewRequester = bringIntoViewRequester,
|
|
||||||
keyboardController = keyboardController,
|
keyboardController = keyboardController,
|
||||||
onSubmit = { submitCommand() },
|
onSubmit = { submitCommand() },
|
||||||
)
|
)
|
||||||
@@ -183,12 +175,9 @@ private fun RowScope.TerminalInputField(
|
|||||||
commandInput: TextFieldValue,
|
commandInput: TextFieldValue,
|
||||||
onValueChange: (TextFieldValue) -> Unit,
|
onValueChange: (TextFieldValue) -> Unit,
|
||||||
focusRequester: FocusRequester,
|
focusRequester: FocusRequester,
|
||||||
bringIntoViewRequester: BringIntoViewRequester,
|
|
||||||
keyboardController: androidx.compose.ui.platform.SoftwareKeyboardController?,
|
keyboardController: androidx.compose.ui.platform.SoftwareKeyboardController?,
|
||||||
onSubmit: () -> Unit,
|
onSubmit: () -> Unit,
|
||||||
) {
|
) {
|
||||||
val scope = rememberCoroutineScope()
|
|
||||||
|
|
||||||
key(inputFieldVersion) {
|
key(inputFieldVersion) {
|
||||||
BasicTextField(
|
BasicTextField(
|
||||||
value = commandInput,
|
value = commandInput,
|
||||||
@@ -196,14 +185,9 @@ private fun RowScope.TerminalInputField(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.focusRequester(focusRequester)
|
.focusRequester(focusRequester)
|
||||||
.bringIntoViewRequester(bringIntoViewRequester)
|
|
||||||
.onFocusChanged { state ->
|
.onFocusChanged { state ->
|
||||||
if (state.isFocused) {
|
if (state.isFocused) {
|
||||||
keyboardController?.show()
|
keyboardController?.show()
|
||||||
scope.launch {
|
|
||||||
delay(150)
|
|
||||||
bringIntoViewRequester.bringIntoView()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
|
|||||||
Reference in New Issue
Block a user