Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dashpay): update submit request UI with backend #1299

Merged
merged 21 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
967a685
chore: use dashj 21.0.0-CJ-SNAPSHOT
HashEngineering Aug 13, 2024
3de6da4
chore: move dashpay strings to strings-dashpay.xml
HashEngineering Aug 15, 2024
c751326
feat: move balance requirement to WelcomeToDashPayFragment
HashEngineering Aug 15, 2024
93ec4d4
feat: update Username Voting Info fragment
HashEngineering Aug 15, 2024
e27e9b9
feat: update RequestUsernameFragment to new designs
HashEngineering Aug 15, 2024
6e5576d
feat: update the create your username page and confirm dialog
HashEngineering Aug 15, 2024
ceb91ad
fix: implement correct balance warnings on the WelcomeToDashPayFragment
HashEngineering Aug 16, 2024
062f8d0
fix: derive CreateUsernameActivity from LockScreenActivity
HashEngineering Aug 16, 2024
daa3697
feat: add UsernameRegistrationFragment to track the full screen progr…
HashEngineering Aug 16, 2024
ef95802
feat: for uncontested usernames, trigger creation
HashEngineering Aug 16, 2024
cbcc93d
feat: update username fee constants
HashEngineering Aug 16, 2024
8ae1a26
fix: remove VOTE_DASH_PAY_ENABLED
HashEngineering Aug 16, 2024
24fe6b9
fix: remove VOTE_DASH_PAY_ENABLED
HashEngineering Aug 16, 2024
7e7e8c1
fix: remove VOTE_DASH_PAY_ENABLED in Settings layout
HashEngineering Aug 16, 2024
b9d9100
fix: normalize getUsername search
HashEngineering Aug 16, 2024
b605538
fix: move some items from DashPayConfig to BlockchainIdentityConfig
HashEngineering Aug 17, 2024
aff861f
feat: BlockchainIdentityData updates
HashEngineering Aug 19, 2024
6ad58c7
feat: Confirm Username request updates
HashEngineering Aug 19, 2024
fe3ed45
feat: update username creation / requests
HashEngineering Aug 19, 2024
164c216
feat: update username creation / requests
HashEngineering Aug 19, 2024
b60f06e
feat: update the more menu, etc
HashEngineering Aug 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ source_lang = en
type = ANDROID
lang_map = sl_SI: sl, zh_TW: zh-rTW

[o:dash:p:dash-mobile-wallets:r:strings-dashpay]
file_filter = wallet/res/values-<lang>/strings-dashpay.xml
source_file = wallet/res/values/strings-dashpay.xml
source_lang = en
type = ANDROID
lang_map = sl_SI: sl, zh_TW: zh-rTW

[o:dash:p:dash-mobile-wallets:r:strings-uphold]
file_filter = integrations/uphold/src/main/res/values-<lang>/strings-uphold.xml
source_file = integrations/uphold/src/main/res/values/strings-uphold.xml
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
kotlin_version = '1.9.23'
coroutinesVersion = '1.6.4'
ok_http_version = '4.9.1'
dashjVersion = '20.0.5-CJ-SNAPSHOT'
dashjVersion = '21.0.0-CJ-SNAPSHOT'
hiltVersion = '2.51'
hiltCompilerVersion = '1.2.0'
hiltWorkVersion = '1.0.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ open class WalletUIConfig @Inject constructor(
val SHOW_TAP_TO_HIDE_HINT = booleanPreferencesKey("show_tap_to_hide_balance_hint")
val SELECTED_CURRENCY = stringPreferencesKey("exchange_currency")
val EXCHANGE_CURRENCY_DETECTED = booleanPreferencesKey("exchange_currency_detected")

// temporary items for DashPay
val VOTE_DASH_PAY_ENABLED = booleanPreferencesKey("VOTE_DASH_PAY_ENABLED")
}

suspend fun getExchangeCurrencyCode(): String {
Expand Down
12 changes: 12 additions & 0 deletions wallet/res/drawable/ic_check_circle_empty.xml
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="22dp"
android:height="22dp"
android:viewportWidth="22"
android:viewportHeight="22">
<path
android:pathData="M11,0.75L11,0.75A10.25,10.25 0,0 1,21.25 11L21.25,11A10.25,10.25 0,0 1,11 21.25L11,21.25A10.25,10.25 0,0 1,0.75 11L0.75,11A10.25,10.25 0,0 1,11 0.75z"
android:strokeAlpha="0.5"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#B0B6BC"/>
</vector>
9 changes: 9 additions & 0 deletions wallet/res/drawable/ic_error_circle.xml
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.995,21.989C9.49,21.989 8.075,21.702 6.748,21.127C5.421,20.56 4.25,19.768 3.236,18.754C2.228,17.739 1.437,16.568 0.862,15.241C0.287,13.915 0,12.499 0,10.995C0,9.49 0.287,8.075 0.862,6.748C1.437,5.421 2.228,4.254 3.236,3.246C4.25,2.232 5.418,1.437 6.737,0.862C8.064,0.287 9.48,0 10.984,0C12.495,0 13.915,0.287 15.241,0.862C16.568,1.437 17.739,2.232 18.754,3.246C19.768,4.254 20.563,5.421 21.138,6.748C21.713,8.075 22,9.49 22,10.995C22,12.499 21.713,13.915 21.138,15.241C20.563,16.568 19.768,17.739 18.754,18.754C17.739,19.768 16.568,20.56 15.241,21.127C13.915,21.702 12.499,21.989 10.995,21.989ZM7.504,15.497C7.795,15.497 8.043,15.401 8.249,15.21L11.005,12.432L13.773,15.21C13.964,15.401 14.205,15.497 14.496,15.497C14.78,15.497 15.018,15.401 15.21,15.21C15.408,15.011 15.507,14.773 15.507,14.496C15.507,14.205 15.408,13.968 15.21,13.783L12.432,11.005L15.22,8.227C15.419,8.022 15.518,7.784 15.518,7.514C15.518,7.238 15.419,7.003 15.22,6.812C15.028,6.613 14.794,6.514 14.518,6.514C14.241,6.514 14.003,6.613 13.804,6.812L11.005,9.59L8.217,6.812C8.018,6.627 7.78,6.535 7.504,6.535C7.227,6.535 6.989,6.631 6.791,6.822C6.599,7.007 6.503,7.245 6.503,7.536C6.503,7.798 6.602,8.032 6.801,8.238L9.579,11.005L6.801,13.794C6.602,13.986 6.503,14.22 6.503,14.496C6.503,14.773 6.599,15.011 6.791,15.21C6.989,15.401 7.227,15.497 7.504,15.497Z"
android:fillColor="#EA3943"/>
</vector>
10 changes: 10 additions & 0 deletions wallet/res/drawable/ic_face_sad.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M7.34,23.057C8.79,23.685 10.343,24 12,24C13.657,24 15.21,23.685 16.66,23.057C18.109,22.435 19.383,21.572 20.479,20.468C21.576,19.371 22.435,18.102 23.057,16.66C23.685,15.21 24,13.657 24,12C24,10.343 23.685,8.79 23.057,7.34C22.435,5.891 21.576,4.617 20.479,3.521C19.383,2.416 18.109,1.553 16.66,0.932C15.21,0.311 13.657,0 12,0C10.343,0 8.79,0.311 7.34,0.932C5.891,1.553 4.614,2.416 3.509,3.521C2.412,4.617 1.553,5.891 0.932,7.34C0.311,8.79 0,10.343 0,12C0,13.657 0.311,15.21 0.932,16.66C1.553,18.102 2.412,19.371 3.509,20.468C4.614,21.572 5.891,22.435 7.34,23.057ZM9.446,10.424C9.162,10.723 8.832,10.873 8.456,10.873C8.088,10.873 7.762,10.723 7.478,10.424C7.202,10.117 7.064,9.73 7.064,9.262C7.064,8.779 7.202,8.384 7.478,8.077C7.755,7.77 8.081,7.616 8.456,7.616C8.84,7.616 9.174,7.77 9.457,8.077C9.741,8.384 9.883,8.779 9.883,9.262C9.883,9.73 9.737,10.117 9.446,10.424ZM16.51,10.424C16.226,10.723 15.896,10.873 15.521,10.873C15.145,10.873 14.819,10.723 14.543,10.424C14.267,10.117 14.128,9.73 14.128,9.262C14.128,8.779 14.267,8.384 14.543,8.077C14.819,7.77 15.145,7.616 15.521,7.616C15.904,7.616 16.238,7.77 16.522,8.077C16.805,8.384 16.947,8.779 16.947,9.262C16.947,9.73 16.802,10.117 16.51,10.424ZM14.209,15.406C13.572,15.106 12.836,14.957 12,14.957C11.149,14.957 10.405,15.106 9.768,15.406C9.139,15.712 8.644,16.061 8.284,16.452C7.931,16.844 7.755,17.177 7.755,17.454C7.755,17.607 7.816,17.711 7.939,17.764C8.061,17.826 8.192,17.826 8.33,17.764C8.775,17.534 9.277,17.308 9.837,17.085C10.397,16.871 11.118,16.763 12,16.763C12.867,16.763 13.58,16.871 14.14,17.085C14.708,17.308 15.214,17.534 15.659,17.764C15.789,17.818 15.916,17.818 16.038,17.764C16.161,17.711 16.222,17.607 16.222,17.454C16.222,17.177 16.046,16.844 15.693,16.452C15.34,16.061 14.846,15.712 14.209,15.406Z"
android:fillColor="#008DE4"
android:fillType="evenOdd"/>
</vector>
9 changes: 9 additions & 0 deletions wallet/res/drawable/ic_voting_icon.xml
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="28dp"
android:height="20dp"
android:viewportWidth="28"
android:viewportHeight="20">
<path
android:pathData="M1.124,5.94C0.847,6.116 0.591,6.143 0.354,6.021C0.118,5.9 0,5.673 0,5.343V0.755C0,0.431 0.118,0.209 0.354,0.087C0.591,-0.041 0.847,-0.021 1.124,0.148L4.83,2.396C5.1,2.551 5.235,2.771 5.235,3.054C5.242,3.331 5.107,3.55 4.83,3.712L1.124,5.94ZM8.101,4.836C7.662,4.836 7.328,4.725 7.099,4.502C6.876,4.279 6.765,3.949 6.765,3.51V2.558C6.765,2.133 6.876,1.809 7.099,1.586C7.328,1.356 7.662,1.241 8.101,1.241H26.673C27.105,1.241 27.433,1.356 27.656,1.586C27.885,1.809 28,2.133 28,2.558V3.51C28,3.949 27.885,4.279 27.656,4.502C27.433,4.725 27.105,4.836 26.673,4.836H8.101ZM7.777,9.525C7.494,9.525 7.254,9.424 7.058,9.221C6.862,9.012 6.765,8.769 6.765,8.492C6.765,8.209 6.862,7.965 7.058,7.763C7.254,7.56 7.494,7.459 7.777,7.459H26.977C27.261,7.459 27.5,7.56 27.696,7.763C27.899,7.959 28,8.202 28,8.492C28,8.769 27.899,9.012 27.696,9.221C27.5,9.424 27.261,9.525 26.977,9.525H7.777ZM7.777,14.76C7.494,14.76 7.254,14.659 7.058,14.457C6.862,14.247 6.765,14.004 6.765,13.727C6.765,13.444 6.862,13.201 7.058,12.998C7.254,12.796 7.494,12.695 7.777,12.695H26.977C27.261,12.695 27.5,12.796 27.696,12.998C27.899,13.194 28,13.437 28,13.727C28,14.011 27.899,14.254 27.696,14.457C27.5,14.659 27.261,14.76 26.977,14.76H7.777ZM7.777,19.996C7.494,19.996 7.254,19.891 7.058,19.682C6.862,19.479 6.765,19.24 6.765,18.963C6.765,18.679 6.862,18.436 7.058,18.234C7.254,18.031 7.494,17.93 7.777,17.93H26.977C27.261,17.93 27.5,18.028 27.696,18.224C27.899,18.426 28,18.673 28,18.963C28,19.247 27.899,19.49 27.696,19.692C27.5,19.895 27.261,19.996 26.977,19.996H7.777Z"
android:fillColor="#008DE4"/>
</vector>
9 changes: 9 additions & 0 deletions wallet/res/drawable/ic_warning_triangle.xml
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="20dp"
android:viewportWidth="22"
android:viewportHeight="20">
<path
android:pathData="M2.956,19.971C2.352,19.971 1.828,19.839 1.384,19.575C0.94,19.312 0.597,18.958 0.354,18.514C0.118,18.07 0,17.577 0,17.036C0,16.509 0.139,16.006 0.416,15.527L8.471,1.488C8.742,0.996 9.106,0.624 9.564,0.375C10.022,0.125 10.5,0 11,0C11.5,0 11.975,0.125 12.426,0.375C12.877,0.617 13.244,0.989 13.529,1.488L21.584,15.527C21.722,15.763 21.827,16.009 21.896,16.266C21.965,16.522 22,16.779 22,17.036C22,17.577 21.879,18.07 21.636,18.514C21.393,18.958 21.049,19.312 20.605,19.575C20.168,19.839 19.648,19.971 19.045,19.971H2.956ZM11.01,12.842C11.628,12.842 11.944,12.519 11.957,11.874L12.124,6.65C12.138,6.331 12.037,6.071 11.822,5.869C11.607,5.661 11.333,5.557 11,5.557C10.66,5.557 10.386,5.661 10.178,5.869C9.97,6.071 9.873,6.327 9.886,6.64L10.032,11.885C10.053,12.523 10.379,12.842 11.01,12.842ZM11.01,16.422C11.357,16.422 11.656,16.311 11.905,16.089C12.155,15.867 12.28,15.583 12.28,15.236C12.28,14.896 12.155,14.611 11.905,14.382C11.656,14.153 11.357,14.039 11.01,14.039C10.657,14.039 10.355,14.153 10.105,14.382C9.855,14.611 9.73,14.896 9.73,15.236C9.73,15.583 9.855,15.867 10.105,16.089C10.362,16.311 10.663,16.422 11.01,16.422Z"
android:fillColor="#FFC043"/>
</vector>
6 changes: 3 additions & 3 deletions wallet/res/layout/activity_onboard_from_invite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
android:layout_height="wrap_content"
android:drawablePadding="8dp"
android:text="@string/onboard_from_invite_step1"
app:drawableEndCompat="@drawable/ic_onboard_from_invite_check" />
app:drawableEndCompat="@drawable/ic_check_circle_green" />

<TextView
android:id="@+id/title1"
Expand Down Expand Up @@ -107,7 +107,7 @@
android:layout_height="wrap_content"
android:drawablePadding="8dp"
android:text="@string/onboard_from_invite_step2"
app:drawableEndCompat="@drawable/ic_onboard_from_invite_check" />
app:drawableEndCompat="@drawable/ic_check_circle_green" />

<TextView
android:id="@+id/title2"
Expand Down Expand Up @@ -153,7 +153,7 @@
android:layout_height="wrap_content"
android:drawablePadding="8dp"
android:text="@string/onboard_from_invite_step3"
app:drawableEndCompat="@drawable/ic_onboard_from_invite_check" />
app:drawableEndCompat="@drawable/ic_check_circle_green" />

<TextView
android:id="@+id/title3"
Expand Down
24 changes: 0 additions & 24 deletions wallet/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,30 +187,6 @@
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/voting_dash_pay"
style="@style/MenuRow.Internal">

<TextView
style="@style/MenuRowTitle.Internal"
android:text="@string/voting_period_active"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/voting_dash_pay_switch"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/voting_dash_pay_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:theme="@style/SwitchCompat"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/battery_optimization"
style="@style/MenuRow.Internal">
Expand Down
33 changes: 29 additions & 4 deletions wallet/res/layout/dialog_confirm_username_request.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,18 @@
android:gravity="center_horizontal"
android:textAlignment="gravity"
android:layout_marginHorizontal="20dp"
android:text="@string/quick_vote" />
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/new_account_confirm_message" />


<LinearLayout
android:layout_marginTop="17dp"
Expand Down Expand Up @@ -89,13 +100,27 @@

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginVertical="8dp"
android:gravity="center_horizontal">
<CheckBox
android:id="@+id/user_accepts"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/request_username_confirm" />
</LinearLayout>


<LinearLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="30dp"
android:layout_marginTop="25dp"
android:layout_marginBottom="15dp">

<Button
Expand Down
83 changes: 47 additions & 36 deletions wallet/res/layout/fragment_more.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,43 +89,7 @@

</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/requested_username_container"
android:visibility="gone"
tools:visibility="visible"
style="@style/MenuRow">

<ImageView
android:id="@+id/requested_username_icon"
style="@style/MenuRowIcon"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_avatar_blue" />

<TextView
android:id="@+id/requested_username_title"
style="@style/MenuRowTitle"
app:layout_constraintStart_toEndOf="@+id/requested_username_icon"
app:layout_constraintTop_toTopOf="@+id/requested_username_icon"
tools:text="@string/menu_invite_title" />

<TextView
android:id="@+id/requested_username_subtitle"
style="@style/MenuRowSubTitle"
android:text="@string/requested_voting_duration"
app:layout_constraintStart_toStartOf="@+id/requested_username_title"
app:layout_constraintTop_toBottomOf="@+id/requested_username_title" />

<ImageView
android:id="@+id/requested_username_arrow"
style="@style/MenuRowArrow"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_menu_row_arrow" />

</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

<ViewFlipper
Expand Down Expand Up @@ -215,6 +179,53 @@

</ViewFlipper>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/requested_username_container"
android:visibility="gone"
tools:visibility="visible"
android:layout_height="110dp"
style="@style/MenuRow">

<ImageView
android:id="@+id/requested_username_icon"
style="@style/MenuRowIcon"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_avatar_blue" />

<TextView
android:id="@+id/requested_username_title"
style="@style/MenuRowTitle"
app:layout_constraintStart_toEndOf="@+id/requested_username_icon"
app:layout_constraintTop_toTopOf="@+id/requested_username_icon"
tools:text="@string/shortcut_action_join_dashpay" />

<TextView
android:id="@+id/requested_username_subtitle"
style="@style/MenuRowSubTitle"
android:text="@string/requested_username_has_been"
app:layout_constraintStart_toStartOf="@+id/requested_username_title"
app:layout_constraintTop_toBottomOf="@+id/requested_username_title" />


<TextView
android:id="@+id/requested_username_subtitle_two"
style="@style/MenuRowSubTitle"
android:text="@string/requested_voting_duration"
app:layout_constraintStart_toStartOf="@+id/requested_username_subtitle"
app:layout_constraintTop_toBottomOf="@+id/requested_username_subtitle" />

<ImageView
android:id="@+id/requested_username_arrow"
style="@style/MenuRowArrow"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_menu_row_arrow" />

</androidx.constraintlayout.widget.ConstraintLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
Loading
Loading