-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dashpay): finish topup feature (ui, backend) (#1338)
* refactor: move BaseWorker * feat: add BaseForegroundWorker * feat: add RestoreIdentityWorker * feat: topup backend * feat: topup ui * feat: topup during username request, if necessary * chore: remove unused imports * fix: hide Buy Credits if there is no username * chore: cleanup some constructors, etc * fix: align ui elements and icons * feat: add topup database table * fix: make topup more similar to send tx flow * fix: for topups, show Send to: OP RETURN * fix: improve tx details for topups * fix: improve topup functionality * fix: add isAssetLock to SendCoinViewModel * fix: don't automatically put topup memo * fix: improve tracking of topUp status * fix: remove checkbox on topup confirm * fix: remove use correct amount on Confirm Username Request Dialog * fix: remove the preposition on for Buy Credits fragment
- Loading branch information
1 parent
45d9743
commit dd8dd7b
Showing
68 changed files
with
3,453 additions
and
343 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="73dp" | ||
android:height="2dp" | ||
android:viewportWidth="73" | ||
android:viewportHeight="2"> | ||
<path | ||
android:pathData="M1.5,0L71.5,0A1,1 0,0 1,72.5 1L72.5,1A1,1 0,0 1,71.5 2L1.5,2A1,1 0,0 1,0.5 1L0.5,1A1,1 0,0 1,1.5 0z" | ||
android:fillColor="#191C1F"/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="22dp" | ||
android:height="22dp" | ||
android:viewportWidth="22" | ||
android:viewportHeight="22"> | ||
<path | ||
android:pathData="M10.277,22C6.5,22 3.882,21.105 2.424,19.316C0.933,17.527 0.536,14.777 1.198,11C1.861,7.289 3.22,4.506 5.34,2.717C7.461,0.928 10.376,0 14.153,0H21.111L20.283,4.572H14.451C13.259,4.572 12.232,4.705 11.37,4.904C10.509,5.136 9.78,5.5 9.183,5.997C8.587,6.527 8.09,7.19 7.726,7.985C7.361,8.813 7.096,9.807 6.897,11C6.698,12.193 6.632,13.22 6.698,14.015C6.765,14.843 7.03,15.506 7.427,16.003C7.825,16.533 8.421,16.898 9.217,17.096C10.012,17.328 11.006,17.428 12.198,17.428H18.162L17.367,22H10.277Z" | ||
android:fillColor="#008DE4"/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="15dp" | ||
android:height="16dp" | ||
android:viewportWidth="15" | ||
android:viewportHeight="16"> | ||
<path | ||
android:pathData="M7.496,15.5C6.471,15.5 5.506,15.304 4.601,14.912C3.696,14.525 2.898,13.985 2.206,13.293C1.519,12.601 0.98,11.802 0.588,10.897C0.196,9.992 0,9.026 0,8C0,6.974 0.196,6.008 0.588,5.103C0.98,4.198 1.519,3.402 2.206,2.714C2.898,2.022 3.694,1.48 4.594,1.088C5.498,0.696 6.463,0.5 7.489,0.5C8.52,0.5 9.487,0.696 10.392,1.088C11.297,1.48 12.095,2.022 12.787,2.714C13.479,3.402 14.02,4.198 14.412,5.103C14.804,6.008 15,6.974 15,8C15,9.026 14.804,9.992 14.412,10.897C14.02,11.802 13.479,12.601 12.787,13.293C12.095,13.985 11.297,14.525 10.392,14.912C9.487,15.304 8.522,15.5 7.496,15.5ZM6.168,12.175H9.224C9.398,12.175 9.543,12.122 9.659,12.015C9.775,11.904 9.833,11.761 9.833,11.587C9.833,11.422 9.775,11.284 9.659,11.173C9.543,11.057 9.398,10.998 9.224,10.998H8.389V7.441C8.389,7.213 8.333,7.03 8.222,6.889C8.111,6.749 7.949,6.679 7.736,6.679H6.299C6.13,6.679 5.987,6.737 5.871,6.853C5.755,6.969 5.697,7.107 5.697,7.267C5.697,7.441 5.755,7.584 5.871,7.695C5.987,7.802 6.13,7.855 6.299,7.855H7.061V10.998H6.168C5.999,10.998 5.854,11.057 5.733,11.173C5.617,11.284 5.559,11.422 5.559,11.587C5.559,11.761 5.617,11.904 5.733,12.015C5.854,12.122 5.999,12.175 6.168,12.175ZM7.453,5.51C7.743,5.51 7.987,5.408 8.186,5.205C8.384,5.001 8.483,4.759 8.483,4.479C8.483,4.183 8.384,3.937 8.186,3.738C7.987,3.535 7.743,3.433 7.453,3.433C7.167,3.433 6.923,3.535 6.72,3.738C6.517,3.937 6.415,4.183 6.415,4.479C6.415,4.759 6.517,5.001 6.72,5.205C6.923,5.408 7.167,5.51 7.453,5.51Z" | ||
android:fillColor="#B0B6BC"/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="20dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="20"> | ||
<path | ||
android:pathData="M12.021,11.118C12.456,11.118 12.906,10.886 13.369,10.423L22.684,1.171C22.271,0.801 21.54,0.615 20.492,0.615H3.241C2.321,0.615 1.676,0.786 1.305,1.129L10.674,10.423C11.13,10.886 11.579,11.118 12.021,11.118ZM0.289,17.578L7.968,9.963L0.299,2.401C0.1,2.744 0,3.303 0,4.08V15.909C0,16.687 0.096,17.243 0.289,17.578ZM3.508,19.385H20.759C21.693,19.385 22.353,19.204 22.738,18.84L14.92,11.075L14.257,11.749C13.529,12.448 12.784,12.797 12.021,12.797C11.251,12.797 10.503,12.448 9.775,11.749L9.112,11.086L1.305,18.84C1.74,19.204 2.474,19.385 3.508,19.385ZM23.722,17.567C23.907,17.225 24,16.672 24,15.909V4.08C24,3.31 23.904,2.758 23.711,2.423L16.064,9.963L23.722,17.567Z" | ||
android:fillColor="#008DE4"/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="22dp" | ||
android:height="22dp" | ||
android:viewportWidth="22" | ||
android:viewportHeight="22"> | ||
<path | ||
android:pathData="M2.908,22H19.092C19.773,22 20.309,21.846 20.698,21.538C21.087,21.237 21.282,20.816 21.282,20.272C21.282,19.501 21.043,18.682 20.564,17.814C20.086,16.946 19.396,16.139 18.496,15.393C17.603,14.638 16.524,14.026 15.259,13.555C13.993,13.077 12.57,12.837 10.988,12.837C9.414,12.837 7.994,13.077 6.729,13.555C5.463,14.026 4.381,14.638 3.48,15.393C2.588,16.139 1.902,16.946 1.424,17.814C0.953,18.682 0.718,19.501 0.718,20.272C0.718,20.816 0.913,21.237 1.302,21.538C1.691,21.846 2.227,22 2.908,22ZM11,10.684C11.884,10.684 12.7,10.444 13.446,9.966C14.192,9.487 14.788,8.842 15.234,8.031C15.689,7.212 15.916,6.291 15.916,5.269C15.916,4.279 15.689,3.387 15.234,2.592C14.788,1.789 14.192,1.156 13.446,0.694C12.7,0.231 11.884,0 11,0C10.124,0 9.313,0.235 8.566,0.706C7.82,1.176 7.22,1.813 6.765,2.616C6.319,3.411 6.096,4.303 6.096,5.293C6.096,6.307 6.319,7.22 6.765,8.031C7.22,8.842 7.816,9.487 8.554,9.966C9.3,10.444 10.116,10.684 11,10.684Z" | ||
android:fillColor="#008DE4"/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
<?xml version="1.0" encoding="utf-8"?><!-- | ||
~ Copyright 2023 Dash Core Group. | ||
~ | ||
~ This program is free software: you can redistribute it and/or modify | ||
~ it under the terms of the GNU General Public License as published by | ||
~ the Free Software Foundation, either version 3 of the License, or | ||
~ (at your option) any later version. | ||
~ | ||
~ This program is distributed in the hope that it will be useful, | ||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
~ GNU General Public License for more details. | ||
~ | ||
~ You should have received a copy of the GNU General Public License | ||
~ along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical"> | ||
|
||
<View | ||
android:id="@+id/drag_indicator" | ||
android:layout_width="35dp" | ||
android:layout_height="4dp" | ||
android:layout_gravity="center" | ||
android:layout_marginVertical="7dp" | ||
android:background="@drawable/rounded_background" | ||
android:theme="@style/DragIndicatorBackground" | ||
tools:background="@color/light_gray" /> | ||
|
||
<TextView | ||
style="@style/Subtitle2" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="17dp" | ||
android:gravity="center_horizontal" | ||
android:textAlignment="gravity" | ||
android:layout_marginHorizontal="20dp" | ||
android:text="@string/confirm" /> | ||
|
||
<TextView | ||
android:id="@+id/confirm_message" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="17dp" | ||
android:gravity="center_horizontal" | ||
android:textAlignment="gravity" | ||
android:layout_marginHorizontal="20dp" | ||
android:text="@string/topup_confirm_message" /> | ||
|
||
|
||
<LinearLayout | ||
android:layout_marginTop="17dp" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center_horizontal" | ||
android:orientation="horizontal"> | ||
<TextView | ||
android:id="@+id/dash_amount_view" | ||
style="@style/Headline3.Regular" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center_horizontal" | ||
android:textAlignment="gravity" | ||
android:text="0.00" /> | ||
|
||
<ImageView | ||
android:id="@+id/dash_symbol_view" | ||
android:layout_width="28dp" | ||
android:layout_height="28dp" | ||
android:layout_gravity="center_vertical" | ||
android:layout_marginTop="2dp" | ||
android:layout_marginStart="8dp" | ||
app:srcCompat="@drawable/ic_dash_d_black" /> | ||
|
||
</LinearLayout> | ||
|
||
<LinearLayout | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center_horizontal" | ||
android:orientation="horizontal"> | ||
|
||
<TextView | ||
android:id="@+id/fiat_symbol_view" | ||
style="@style/Headline6.Regular.Tertiary" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="$" /> | ||
|
||
<TextView | ||
android:id="@+id/fiat_amount_view" | ||
style="@style/Headline6.Regular.Tertiary" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="0.00" /> | ||
|
||
</LinearLayout> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="horizontal" | ||
android:layout_marginTop="25dp" | ||
android:layout_marginBottom="15dp"> | ||
|
||
<Button | ||
android:id="@+id/dismiss_btn" | ||
style="@style/Button.Primary.Large.Grey" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="15dp" | ||
android:layout_weight="1" | ||
android:text="@string/cancel" /> | ||
|
||
<Button | ||
android:id="@+id/confirm_btn" | ||
style="@style/Button.Primary.Large.Blue" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="10dp" | ||
android:layout_marginEnd="15dp" | ||
android:layout_weight="1" | ||
android:text="@string/confirm" /> | ||
</LinearLayout> | ||
</LinearLayout> |
Oops, something went wrong.