From 8137ddf219128ba246ffdbf4a16c273273c05191 Mon Sep 17 00:00:00 2001 From: greenart7c3 Date: Thu, 12 Oct 2023 10:45:17 -0300 Subject: [PATCH] fix bottom sheet overlapping nav buttons --- app/src/main/AndroidManifest.xml | 1 + .../greenart7c3/nostrsigner/MainActivity.kt | 2 ++ .../nostrsigner/service/AmberUtils.kt | 27 +++++-------------- .../ui/actions/AccountsBottomSheet.kt | 3 +++ 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 0028b6cd..c89b29d2 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,6 +15,7 @@ android:theme="@style/Theme.SignerSplash" android:usesCleartextTraffic="true" android:enableOnBackInvokedCallback="true" + android:windowSoftInputMode="adjustResize" tools:targetApi="33"> { - val decryptedContent = CryptoUtils.decryptNIP04( + CryptoUtils.decryptNIP04( data, account.keyPair.privKey, Hex.decode(pubKey) ) - decryptedContent } SignerType.NIP04_ENCRYPT -> { - if (data.contains("?iv=", ignoreCase = true)) { - null - } else { - val encryptedContent = CryptoUtils.encryptNIP04( - data, - account.keyPair.privKey, - Hex.decode(pubKey) - ) - val decryptedContent = CryptoUtils.decryptNIP04( - encryptedContent, - account.keyPair.privKey, - Hex.decode(pubKey) - ) - if (decryptedContent != data) { - throw Exception("Error encrypting content") - } else { - encryptedContent - } - } + CryptoUtils.encryptNIP04( + data, + account.keyPair.privKey, + Hex.decode(pubKey) + ) } SignerType.NIP44_ENCRYPT -> { val sharedSecret = CryptoUtils.getSharedSecretNIP44( diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/AccountsBottomSheet.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/AccountsBottomSheet.kt index 23a173df..41128c59 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/AccountsBottomSheet.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/AccountsBottomSheet.kt @@ -6,8 +6,10 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.navigationBars import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width import androidx.compose.foundation.rememberScrollState @@ -60,6 +62,7 @@ fun AccountsBottomSheet( onClose: () -> Unit ) { ModalBottomSheet( + windowInsets = WindowInsets.navigationBars, sheetState = sheetState, onDismissRequest = { onClose()