diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 63cbe31e..e0da3ee5 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -39,6 +39,7 @@
+
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/EditConfigurationScreen.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/EditConfigurationScreen.kt
index 25312b7d..d9f9ed73 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/EditConfigurationScreen.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/EditConfigurationScreen.kt
@@ -11,10 +11,8 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
-import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.material3.ButtonDefaults
@@ -93,12 +91,18 @@ fun EditConfigurationScreen(
}
if (isLoading.value) {
- CenterCircularProgressIndicator(modifier)
+ CenterCircularProgressIndicator(
+ modifier,
+ if (textFieldRelay.value.text.isNotBlank()) {
+ "Testing relay..."
+ } else {
+ null
+ },
+ )
} else {
Column(
modifier
- .fillMaxSize()
- .verticalScroll(rememberScrollState()),
+ .fillMaxSize(),
) {
Text(stringResource(R.string.edit_configuration_description))
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/EditPermission.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/EditPermission.kt
index 6a9c2fd2..bd44e065 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/EditPermission.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/EditPermission.kt
@@ -12,8 +12,6 @@ import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.rememberScrollState
-import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
@@ -119,8 +117,7 @@ fun EditPermission(
}
Column(
- modifier = modifier
- .verticalScroll(rememberScrollState()),
+ modifier = modifier,
) {
if (!applicationData.isConnected) {
Text(
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/IncomingRequestScreen.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/IncomingRequestScreen.kt
index bf136990..3702742c 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/IncomingRequestScreen.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/IncomingRequestScreen.kt
@@ -1,8 +1,8 @@
package com.greenart7c3.nostrsigner.ui
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.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.size
@@ -38,6 +38,7 @@ import kotlinx.coroutines.launch
@Composable
fun IncomingRequestScreen(
modifier: Modifier,
+ paddingValues: PaddingValues,
intents: List,
packageName: String?,
applicationName: String?,
@@ -69,47 +70,45 @@ fun IncomingRequestScreen(
if (loading) {
CenterCircularProgressIndicator(modifier)
} else {
- Box(
- modifier,
- ) {
- if (intents.isEmpty()) {
- Column(
- Modifier.fillMaxSize(),
- Arrangement.Center,
- Alignment.CenterHorizontally,
- ) {
- Text(
- stringResource(R.string.nothing_to_approve_yet),
- fontWeight = FontWeight.Bold,
- fontSize = 21.sp,
- )
- Spacer(Modifier.size(8.dp))
- Text(
- stringResource(R.string.why_not_explore_your_favorite_nostr_app_a_bit),
- textAlign = TextAlign.Center,
- )
- }
- } else if (intents.size == 1) {
- SingleEventHomeScreen(
- packageName,
- applicationName,
- intents.first(),
- account,
- database,
- onRemoveIntentData,
- ) {
- loading = it
- }
- } else {
- MultiEventHomeScreen(
- intents,
- packageName,
- account,
- navController,
- onRemoveIntentData,
- ) {
- loading = it
- }
+ if (intents.isEmpty()) {
+ Column(
+ modifier.fillMaxSize(),
+ Arrangement.Center,
+ Alignment.CenterHorizontally,
+ ) {
+ Text(
+ stringResource(R.string.nothing_to_approve_yet),
+ fontWeight = FontWeight.Bold,
+ fontSize = 21.sp,
+ )
+ Spacer(Modifier.size(8.dp))
+ Text(
+ stringResource(R.string.why_not_explore_your_favorite_nostr_app_a_bit),
+ textAlign = TextAlign.Center,
+ )
+ }
+ } else if (intents.size == 1) {
+ SingleEventHomeScreen(
+ paddingValues,
+ packageName,
+ applicationName,
+ intents.first(),
+ account,
+ database,
+ onRemoveIntentData,
+ ) {
+ loading = it
+ }
+ } else {
+ MultiEventHomeScreen(
+ paddingValues = paddingValues,
+ intents,
+ packageName,
+ account,
+ navController,
+ onRemoveIntentData,
+ ) {
+ loading = it
}
}
}
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/LanguageScreen.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/LanguageScreen.kt
index f9569caf..583caf1b 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/LanguageScreen.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/LanguageScreen.kt
@@ -5,13 +5,11 @@ import androidx.appcompat.app.AppCompatDelegate
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
-import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.intl.Locale
-import androidx.compose.ui.unit.dp
import androidx.core.os.LocaleListCompat
import com.greenart7c3.nostrsigner.LocalPreferences
import com.greenart7c3.nostrsigner.R
@@ -40,8 +38,7 @@ fun LanguageScreen(
) {
Column {
Box(
- Modifier
- .padding(8.dp),
+ Modifier,
) {
SettingsRow(
R.string.language,
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/LoginScreen.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/LoginScreen.kt
index 6ba61497..11902c36 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/LoginScreen.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/LoginScreen.kt
@@ -147,7 +147,7 @@ fun MainPage(
state.animateScrollToPage(2)
}
},
- text = stringResource(R.string.sign_policy),
+ text = stringResource(R.string.generate_a_new_key),
)
}
}
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/LogsScreen.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/LogsScreen.kt
index efcecdd5..6de18331 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/LogsScreen.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/LogsScreen.kt
@@ -2,6 +2,7 @@ package com.greenart7c3.nostrsigner.ui
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
@@ -31,72 +32,70 @@ import kotlinx.coroutines.launch
@Composable
fun LogsScreen(
+ paddingValues: PaddingValues,
account: Account,
- modifier: Modifier = Modifier,
) {
val scope = rememberCoroutineScope()
- Column(
- modifier = modifier
+ val logsFlow = NostrSigner.getInstance().getDatabase(account.signer.keyPair.pubKey.toNpub()).applicationDao().getLogs()
+ val logs = logsFlow.collectAsStateWithLifecycle(initialValue = emptyList())
+
+ LazyColumn(
+ modifier = Modifier
.fillMaxSize(),
+ contentPadding = paddingValues,
) {
- val logsFlow = NostrSigner.getInstance().getDatabase(account.signer.keyPair.pubKey.toNpub()).applicationDao().getLogs()
- val logs = logsFlow.collectAsStateWithLifecycle(initialValue = emptyList())
-
- LazyColumn(
- Modifier.weight(1f),
- ) {
- items(logs.value) { log ->
- Row(
- modifier = Modifier
- .fillMaxSize()
- .padding(vertical = 4.dp),
- verticalAlignment = Alignment.CenterVertically,
+ item {
+ AmberButton(
+ modifier = Modifier.padding(bottom = 8.dp),
+ onClick = {
+ scope.launch(Dispatchers.IO) {
+ NostrSigner.getInstance().getDatabase(account.signer.keyPair.pubKey.toNpub()).applicationDao().clearLogs()
+ }
+ },
+ text = stringResource(R.string.clear_logs),
+ )
+ }
+ items(logs.value) { log ->
+ Row(
+ modifier = Modifier
+ .fillMaxSize()
+ .padding(vertical = 4.dp),
+ verticalAlignment = Alignment.CenterVertically,
+ ) {
+ Column(
+ verticalArrangement = Arrangement.Center,
) {
- Column(
- verticalArrangement = Arrangement.Center,
- ) {
- Text(
- modifier = Modifier.padding(top = 16.dp),
- text = TimeUtils.formatLongToCustomDateTimeWithSeconds(log.time),
- fontSize = 14.sp,
- maxLines = 1,
- overflow = TextOverflow.Ellipsis,
- )
- Text(
- modifier = Modifier.padding(top = 4.dp),
- text = log.url,
- fontSize = 20.sp,
- maxLines = 1,
- overflow = TextOverflow.Ellipsis,
- )
- Text(
- modifier = Modifier.padding(top = 4.dp),
- text = log.type,
- fontSize = 20.sp,
- )
- Text(
- modifier = Modifier.padding(top = 4.dp, bottom = 16.dp),
- text = log.message,
- fontSize = 20.sp,
- )
+ Text(
+ modifier = Modifier.padding(top = 16.dp),
+ text = TimeUtils.formatLongToCustomDateTimeWithSeconds(log.time),
+ fontSize = 14.sp,
+ maxLines = 1,
+ overflow = TextOverflow.Ellipsis,
+ )
+ Text(
+ modifier = Modifier.padding(top = 4.dp),
+ text = log.url,
+ fontSize = 20.sp,
+ maxLines = 1,
+ overflow = TextOverflow.Ellipsis,
+ )
+ Text(
+ modifier = Modifier.padding(top = 4.dp),
+ text = log.type,
+ fontSize = 20.sp,
+ )
+ Text(
+ modifier = Modifier.padding(top = 4.dp, bottom = 16.dp),
+ text = log.message,
+ fontSize = 20.sp,
+ )
- Spacer(Modifier.weight(1f))
- HorizontalDivider(
- color = MaterialTheme.colorScheme.primary,
- )
- }
+ Spacer(Modifier.weight(1f))
+ HorizontalDivider(
+ color = MaterialTheme.colorScheme.primary,
+ )
}
}
}
-
- AmberButton(
- modifier = Modifier.padding(top = 8.dp),
- onClick = {
- scope.launch(Dispatchers.IO) {
- NostrSigner.getInstance().getDatabase(account.signer.keyPair.pubKey.toNpub()).applicationDao().clearLogs()
- }
- },
- text = stringResource(R.string.clear_logs),
- )
}
}
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/MainScreen.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/MainScreen.kt
index 6a2cbb91..8031fa3d 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/MainScreen.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/MainScreen.kt
@@ -18,14 +18,19 @@ import androidx.compose.foundation.border
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.calculateEndPadding
+import androidx.compose.foundation.layout.calculateStartPadding
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
+import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.outlined.Person
@@ -66,6 +71,7 @@ import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.intl.Locale
import androidx.compose.ui.text.toUpperCase
+import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import androidx.core.content.ContextCompat
import androidx.navigation.NavHostController
@@ -709,6 +715,12 @@ fun MainScreen(
.padding(padding)
.padding(horizontal = verticalPadding)
.padding(top = verticalPadding * 1.5f),
+ paddingValues = PaddingValues(
+ top = padding.calculateTopPadding() + (verticalPadding * 1.5f),
+ bottom = padding.calculateBottomPadding(),
+ start = padding.calculateStartPadding(LayoutDirection.Ltr) + verticalPadding,
+ end = padding.calculateEndPadding(LayoutDirection.Ltr) + verticalPadding,
+ ),
intents,
packageName,
appName,
@@ -726,6 +738,7 @@ fun MainScreen(
PermissionsScreen(
modifier = Modifier
.fillMaxSize()
+ .verticalScroll(rememberScrollState())
.padding(padding)
.padding(horizontal = verticalPadding)
.padding(top = verticalPadding * 1.5f),
@@ -742,6 +755,7 @@ fun MainScreen(
SettingsScreen(
Modifier
.fillMaxSize()
+ .verticalScroll(rememberScrollState())
.padding(padding)
.padding(horizontal = verticalPadding)
.padding(top = verticalPadding * 1.5f),
@@ -758,6 +772,7 @@ fun MainScreen(
AccountBackupScreen(
Modifier
.fillMaxSize()
+ .verticalScroll(rememberScrollState())
.padding(padding)
.padding(horizontal = verticalPadding)
.padding(top = verticalPadding * 1.5f),
@@ -775,6 +790,7 @@ fun MainScreen(
modifier =
Modifier
.fillMaxSize()
+ .verticalScroll(rememberScrollState())
.padding(padding)
.padding(horizontal = verticalPadding)
.padding(top = verticalPadding * 1.5f),
@@ -791,12 +807,12 @@ fun MainScreen(
Route.Logs.route,
content = {
LogsScreen(
- modifier =
- Modifier
- .fillMaxSize()
- .padding(padding)
- .padding(horizontal = verticalPadding)
- .padding(top = verticalPadding * 1.5f),
+ PaddingValues(
+ top = padding.calculateTopPadding() + (verticalPadding * 1.5f),
+ bottom = padding.calculateBottomPadding(),
+ start = padding.calculateStartPadding(LayoutDirection.Ltr) + verticalPadding,
+ end = padding.calculateEndPadding(LayoutDirection.Ltr) + verticalPadding,
+ ),
account = account,
)
},
@@ -810,6 +826,7 @@ fun MainScreen(
modifier =
Modifier
.fillMaxSize()
+ .verticalScroll(rememberScrollState())
.padding(padding)
.padding(horizontal = verticalPadding)
.padding(top = verticalPadding * 1.5f),
@@ -889,6 +906,7 @@ fun MainScreen(
modifier =
Modifier
.fillMaxSize()
+ .verticalScroll(rememberScrollState())
.padding(padding)
.padding(horizontal = verticalPadding)
.padding(top = verticalPadding * 1.5f),
@@ -907,6 +925,7 @@ fun MainScreen(
modifier =
Modifier
.fillMaxSize()
+ .verticalScroll(rememberScrollState())
.padding(padding)
.padding(horizontal = verticalPadding)
.padding(top = verticalPadding * 1.5f),
@@ -926,6 +945,7 @@ fun MainScreen(
modifier =
Modifier
.fillMaxSize()
+ .verticalScroll(rememberScrollState())
.padding(padding)
.padding(horizontal = verticalPadding)
.padding(top = verticalPadding * 1.5f),
@@ -945,6 +965,7 @@ fun MainScreen(
modifier =
Modifier
.fillMaxSize()
+ .verticalScroll(rememberScrollState())
.padding(padding)
.padding(horizontal = verticalPadding)
.padding(top = verticalPadding * 1.5f),
@@ -961,12 +982,12 @@ fun MainScreen(
val localUrl = Base64.getDecoder().decode(url).toString(Charsets.UTF_8)
RelayLogScreen(
url = localUrl,
- modifier =
- Modifier
- .fillMaxSize()
- .padding(padding)
- .padding(horizontal = verticalPadding)
- .padding(top = verticalPadding * 1.5f),
+ paddingValues = PaddingValues(
+ top = padding.calculateTopPadding() + (verticalPadding * 1.5f),
+ bottom = padding.calculateBottomPadding(),
+ start = padding.calculateStartPadding(LayoutDirection.Ltr) + verticalPadding,
+ end = padding.calculateEndPadding(LayoutDirection.Ltr) + verticalPadding,
+ ),
)
}
},
@@ -980,6 +1001,7 @@ fun MainScreen(
EditConfigurationScreen(
modifier = Modifier
.fillMaxSize()
+ .verticalScroll(rememberScrollState())
.padding(padding)
.padding(horizontal = verticalPadding)
.padding(top = verticalPadding * 1.5f),
@@ -1032,6 +1054,7 @@ fun MainScreen(
SeeDetailsScreen(
modifier = Modifier
.fillMaxSize()
+ .verticalScroll(rememberScrollState())
.padding(padding)
.padding(horizontal = verticalPadding)
.padding(top = verticalPadding * 1.5f),
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/PermissionsScreen.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/PermissionsScreen.kt
index 6db3fb4b..c98656db 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/PermissionsScreen.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/PermissionsScreen.kt
@@ -8,8 +8,6 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.lazy.LazyColumn
-import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
@@ -50,55 +48,50 @@ fun PermissionsScreen(
Text(stringResource(R.string.no_permissions_granted))
}
} else {
- LazyColumn(
- Modifier
- .fillMaxSize(),
- ) {
- itemsIndexed(applications.value) { _, applicationWithHistory ->
- Row(
- modifier = Modifier
- .fillMaxSize()
- .padding(vertical = 4.dp)
- .clickable {
- navController.navigate("Permission/${applicationWithHistory.application.key}")
- },
- verticalAlignment = Alignment.CenterVertically,
+ applications.value.forEach { applicationWithHistory ->
+ Row(
+ modifier = Modifier
+ .fillMaxSize()
+ .padding(vertical = 4.dp)
+ .clickable {
+ navController.navigate("Permission/${applicationWithHistory.application.key}")
+ },
+ verticalAlignment = Alignment.CenterVertically,
+ ) {
+ Column(
+ verticalArrangement = Arrangement.Center,
) {
- Column(
- verticalArrangement = Arrangement.Center,
+ Text(
+ modifier = Modifier.padding(top = 16.dp),
+ text = applicationWithHistory.application.name.ifBlank { applicationWithHistory.application.key.toShortenHex() },
+ fontSize = 24.sp,
+ maxLines = 1,
+ overflow = TextOverflow.Ellipsis,
+ )
+ Row(
+ modifier = Modifier.fillMaxWidth(),
+ horizontalArrangement = Arrangement.SpaceBetween,
) {
Text(
- modifier = Modifier.padding(top = 16.dp),
- text = applicationWithHistory.application.name.ifBlank { applicationWithHistory.application.key.toShortenHex() },
- fontSize = 24.sp,
+ modifier = Modifier.padding(top = 4.dp, bottom = 16.dp),
+ text = applicationWithHistory.application.key.toShortenHex(),
+ fontSize = 16.sp,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
- Row(
- modifier = Modifier.fillMaxWidth(),
- horizontalArrangement = Arrangement.SpaceBetween,
- ) {
- Text(
- modifier = Modifier.padding(top = 4.dp, bottom = 16.dp),
- text = applicationWithHistory.application.key.toShortenHex(),
- fontSize = 16.sp,
- maxLines = 1,
- overflow = TextOverflow.Ellipsis,
- )
- Text(
- modifier = Modifier.padding(top = 4.dp, bottom = 16.dp),
- text = if (applicationWithHistory.latestTime == null) stringResource(R.string.never) else TimeUtils.formatLongToCustomDateTime(applicationWithHistory.latestTime * 1000),
- fontSize = 16.sp,
- maxLines = 1,
- overflow = TextOverflow.Ellipsis,
- )
- }
-
- Spacer(Modifier.weight(1f))
- HorizontalDivider(
- color = MaterialTheme.colorScheme.primary,
+ Text(
+ modifier = Modifier.padding(top = 4.dp, bottom = 16.dp),
+ text = if (applicationWithHistory.latestTime == null) stringResource(R.string.never) else TimeUtils.formatLongToCustomDateTime(applicationWithHistory.latestTime * 1000),
+ fontSize = 16.sp,
+ maxLines = 1,
+ overflow = TextOverflow.Ellipsis,
)
}
+
+ Spacer(Modifier.weight(1f))
+ HorizontalDivider(
+ color = MaterialTheme.colorScheme.primary,
+ )
}
}
}
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/SeeDetailsScreen.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/SeeDetailsScreen.kt
index df044e0d..e74ebc80 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/SeeDetailsScreen.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/SeeDetailsScreen.kt
@@ -8,8 +8,6 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.rememberScrollState
-import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.Checkbox
@@ -44,8 +42,7 @@ fun SeeDetailsScreen(
val context = LocalContext.current
Column(
modifier = modifier
- .fillMaxWidth()
- .verticalScroll(rememberScrollState()),
+ .fillMaxWidth(),
) {
var rememberMyChoice by remember { mutableStateOf(MultiEventScreenIntents.intents.first().rememberMyChoice.value) }
val first = MultiEventScreenIntents.intents.first()
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/SettingsScreen.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/SettingsScreen.kt
index 9f355f16..e745a922 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/SettingsScreen.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/SettingsScreen.kt
@@ -10,8 +10,6 @@ import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.windowInsetsPadding
-import androidx.compose.foundation.rememberScrollState
-import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Draw
import androidx.compose.material.icons.filled.FilterList
@@ -95,8 +93,7 @@ fun SettingsScreen(
}
Column(
- modifier
- .verticalScroll(rememberScrollState()),
+ modifier,
) {
Box(
Modifier
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/AccountBackupDialog.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/AccountBackupDialog.kt
index 023b0fd3..0d3b7494 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/AccountBackupDialog.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/AccountBackupDialog.kt
@@ -15,9 +15,7 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.KeyboardOptions
-import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Visibility
import androidx.compose.material.icons.outlined.VisibilityOff
@@ -128,9 +126,6 @@ fun AccountBackupScreen(
.fillMaxSize(),
) {
Column(
- modifier =
- Modifier
- .verticalScroll(rememberScrollState()),
horizontalAlignment = Alignment.CenterHorizontally,
) {
val content = stringResource(R.string.account_backup_tips_md)
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/ActivityScreen.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/ActivityScreen.kt
index 45cedea9..33db8d83 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/ActivityScreen.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/ActivityScreen.kt
@@ -5,11 +5,9 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
-import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Check
import androidx.compose.material.icons.filled.Close
@@ -80,58 +78,51 @@ fun ActivityScreen(
)
}
- LazyColumn(
- Modifier
- .fillMaxHeight()
- .fillMaxWidth(),
- ) {
- items(activities.size) {
- val activity = activities[it]
- val permission =
- Permission(
- activity.type.toLowerCase(Locale.current),
- activity.kind,
- )
- Column {
- Row(
- modifier = Modifier
- .fillMaxSize()
- .padding(vertical = 4.dp),
- verticalAlignment = Alignment.CenterVertically,
+ activities.forEach { activity ->
+ val permission =
+ Permission(
+ activity.type.toLowerCase(Locale.current),
+ activity.kind,
+ )
+ Column {
+ Row(
+ modifier = Modifier
+ .fillMaxSize()
+ .padding(vertical = 4.dp),
+ verticalAlignment = Alignment.CenterVertically,
+ ) {
+ Column(
+ modifier = Modifier.fillMaxWidth(0.9f),
+ verticalArrangement = Arrangement.Center,
) {
- Column(
- modifier = Modifier.fillMaxWidth(0.9f),
- verticalArrangement = Arrangement.Center,
- ) {
- Text(
- modifier = Modifier.padding(top = 16.dp),
- text = if (permission.type == "connect") stringResource(R.string.connect) else permission.toLocalizedString(context),
- maxLines = 1,
- overflow = TextOverflow.Ellipsis,
- color = if (activity.accepted) Color.Unspecified else Color.Gray,
- )
+ Text(
+ modifier = Modifier.padding(top = 16.dp),
+ text = if (permission.type == "connect") stringResource(R.string.connect) else permission.toLocalizedString(context),
+ maxLines = 1,
+ overflow = TextOverflow.Ellipsis,
+ color = if (activity.accepted) Color.Unspecified else Color.Gray,
+ )
- Text(
- modifier = Modifier.padding(top = 4.dp, bottom = 16.dp),
- text = TimeUtils.formatLongToCustomDateTimeWithSeconds(activity.time * 1000),
- fontSize = 16.sp,
- maxLines = 1,
- overflow = TextOverflow.Ellipsis,
- color = Color.Gray,
- )
- }
- Icon(
- if (activity.accepted) Icons.Default.Check else Icons.Default.Close,
- contentDescription = if (activity.accepted) stringResource(R.string.accepted) else stringResource(R.string.rejected),
- tint = if (activity.accepted) Color(0xFF1D8802) else Color(0xFFFF6B00),
- modifier = Modifier.padding(start = 10.dp, top = 4.dp, bottom = 16.dp),
+ Text(
+ modifier = Modifier.padding(top = 4.dp, bottom = 16.dp),
+ text = TimeUtils.formatLongToCustomDateTimeWithSeconds(activity.time * 1000),
+ fontSize = 16.sp,
+ maxLines = 1,
+ overflow = TextOverflow.Ellipsis,
+ color = Color.Gray,
)
}
- Spacer(Modifier.weight(1f))
- HorizontalDivider(
- color = MaterialTheme.colorScheme.primary,
+ Icon(
+ if (activity.accepted) Icons.Default.Check else Icons.Default.Close,
+ contentDescription = if (activity.accepted) stringResource(R.string.accepted) else stringResource(R.string.rejected),
+ tint = if (activity.accepted) Color(0xFF1D8802) else Color(0xFFFF6B00),
+ modifier = Modifier.padding(start = 10.dp, top = 4.dp, bottom = 16.dp),
)
}
+ Spacer(Modifier.weight(1f))
+ HorizontalDivider(
+ color = MaterialTheme.colorScheme.primary,
+ )
}
}
}
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/EditRelaysDialog.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/EditRelaysDialog.kt
index 8d4f1264..363f7e25 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/EditRelaysDialog.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/EditRelaysDialog.kt
@@ -5,9 +5,9 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
-import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
@@ -443,7 +443,7 @@ suspend fun onAddRelay(
@Composable
fun RelayLogScreen(
- modifier: Modifier,
+ paddingValues: PaddingValues,
url: String,
) {
val context = LocalContext.current
@@ -455,7 +455,8 @@ fun RelayLogScreen(
val logs = flows.collectAsStateWithLifecycle(initialValue = emptyList())
LazyColumn(
- modifier.fillMaxSize(),
+ Modifier.fillMaxSize(),
+ contentPadding = paddingValues,
) {
itemsIndexed(logs.value) { _, log ->
Row(
@@ -511,67 +512,55 @@ fun ActiveRelaysScreen(
}
}
- Surface(
+ Column(
modifier = modifier
.fillMaxSize(),
) {
- Column(
- modifier = Modifier
- .background(MaterialTheme.colorScheme.background)
- .fillMaxSize(),
- ) {
- LazyColumn(
- Modifier
- .fillMaxHeight(0.9f)
- .fillMaxWidth(),
+ relays2.forEach { relay ->
+ Row(
+ modifier = Modifier
+ .fillMaxSize()
+ .padding(vertical = 4.dp)
+ .clickable {
+ navController.navigate(
+ "RelayLogScreen/${
+ Base64
+ .getEncoder()
+ .encodeToString(relay.url.toByteArray())
+ }",
+ )
+ },
+ verticalAlignment = Alignment.CenterVertically,
) {
- items(relays2.size) {
+ Column(
+ verticalArrangement = Arrangement.Center,
+ ) {
+ Text(
+ modifier = Modifier.padding(top = 16.dp),
+ text = relay.url,
+ fontSize = 24.sp,
+ maxLines = 1,
+ overflow = TextOverflow.Ellipsis,
+ color = if (RelayPool.getRelay(relay.url)?.isConnected() == true) Color.Unspecified else Color.Gray,
+ )
Row(
- modifier = Modifier
- .fillMaxSize()
- .padding(vertical = 4.dp)
- .clickable {
- navController.navigate(
- "RelayLogScreen/${
- Base64
- .getEncoder()
- .encodeToString(relays2[it].url.toByteArray())
- }",
- )
- },
- verticalAlignment = Alignment.CenterVertically,
+ modifier = Modifier.fillMaxWidth(),
+ horizontalArrangement = Arrangement.SpaceBetween,
) {
- Column(
- verticalArrangement = Arrangement.Center,
- ) {
- Text(
- modifier = Modifier.padding(top = 16.dp),
- text = relays2[it].url,
- fontSize = 24.sp,
- maxLines = 1,
- overflow = TextOverflow.Ellipsis,
- color = if (RelayPool.getRelay(relays2[it].url)?.isConnected() == true) Color.Unspecified else Color.Gray,
- )
- Row(
- modifier = Modifier.fillMaxWidth(),
- horizontalArrangement = Arrangement.SpaceBetween,
- ) {
- Text(
- modifier = Modifier.padding(top = 4.dp, bottom = 16.dp),
- text = if (RelayPool.getRelay(relays2[it].url)?.isConnected() == true) "${RelayStats.get(relays2[it].url).pingInMs}ms ping" else "Unavailable",
- fontSize = 16.sp,
- maxLines = 1,
- overflow = TextOverflow.Ellipsis,
- color = if (RelayPool.getRelay(relays2[it].url)?.isConnected() == true) Color.Unspecified else Color.Gray,
- )
- }
-
- Spacer(Modifier.weight(1f))
- HorizontalDivider(
- color = MaterialTheme.colorScheme.primary,
- )
- }
+ Text(
+ modifier = Modifier.padding(top = 4.dp, bottom = 16.dp),
+ text = if (RelayPool.getRelay(relay.url)?.isConnected() == true) "${RelayStats.get(relay.url).pingInMs}ms ping" else "Unavailable",
+ fontSize = 16.sp,
+ maxLines = 1,
+ overflow = TextOverflow.Ellipsis,
+ color = if (RelayPool.getRelay(relay.url)?.isConnected() == true) Color.Unspecified else Color.Gray,
+ )
}
+
+ Spacer(Modifier.weight(1f))
+ HorizontalDivider(
+ color = MaterialTheme.colorScheme.primary,
+ )
}
}
}
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/EncryptDecryptData.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/EncryptDecryptData.kt
index e7d2e8ec..87149f4a 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/EncryptDecryptData.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/EncryptDecryptData.kt
@@ -2,11 +2,15 @@ package com.greenart7c3.nostrsigner.ui.components
import android.widget.Toast
import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Card
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@@ -34,6 +38,7 @@ import kotlinx.coroutines.launch
@Composable
fun EncryptDecryptData(
+ paddingValues: PaddingValues,
content: String,
encryptedData: String,
shouldRunOnAccept: Boolean?,
@@ -55,7 +60,8 @@ fun EncryptDecryptData(
Column(
Modifier
.fillMaxSize()
- .padding(8.dp),
+ .verticalScroll(rememberScrollState())
+ .padding(paddingValues),
) {
val message =
when (type) {
@@ -121,7 +127,7 @@ fun EncryptDecryptData(
RawJson(
content,
encryptedData,
- Modifier.weight(1f),
+ Modifier.height(200.dp),
stringResource(R.string.encrypted_decrypted_data),
type,
) {
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/EventData.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/EventData.kt
index 697440ea..627391fa 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/EventData.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/EventData.kt
@@ -1,11 +1,15 @@
package com.greenart7c3.nostrsigner.ui.components
import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Card
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@@ -32,6 +36,7 @@ import com.vitorpamplona.quartz.events.Event
@Composable
fun EventData(
+ paddingValues: PaddingValues,
shouldAcceptOrReject: Boolean?,
remember: MutableState,
packageName: String?,
@@ -51,7 +56,8 @@ fun EventData(
Column(
Modifier
.fillMaxSize()
- .padding(8.dp),
+ .verticalScroll(rememberScrollState())
+ .padding(paddingValues),
) {
val permission = Permission("sign_event", event.kind)
val text = stringResource(R.string.wants_you_to_sign_a, permission.toLocalizedString(context))
@@ -106,7 +112,7 @@ fun EventData(
if (!showMore) stringResource(R.string.show_details) else stringResource(R.string.hide_details),
)
if (showMore) {
- RawJson(rawJson, "", Modifier.weight(1f), type = type)
+ RawJson(rawJson, "", Modifier.height(200.dp), type = type)
} else {
Spacer(modifier = Modifier.weight(1f))
}
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/LoginWithPubKey.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/LoginWithPubKey.kt
index 5ccdc411..45bf4cc8 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/LoginWithPubKey.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/LoginWithPubKey.kt
@@ -5,6 +5,7 @@ import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
@@ -49,6 +50,7 @@ import com.greenart7c3.nostrsigner.models.Permission
@Composable
fun LoginWithPubKey(
+ paddingValues: PaddingValues,
remember: MutableState,
isBunkerRequest: Boolean,
account: Account,
@@ -71,7 +73,8 @@ fun LoginWithPubKey(
Column(
Modifier
.fillMaxSize()
- .verticalScroll(rememberScrollState()),
+ .verticalScroll(rememberScrollState())
+ .padding(paddingValues),
) {
packageName?.let {
Text(
@@ -140,7 +143,8 @@ fun LoginWithPubKey(
Column(
Modifier
.fillMaxSize()
- .verticalScroll(rememberScrollState()),
+ .verticalScroll(rememberScrollState())
+ .padding(paddingValues),
) {
packageName?.let {
Text(
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/MultiEventHomeScreen.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/MultiEventHomeScreen.kt
index 105702a9..6eda2093 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/MultiEventHomeScreen.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/MultiEventHomeScreen.kt
@@ -9,8 +9,8 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
-import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
@@ -78,6 +78,7 @@ import kotlinx.coroutines.launch
@Composable
fun MultiEventHomeScreen(
+ paddingValues: PaddingValues,
intents: List,
packageName: String?,
accountParam: Account,
@@ -115,8 +116,8 @@ fun MultiEventHomeScreen(
Column(
Modifier
- .fillMaxSize()
- .verticalScroll(rememberScrollState()),
+ .verticalScroll(rememberScrollState())
+ .padding(paddingValues),
) {
Text(
stringResource(R.string.is_requiring_some_permissions_please_review_them, appName),
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/SignMessage.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/SignMessage.kt
index 7f92bbd4..1fb92fc5 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/SignMessage.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/SignMessage.kt
@@ -2,11 +2,15 @@ package com.greenart7c3.nostrsigner.ui.components
import android.widget.Toast
import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Card
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@@ -34,6 +38,7 @@ import kotlinx.coroutines.launch
@Composable
fun SignMessage(
+ paddingValues: PaddingValues,
content: String,
shouldRunOnAccept: Boolean?,
remember: MutableState,
@@ -54,7 +59,8 @@ fun SignMessage(
Column(
Modifier
.fillMaxSize()
- .padding(8.dp),
+ .verticalScroll(rememberScrollState())
+ .padding(paddingValues),
) {
val message = stringResource(R.string.sign_message)
@@ -112,7 +118,7 @@ fun SignMessage(
RawJson(
content,
"",
- Modifier.weight(1f),
+ Modifier.height(200.dp),
stringResource(R.string.content),
type,
) {
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/SingleEventHomeScreen.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/SingleEventHomeScreen.kt
index d624cde8..f94ad10c 100644
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/SingleEventHomeScreen.kt
+++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/SingleEventHomeScreen.kt
@@ -3,6 +3,7 @@ package com.greenart7c3.nostrsigner.ui.components
import android.widget.Toast
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.size
@@ -48,6 +49,7 @@ import kotlinx.coroutines.launch
@Composable
fun SingleEventHomeScreen(
+ paddingValues: PaddingValues,
packageName: String?,
applicationName: String?,
intentData: IntentData,
@@ -95,6 +97,7 @@ fun SingleEventHomeScreen(
}
LoginWithPubKey(
+ paddingValues,
remember,
intentData.bunkerRequest != null && intentData.type == SignerType.GET_PUBLIC_KEY,
account,
@@ -180,6 +183,7 @@ fun SingleEventHomeScreen(
packageName
}
SignMessage(
+ paddingValues,
intentData.data,
permission?.acceptable,
remember,
@@ -211,6 +215,8 @@ fun SingleEventHomeScreen(
{
coroutineScope.launch(Dispatchers.IO) {
if (key == "null") {
+ context.getAppCompatActivity()?.intent = null
+ context.getAppCompatActivity()?.finish()
return@launch
}
@@ -314,6 +320,7 @@ fun SingleEventHomeScreen(
packageName
}
EncryptDecryptData(
+ paddingValues,
intentData.data,
intentData.encryptedData ?: "",
permission?.acceptable,
@@ -462,6 +469,7 @@ fun SingleEventHomeScreen(
packageName
}
EventData(
+ paddingValues,
permission?.acceptable,
remember,
localPackageName,
diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/previews/EventDataPreview.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/previews/EventDataPreview.kt
deleted file mode 100644
index 2f534a6a..00000000
--- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/previews/EventDataPreview.kt
+++ /dev/null
@@ -1,55 +0,0 @@
-package com.greenart7c3.nostrsigner.ui.previews
-
-import android.annotation.SuppressLint
-import androidx.compose.foundation.layout.Box
-import androidx.compose.foundation.layout.padding
-import androidx.compose.material3.Scaffold
-import androidx.compose.runtime.Composable
-import androidx.compose.runtime.mutableStateOf
-import androidx.compose.runtime.remember
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.tooling.preview.Preview
-import com.greenart7c3.nostrsigner.models.SignerType
-import com.greenart7c3.nostrsigner.models.TimeUtils
-import com.greenart7c3.nostrsigner.ui.components.EventData
-import com.greenart7c3.nostrsigner.ui.theme.NostrSignerTheme
-import com.vitorpamplona.quartz.events.Event
-
-@SuppressLint("UnusedMaterialScaffoldPaddingParameter")
-@Preview(device = "id:Nexus S")
-@Composable
-fun EventDataPreview() {
- val event =
- Event(
- "123",
- "7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19",
- TimeUtils.now(),
- 1,
- arrayOf(),
- "This is a test 123 123 123 123 123 123",
- "",
- )
- val data = event.toJson()
- val remember = remember { mutableStateOf(false) }
-
- NostrSignerTheme(darkTheme = true) {
- Scaffold {
- Box(
- Modifier.padding(it),
- ) {
- EventData(
- false,
- remember,
- null,
- "App",
- null,
- event,
- data,
- SignerType.SIGN_EVENT,
- { },
- { },
- )
- }
- }
- }
-}