fix bottom sheet overlapping nav buttons

This commit is contained in:
greenart7c3
2023-10-12 10:45:17 -03:00
parent 591287c98d
commit 8137ddf219
4 changed files with 12 additions and 21 deletions
+1
View File
@@ -15,6 +15,7 @@
android:theme="@style/Theme.SignerSplash"
android:usesCleartextTraffic="true"
android:enableOnBackInvokedCallback="true"
android:windowSoftInputMode="adjustResize"
tools:targetApi="33">
<provider
android:name=".SignerProvider"
@@ -8,6 +8,7 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.ui.Modifier
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.core.view.WindowCompat
import androidx.lifecycle.viewmodel.compose.viewModel
import com.greenart7c3.nostrsigner.ui.AccountScreen
import com.greenart7c3.nostrsigner.ui.AccountStateViewModel
@@ -16,6 +17,7 @@ import com.greenart7c3.nostrsigner.ui.theme.NostrSignerTheme
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
WindowCompat.setDecorFitsSystemWindows(window, false)
installSplashScreen()
setContent {
@@ -72,33 +72,18 @@ object AmberUtils {
decryptZapEvent(data, account)
}
SignerType.NIP04_DECRYPT -> {
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(
@@ -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()