mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-08 23:54:39 +00:00
feat: rename See more/less to Show/Hide Event and make JSON scrollable
The raw event JSON toggle in the signer consent dialog is now labeled "Show Event" / "Hide Event" instead of the generic "See more" / "See less". The expanded JSON block also gains horizontal scroll (softWrap=false + horizontalScroll) so wide event JSON doesn't get clipped on narrow screens. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013hTFpoExYYLYEGGtXBx6ZT
This commit is contained in:
+16
-11
@@ -23,7 +23,9 @@ package com.vitorpamplona.amethyst.napplet
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
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.PaddingValues
|
||||
import androidx.compose.foundation.layout.Row
|
||||
@@ -194,15 +196,18 @@ private fun NappletSignerConsentDialog(
|
||||
if (info.rawData.isNotBlank()) {
|
||||
if (showRawData) {
|
||||
Spacer(Modifier.height(8.dp))
|
||||
SelectionContainer {
|
||||
Text(
|
||||
info.rawData,
|
||||
style =
|
||||
MaterialTheme.typography.labelSmall.copy(
|
||||
fontFamily = FontFamily.Monospace,
|
||||
),
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
Box(modifier = Modifier.horizontalScroll(rememberScrollState())) {
|
||||
SelectionContainer {
|
||||
Text(
|
||||
info.rawData,
|
||||
style =
|
||||
MaterialTheme.typography.labelSmall.copy(
|
||||
fontFamily = FontFamily.Monospace,
|
||||
),
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
softWrap = false,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
TextButton(
|
||||
@@ -211,9 +216,9 @@ private fun NappletSignerConsentDialog(
|
||||
) {
|
||||
Text(
|
||||
if (showRawData) {
|
||||
stringResource(R.string.napplet_consent_see_less)
|
||||
stringResource(R.string.napplet_consent_hide_event)
|
||||
} else {
|
||||
stringResource(R.string.napplet_consent_see_more)
|
||||
stringResource(R.string.napplet_consent_show_event)
|
||||
},
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
)
|
||||
|
||||
@@ -769,8 +769,8 @@
|
||||
|
||||
<!-- Signer per-op consent dialog -->
|
||||
<string name="napplet_consent_wants_to">wants to %1$s</string>
|
||||
<string name="napplet_consent_see_more">See more</string>
|
||||
<string name="napplet_consent_see_less">See less</string>
|
||||
<string name="napplet_consent_show_event">Show Event</string>
|
||||
<string name="napplet_consent_hide_event">Hide Event</string>
|
||||
<string name="napplet_consent_more_options">More options</string>
|
||||
<string name="napplet_consent_fewer_options">Fewer options</string>
|
||||
<string name="napplet_signer_allow_once">Allow once</string>
|
||||
|
||||
Reference in New Issue
Block a user