Skip to content

Commit

Permalink
Android: Refactored the selection of a newly-created wallet into a me…
Browse files Browse the repository at this point in the history
…thod; updated the way default progress and max values are set for multisig sliders.
  • Loading branch information
Aldin-SXR committed Jun 11, 2021
1 parent 62feea1 commit ef287d7
Showing 1 changed file with 11 additions and 9 deletions.
Expand Up @@ -259,17 +259,19 @@ abstract class NewWalletDialog2 : TaskLauncherDialog<String>() {
getString(R.string.Add_cosigner) + " " +
getString(R.string.__d_of, nextCosigner, numCosigners))
} else { // last cosigner done; finalize wallet
closeDialogs(targetFragment!!)
daemonModel.commands.callAttr("select_wallet", result)
(activity as MainActivity).updateDrawer()
selectWallet(targetFragment!!, result)
}
} else {
// In a standard wallet, close the dialogs and open the newly created wallet.
closeDialogs(targetFragment!!)
daemonModel.commands.callAttr("select_wallet", result)
(activity as MainActivity).updateDrawer()
selectWallet(targetFragment!!, result)
}
}

private fun selectWallet(targetFragment: Fragment, name: String) {
closeDialogs(targetFragment)
daemonModel.commands.callAttr("select_wallet", name)
(activity as MainActivity).updateDrawer()
}
}


Expand Down Expand Up @@ -484,8 +486,8 @@ class CosignerDialog : AlertDialogFragment() {
}

with (sbSignatures) {
progress = numCosigners
max = SIGNATURE_OFFSET
progress = numCosigners - SIGNATURE_OFFSET
max = numCosigners - SIGNATURE_OFFSET
}
}

Expand Down Expand Up @@ -541,7 +543,7 @@ class CosignerDialog : AlertDialogFragment() {
private fun updateUi() {
tvCosigners.text = getString(R.string.from_cosigners, numCosigners)
tvSignatures.text = getString(R.string.require_signatures, numSignatures)
sbSignatures.max = numCosigners - 1
sbSignatures.max = numCosigners - SIGNATURE_OFFSET
}
}

Expand Down

0 comments on commit ef287d7

Please sign in to comment.