v1.2.7: visible input row with EditText, always tappable
This commit is contained in:
@@ -504,16 +504,32 @@ fun SshTerminalScreen(
|
|||||||
.clickable { requestEditTextFocus() }
|
.clickable { requestEditTextFocus() }
|
||||||
) {
|
) {
|
||||||
// EditText 输入桥——在 Column 顶部,0高度不占空间
|
// EditText 输入桥——在 Column 顶部,0高度不占空间
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.height(40.dp)
|
||||||
|
.background(Color(0xFF0D1117))
|
||||||
|
.padding(horizontal = 8.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = if (state.connected) "\$ " else "",
|
||||||
|
color = accent,
|
||||||
|
fontSize = 13.sp,
|
||||||
|
fontFamily = FontFamily.Monospace
|
||||||
|
)
|
||||||
AndroidView(
|
AndroidView(
|
||||||
factory = { ctx ->
|
factory = { ctx ->
|
||||||
EditText(ctx).apply {
|
EditText(ctx).apply {
|
||||||
setTextColor(0x00000000)
|
setBackgroundColor(android.graphics.Color.TRANSPARENT)
|
||||||
setBackgroundColor(0x00000000)
|
setTextColor(android.graphics.Color.parseColor("#E6EDF3"))
|
||||||
textSize = 1f
|
textSize = 14f
|
||||||
imeOptions = EditorInfo.IME_ACTION_SEND or EditorInfo.IME_FLAG_NO_EXTRACT_UI
|
hint = if (state.connected) "type command..." else ""
|
||||||
|
setHintTextColor(android.graphics.Color.parseColor("#6E7681"))
|
||||||
|
imeOptions = EditorInfo.IME_ACTION_SEND
|
||||||
setSingleLine()
|
setSingleLine()
|
||||||
setOnEditorActionListener { _, actionId, _ ->
|
setOnEditorActionListener { _, actionId, _ ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEND || actionId == EditorInfo.IME_ACTION_DONE) {
|
if (actionId == EditorInfo.IME_ACTION_SEND) {
|
||||||
val cmd = text.toString().trim()
|
val cmd = text.toString().trim()
|
||||||
if (cmd.isNotEmpty()) {
|
if (cmd.isNotEmpty()) {
|
||||||
coroutineScope.launch {
|
coroutineScope.launch {
|
||||||
@@ -554,9 +570,10 @@ fun SshTerminalScreen(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.weight(1f)
|
||||||
.height(0.dp)
|
.fillMaxHeight()
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// ── 终端内容(顶栏 + 输出 + 输入行)──
|
// ── 终端内容(顶栏 + 输出 + 输入行)──
|
||||||
Column(
|
Column(
|
||||||
|
|||||||
Reference in New Issue
Block a user