- 调试输出改为滚动等宽代码块,状态一眼可读 - 新增“复制全部”按钮,一键把原始输出写入剪贴板 - 版本升至 1.7.3
This commit is contained in:
parent
a804d46acd
commit
dcd5cab2b2
@ -16,8 +16,8 @@ android {
|
|||||||
applicationId = "com.rainy.token"
|
applicationId = "com.rainy.token"
|
||||||
minSdk = 31
|
minSdk = 31
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 22
|
versionCode = 23
|
||||||
versionName = "1.7.2"
|
versionName = "1.7.3"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables {
|
vectorDrawables {
|
||||||
|
|||||||
@ -2,7 +2,17 @@ package com.rainy.token.ui.settings
|
|||||||
|
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
|
import android.widget.Toast
|
||||||
|
import android.content.ClipboardManager
|
||||||
|
import android.content.ClipData
|
||||||
|
import android.content.Context
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
|
import androidx.compose.ui.text.font.FontFamily
|
||||||
|
import androidx.compose.ui.draw.clip
|
||||||
|
import androidx.compose.foundation.layout.heightIn
|
||||||
|
import androidx.compose.foundation.verticalScroll
|
||||||
|
import androidx.compose.foundation.rememberScrollState
|
||||||
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
@ -207,6 +217,7 @@ private fun ProxyGatewayCard(
|
|||||||
onTestTrae: () -> Unit,
|
onTestTrae: () -> Unit,
|
||||||
onTestWorkBuddy: () -> Unit
|
onTestWorkBuddy: () -> Unit
|
||||||
) {
|
) {
|
||||||
|
val context = LocalContext.current
|
||||||
Card(
|
Card(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
shape = RoundedCornerShape(20.dp),
|
shape = RoundedCornerShape(20.dp),
|
||||||
@ -257,14 +268,39 @@ private fun ProxyGatewayCard(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (debug != null) {
|
if (debug != null) {
|
||||||
|
Spacer(modifier = Modifier.padding(top = 8.dp))
|
||||||
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
|
Text(
|
||||||
|
text = "原始输出",
|
||||||
|
style = MaterialTheme.typography.labelSmall,
|
||||||
|
color = InkMuted,
|
||||||
|
modifier = Modifier.weight(1f)
|
||||||
|
)
|
||||||
|
TextButton(onClick = {
|
||||||
|
val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||||
|
clipboard.setPrimaryClip(ClipData.newPlainText("代理网关探针输出", debug))
|
||||||
|
Toast.makeText(context, "已复制全部原始输出", Toast.LENGTH_SHORT).show()
|
||||||
|
}) {
|
||||||
|
Text("复制全部")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.heightIn(max = 220.dp)
|
||||||
|
.clip(RoundedCornerShape(12.dp))
|
||||||
|
.background(MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.6f))
|
||||||
|
.verticalScroll(rememberScrollState())
|
||||||
|
.padding(10.dp)
|
||||||
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = debug,
|
text = debug,
|
||||||
style = MaterialTheme.typography.bodySmall,
|
style = MaterialTheme.typography.bodySmall.copy(fontFamily = FontFamily.Monospace),
|
||||||
color = InkMuted,
|
color = InkMuted
|
||||||
modifier = Modifier.padding(top = 4.dp)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Switch(
|
Switch(
|
||||||
checked = running,
|
checked = running,
|
||||||
onCheckedChange = onToggle
|
onCheckedChange = onToggle
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user