Compare commits

...

2 Commits

Author SHA1 Message Date
-
874cd13df5 disallow closing password dialog in start activity 2025-01-05 20:51:53 +01:00
-
d654081cd4 allow to add https nodes 2025-01-05 20:26:20 +01:00
6 changed files with 14 additions and 5 deletions

View File

@ -159,7 +159,7 @@ class SettingsActivity : MoneroActivity() {
}
displaySeedButton.setOnClickListener {
val passwordDialog = PasswordBottomSheetDialog(walletService!!.getWalletOrThrow().info.path, object : PasswordBottomSheetDialog.Listener {
val passwordDialog = PasswordBottomSheetDialog(walletService!!.getWalletOrThrow().info.path, false, object : PasswordBottomSheetDialog.Listener {
override fun onCorrectPasswordSubmitted(self: PasswordBottomSheetDialog, password: String) {
self.dismiss()
displaySeedDialog()

View File

@ -2,6 +2,7 @@ package org.monfluo.wallet
import android.content.Intent
import android.os.Bundle
import androidx.activity.OnBackPressedCallback
import org.monfluo.wallet.fragment.dialog.PasswordBottomSheetDialog
import org.monfluo.wallet.util.Constants
import org.monfluo.wallet.util.Helper
@ -33,7 +34,7 @@ class StartActivity : WalletOpeningActivity() {
} else {
Timber.d("${walletPaths.size} wallets found but multi-wallet mode is not enabled, asking for password to open a wallet")
val walletPath = walletPaths.find { it.endsWith(Constants.DEFAULT_WALLET_NAME) } ?: walletPaths.first()
val passwordDialog = PasswordBottomSheetDialog(walletPath, object : PasswordBottomSheetDialog.Listener {
val passwordDialog = PasswordBottomSheetDialog(walletPath, true, object : PasswordBottomSheetDialog.Listener {
override fun onCorrectPasswordSubmitted(self: PasswordBottomSheetDialog, password: String) {
self.dismiss()
openWallet(walletPath, password)

View File

@ -26,7 +26,7 @@ class WalletActivity : WalletOpeningActivity() {
val walletPaths = org.monfluo.wallet.model.WalletManager.instance.findWallets(Helper.getWalletRoot(this).absolutePath)
adapter = WalletAdapter(walletPaths, object : WalletAdapter.AccountAdapterListener {
override fun onWalletSelected(walletPath: String) {
val passwordDialog = PasswordBottomSheetDialog(walletPath, object : PasswordBottomSheetDialog.Listener {
val passwordDialog = PasswordBottomSheetDialog(walletPath, false, object : PasswordBottomSheetDialog.Listener {
override fun onCorrectPasswordSubmitted(self: PasswordBottomSheetDialog, password: String) {
self.dismiss()
openWallet(walletPath, password)

View File

@ -8,12 +8,15 @@ import android.widget.Button
import android.widget.EditText
import android.widget.ImageButton
import android.widget.Toast
import androidx.activity.OnBackPressedCallback
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import org.monfluo.wallet.R
import org.monfluo.wallet.util.Helper.getClipBoardText
import timber.log.Timber
class PasswordBottomSheetDialog(
private val walletPath: String,
preventGoingBack: Boolean,
private val listener: Listener,
) : BottomSheetDialogFragment() {
@ -21,6 +24,10 @@ class PasswordBottomSheetDialog(
private lateinit var unlockButton: Button
private lateinit var pastePasswordImageButton: ImageButton
init {
isCancelable = !preventGoingBack
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
@ -60,6 +67,7 @@ class PasswordBottomSheetDialog(
walletPassword
)
}
interface Listener {
fun onCorrectPasswordSubmitted(self: PasswordBottomSheetDialog, password: String)
}

View File

@ -60,7 +60,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="@drawable/edittext_bg"
android:digits="QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890.:-[]"
android:digits="QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890.:-[]/"
android:hint="@string/node_address_hint"
android:inputType="text"
app:layout_constraintBottom_toTopOf="@id/trusted_node_checkbox"

View File

@ -60,7 +60,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="@drawable/edittext_bg"
android:digits="QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890.:-[]"
android:digits="QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890.:-[]/"
android:hint="@string/node_address_hint"
android:inputType="text"
app:layout_constraintBottom_toTopOf="@id/trusted_node_checkbox"