Auto-commit after successful build: update app gameplay/UI, improve build setup
Changed files:\napp/build.gradle.kts app/src/main/java/solutions/tretter/githugandroid/ManPageDialog.kt app/src/main/java/solutions/tretter/githugandroid/Terminal.kt app/src/main/java/solutions/tretter/githugandroid/TextEditorDialog.kt
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
package solutions.tretter.githugandroid
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.horizontalScroll
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
@@ -32,7 +35,8 @@ fun ManPageDialog(
|
||||
state: ManPageState,
|
||||
onClose: () -> Unit,
|
||||
) {
|
||||
val scrollState = rememberScrollState()
|
||||
val horizontalScrollState = rememberScrollState()
|
||||
val verticalScrollState = rememberScrollState()
|
||||
|
||||
Dialog(onDismissRequest = onClose) {
|
||||
Surface(
|
||||
@@ -71,18 +75,24 @@ fun ManPageDialog(
|
||||
color = TextPrimary,
|
||||
fontWeight = FontWeight.Bold,
|
||||
)
|
||||
Text(
|
||||
text = state.content,
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.weight(1f)
|
||||
.background(TerminalBackground, RoundedCornerShape(6.dp))
|
||||
.padding(10.dp)
|
||||
.verticalScroll(scrollState),
|
||||
color = TextPrimary,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontSize = 13.sp,
|
||||
)
|
||||
.horizontalScroll(horizontalScrollState)
|
||||
.verticalScroll(verticalScrollState),
|
||||
) {
|
||||
Text(
|
||||
text = state.content,
|
||||
modifier = Modifier.widthIn(min = 1200.dp),
|
||||
color = TextPrimary,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontSize = 13.sp,
|
||||
softWrap = false,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ fun TerminalPane(
|
||||
val focusRequester = remember { FocusRequester() }
|
||||
val focusManager = LocalFocusManager.current
|
||||
val keyboardController = LocalSoftwareKeyboardController.current
|
||||
val horizontalScroll = rememberScrollState()
|
||||
val outputHorizontalScroll = rememberScrollState()
|
||||
val outputVerticalScroll = rememberScrollState()
|
||||
val terminalMinWidth = 80.dp * 7.2f
|
||||
val terminalPaneMaxHeight = configuration.screenHeightDp.dp * 0.7f
|
||||
@@ -80,7 +80,7 @@ fun TerminalPane(
|
||||
LaunchedEffect(inputFieldVersion) {
|
||||
focusRequester.requestFocus()
|
||||
keyboardController?.show()
|
||||
horizontalScroll.scrollTo(0)
|
||||
outputHorizontalScroll.scrollTo(0)
|
||||
}
|
||||
|
||||
LaunchedEffect(output.size) {
|
||||
@@ -112,14 +112,19 @@ fun TerminalPane(
|
||||
.fillMaxWidth()
|
||||
.background(PanelPrimary, RoundedCornerShape(10.dp))
|
||||
.padding(8.dp)
|
||||
.horizontalScroll(outputHorizontalScroll)
|
||||
.verticalScroll(outputVerticalScroll),
|
||||
) {
|
||||
Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {
|
||||
Column(
|
||||
modifier = Modifier.widthIn(min = terminalMinWidth),
|
||||
verticalArrangement = Arrangement.spacedBy(4.dp),
|
||||
) {
|
||||
output.forEach { line ->
|
||||
Text(
|
||||
text = line,
|
||||
color = if (line.startsWith("✔") || line.startsWith("🏁")) Success else TextSecondary,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
softWrap = false,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -264,4 +269,4 @@ private fun TerminalKeyButton(
|
||||
fontSize = 11.sp,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
package solutions.tretter.githugandroid
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.horizontalScroll
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.text.BasicTextField
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
@@ -41,6 +46,9 @@ fun TextEditorDialog(
|
||||
onClose: () -> Unit,
|
||||
onSave: () -> Unit,
|
||||
) {
|
||||
val editorHorizontalScroll = rememberScrollState()
|
||||
val editorVerticalScroll = rememberScrollState()
|
||||
|
||||
Dialog(onDismissRequest = onClose) {
|
||||
Surface(
|
||||
modifier = Modifier
|
||||
@@ -78,22 +86,28 @@ fun TextEditorDialog(
|
||||
singleLine = true,
|
||||
label = { Text("File name") },
|
||||
)
|
||||
BasicTextField(
|
||||
value = state.content,
|
||||
onValueChange = onContentChange,
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.weight(1f)
|
||||
.heightIn(min = 260.dp)
|
||||
.background(TerminalBackground, RoundedCornerShape(6.dp))
|
||||
.padding(10.dp),
|
||||
textStyle = TextStyle(
|
||||
color = TextPrimary,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontSize = 14.sp,
|
||||
),
|
||||
cursorBrush = SolidColor(Accent),
|
||||
)
|
||||
.padding(10.dp)
|
||||
.horizontalScroll(editorHorizontalScroll)
|
||||
.verticalScroll(editorVerticalScroll),
|
||||
) {
|
||||
BasicTextField(
|
||||
value = state.content,
|
||||
onValueChange = onContentChange,
|
||||
modifier = Modifier.widthIn(min = 1200.dp),
|
||||
textStyle = TextStyle(
|
||||
color = TextPrimary,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontSize = 14.sp,
|
||||
),
|
||||
cursorBrush = SolidColor(Accent),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user