mirror of
https://codeberg.org/anoncontributorxmr/mysu.git
synced 2025-01-17 14:46:32 -07:00
Compare commits
2 Commits
8629c02a72
...
874cd13df5
Author | SHA1 | Date | |
---|---|---|---|
|
874cd13df5 | ||
|
d654081cd4 |
@ -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()
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user