-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dashpay): add topup UI and fix UserAlert issues when upgrading (#…
…1296) * refactor: remove extra code and fix context issues with callbacks * feat: add topup ui warning * feat: add balance warning dialogs for contact requests * fix: enable balance checking for credits * fix: fix infinite loop if not wanting to save profile * fix: fix issues with UserAlerts after app upgrade * style: fix formatting
- Loading branch information
1 parent
9c5ef18
commit e547661
Showing
25 changed files
with
523 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="47dp" | ||
android:height="46dp" | ||
android:viewportWidth="47" | ||
android:viewportHeight="46"> | ||
<path | ||
android:pathData="M0.5,23C0.5,10.297 10.797,0 23.5,0C36.202,0 46.5,10.297 46.5,23C46.5,35.702 36.202,46 23.5,46C10.797,46 0.5,35.702 0.5,23Z" | ||
android:fillColor="#FFC043"/> | ||
<path | ||
android:pathData="M15.995,32.536C15.396,32.536 14.875,32.399 14.433,32.126C13.99,31.859 13.645,31.501 13.398,31.052C13.15,30.603 13.026,30.111 13.026,29.577C13.026,29.056 13.16,28.562 13.427,28.093L20.956,14.948C21.229,14.46 21.597,14.092 22.06,13.845C22.522,13.591 23.004,13.464 23.505,13.464C24.006,13.464 24.485,13.588 24.94,13.835C25.396,14.082 25.767,14.453 26.054,14.948L33.573,28.083C33.71,28.324 33.811,28.571 33.876,28.825C33.941,29.073 33.974,29.323 33.974,29.577C33.974,30.111 33.85,30.603 33.603,31.052C33.362,31.501 33.02,31.859 32.577,32.126C32.134,32.399 31.614,32.536 31.015,32.536H15.995ZM23.515,25.544C24.211,25.544 24.579,25.186 24.618,24.47L24.784,20.261C24.797,19.896 24.683,19.6 24.442,19.372C24.201,19.138 23.889,19.021 23.505,19.021C23.114,19.021 22.799,19.134 22.558,19.362C22.323,19.59 22.216,19.886 22.235,20.251L22.392,24.479C22.431,25.189 22.805,25.544 23.515,25.544ZM23.515,29.079C23.905,29.079 24.231,28.965 24.491,28.737C24.758,28.509 24.892,28.21 24.892,27.839C24.892,27.468 24.758,27.168 24.491,26.94C24.231,26.713 23.905,26.599 23.515,26.599C23.124,26.599 22.795,26.713 22.528,26.94C22.261,27.168 22.128,27.468 22.128,27.839C22.128,28.21 22.261,28.509 22.528,28.737C22.802,28.965 23.131,29.079 23.515,29.079Z" | ||
android:fillColor="#ffffff"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package de.schildbach.wallet.data | ||
|
||
import org.bitcoinj.core.Coin | ||
|
||
/* | ||
* Tests in July 2024: Contact Requests cost about 80,000,000 - 90,000,000 | ||
* Profile Updates cost 10,000,000 - 100,000,000 | ||
*/ | ||
data class CreditBalanceInfo( | ||
val balance: Long | ||
) { | ||
companion object { | ||
const val CREDITS_PER_DUFF = 1_000 | ||
const val MAX_OPERATION_COST = 100_000_000.toLong() | ||
val MAX_OPERATION_COST_COIN = MAX_OPERATION_COST / CREDITS_PER_DUFF | ||
const val LOW_BALANCE = MAX_OPERATION_COST * 10 | ||
} | ||
fun isBalanceEnough(): Boolean { | ||
return balance >= MAX_OPERATION_COST | ||
} | ||
|
||
fun isBalanceWarning(): Boolean { | ||
return balance <= LOW_BALANCE | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.