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:
@@ -19,8 +19,8 @@ android {
|
|||||||
applicationId = "solutions.tretter.githugandroid"
|
applicationId = "solutions.tretter.githugandroid"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 99
|
versionCode = 100
|
||||||
versionName = "0.1.98"
|
versionName = "0.1.99"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
package solutions.tretter.githugandroid
|
package solutions.tretter.githugandroid
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.horizontalScroll
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.fillMaxHeight
|
import androidx.compose.foundation.layout.fillMaxHeight
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.widthIn
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.foundation.verticalScroll
|
import androidx.compose.foundation.verticalScroll
|
||||||
@@ -32,7 +35,8 @@ fun ManPageDialog(
|
|||||||
state: ManPageState,
|
state: ManPageState,
|
||||||
onClose: () -> Unit,
|
onClose: () -> Unit,
|
||||||
) {
|
) {
|
||||||
val scrollState = rememberScrollState()
|
val horizontalScrollState = rememberScrollState()
|
||||||
|
val verticalScrollState = rememberScrollState()
|
||||||
|
|
||||||
Dialog(onDismissRequest = onClose) {
|
Dialog(onDismissRequest = onClose) {
|
||||||
Surface(
|
Surface(
|
||||||
@@ -71,18 +75,24 @@ fun ManPageDialog(
|
|||||||
color = TextPrimary,
|
color = TextPrimary,
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
)
|
)
|
||||||
Text(
|
Box(
|
||||||
text = state.content,
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.background(TerminalBackground, RoundedCornerShape(6.dp))
|
.background(TerminalBackground, RoundedCornerShape(6.dp))
|
||||||
.padding(10.dp)
|
.padding(10.dp)
|
||||||
.verticalScroll(scrollState),
|
.horizontalScroll(horizontalScrollState)
|
||||||
color = TextPrimary,
|
.verticalScroll(verticalScrollState),
|
||||||
fontFamily = FontFamily.Monospace,
|
) {
|
||||||
fontSize = 13.sp,
|
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 focusRequester = remember { FocusRequester() }
|
||||||
val focusManager = LocalFocusManager.current
|
val focusManager = LocalFocusManager.current
|
||||||
val keyboardController = LocalSoftwareKeyboardController.current
|
val keyboardController = LocalSoftwareKeyboardController.current
|
||||||
val horizontalScroll = rememberScrollState()
|
val outputHorizontalScroll = rememberScrollState()
|
||||||
val outputVerticalScroll = rememberScrollState()
|
val outputVerticalScroll = rememberScrollState()
|
||||||
val terminalMinWidth = 80.dp * 7.2f
|
val terminalMinWidth = 80.dp * 7.2f
|
||||||
val terminalPaneMaxHeight = configuration.screenHeightDp.dp * 0.7f
|
val terminalPaneMaxHeight = configuration.screenHeightDp.dp * 0.7f
|
||||||
@@ -80,7 +80,7 @@ fun TerminalPane(
|
|||||||
LaunchedEffect(inputFieldVersion) {
|
LaunchedEffect(inputFieldVersion) {
|
||||||
focusRequester.requestFocus()
|
focusRequester.requestFocus()
|
||||||
keyboardController?.show()
|
keyboardController?.show()
|
||||||
horizontalScroll.scrollTo(0)
|
outputHorizontalScroll.scrollTo(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
LaunchedEffect(output.size) {
|
LaunchedEffect(output.size) {
|
||||||
@@ -112,14 +112,19 @@ fun TerminalPane(
|
|||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.background(PanelPrimary, RoundedCornerShape(10.dp))
|
.background(PanelPrimary, RoundedCornerShape(10.dp))
|
||||||
.padding(8.dp)
|
.padding(8.dp)
|
||||||
|
.horizontalScroll(outputHorizontalScroll)
|
||||||
.verticalScroll(outputVerticalScroll),
|
.verticalScroll(outputVerticalScroll),
|
||||||
) {
|
) {
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {
|
Column(
|
||||||
|
modifier = Modifier.widthIn(min = terminalMinWidth),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(4.dp),
|
||||||
|
) {
|
||||||
output.forEach { line ->
|
output.forEach { line ->
|
||||||
Text(
|
Text(
|
||||||
text = line,
|
text = line,
|
||||||
color = if (line.startsWith("✔") || line.startsWith("🏁")) Success else TextSecondary,
|
color = if (line.startsWith("✔") || line.startsWith("🏁")) Success else TextSecondary,
|
||||||
fontFamily = FontFamily.Monospace,
|
fontFamily = FontFamily.Monospace,
|
||||||
|
softWrap = false,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,20 @@
|
|||||||
package solutions.tretter.githugandroid
|
package solutions.tretter.githugandroid
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.horizontalScroll
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.fillMaxHeight
|
import androidx.compose.foundation.layout.fillMaxHeight
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.heightIn
|
import androidx.compose.foundation.layout.heightIn
|
||||||
import androidx.compose.foundation.layout.padding
|
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.shape.RoundedCornerShape
|
||||||
import androidx.compose.foundation.text.BasicTextField
|
import androidx.compose.foundation.text.BasicTextField
|
||||||
|
import androidx.compose.foundation.verticalScroll
|
||||||
import androidx.compose.material3.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material3.ButtonDefaults
|
import androidx.compose.material3.ButtonDefaults
|
||||||
import androidx.compose.material3.OutlinedTextField
|
import androidx.compose.material3.OutlinedTextField
|
||||||
@@ -41,6 +46,9 @@ fun TextEditorDialog(
|
|||||||
onClose: () -> Unit,
|
onClose: () -> Unit,
|
||||||
onSave: () -> Unit,
|
onSave: () -> Unit,
|
||||||
) {
|
) {
|
||||||
|
val editorHorizontalScroll = rememberScrollState()
|
||||||
|
val editorVerticalScroll = rememberScrollState()
|
||||||
|
|
||||||
Dialog(onDismissRequest = onClose) {
|
Dialog(onDismissRequest = onClose) {
|
||||||
Surface(
|
Surface(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@@ -78,22 +86,28 @@ fun TextEditorDialog(
|
|||||||
singleLine = true,
|
singleLine = true,
|
||||||
label = { Text("File name") },
|
label = { Text("File name") },
|
||||||
)
|
)
|
||||||
BasicTextField(
|
Box(
|
||||||
value = state.content,
|
|
||||||
onValueChange = onContentChange,
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.heightIn(min = 260.dp)
|
.heightIn(min = 260.dp)
|
||||||
.background(TerminalBackground, RoundedCornerShape(6.dp))
|
.background(TerminalBackground, RoundedCornerShape(6.dp))
|
||||||
.padding(10.dp),
|
.padding(10.dp)
|
||||||
textStyle = TextStyle(
|
.horizontalScroll(editorHorizontalScroll)
|
||||||
color = TextPrimary,
|
.verticalScroll(editorVerticalScroll),
|
||||||
fontFamily = FontFamily.Monospace,
|
) {
|
||||||
fontSize = 14.sp,
|
BasicTextField(
|
||||||
),
|
value = state.content,
|
||||||
cursorBrush = SolidColor(Accent),
|
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