-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DashPay: Add Send Payment to Pending Contact via QR code (NMA-373) (#503
) * Show Add New Contact if we have not received a request previous code didn't show Add New Contact if we had sent a request, though we had no contacts. * Show received request notification on user screen without accept/x buttons * Do manual layout for user who has made a contact request * Update layouts with new avatar size and add Accept Contact Request * DashPayProfileDao: add load profile from username methods * Phase 1 of supporting scanning QR codes and paying pending contacts and current contacts * PaymentIntent: Add constructor that for address, identity and amount * SendCoinsFragment: handle payment intents codes with username that is a contact/pending contact * Use WorkManager for sending contact requests (#506) * Show enter amount screen if blockchain is not synced (replaying) * Tracking the progress of sending contact request * Simplified tracking of the progress of send contact request operation (#509) * Simplified tracking of the progress of send contact request operation Removed some debug code * Improved exception handling * Refactored the code of handling payments to pending contact. Added tracking the progress after sending contact request. * Major refactoring of DashPayUserActivity and logic responsible for handling status of contact requests. Fixed issues with sending payments to strangers. * Minor code refactoring. Mostly changed the naming convention for Room DAOs (the `Async` suffix should not be used in coroutine based / suspended versions) * Improvements in tracking status of contact requests * Improvements in tracking status of contact requests for DashPayUserActivity and UsernameSearchResultsAdapter * Improvements in tracking status of contact requests for ContactSearchResultsAdapter and NotificationsAdapter * Remember the state of 'Accept contact request' checkbox user-wise Co-authored-by: tomasz-ludek <tomasz@dash.org>
- Loading branch information
1 parent
74c254a
commit 0e687ea
Showing
72 changed files
with
2,079 additions
and
1,470 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
10 changes: 10 additions & 0 deletions
10
ui-redesign/src/main/res/drawable-v21/selectable_background_dark.xml
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,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ripple xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:color="@color/ripple_dark"> | ||
<item android:id="@android:id/mask"> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="@color/ripple_dark" /> | ||
</shape> | ||
<color android:color="@android:color/transparent" /> | ||
</item> | ||
</ripple> |
6 changes: 6 additions & 0 deletions
6
ui-redesign/src/main/res/drawable/selectable_background_dark.xml
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,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<item android:drawable="@color/ripple_dark" android:state_pressed="true" /> | ||
|
||
</selector> |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,206 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<merge 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="wrap_content" | ||
android:animateLayoutChanges="true" | ||
android:background="@color/bg_less_bright" | ||
android:orientation="vertical" | ||
tools:parentTag="android.widget.LinearLayout"> | ||
|
||
<FrameLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="@color/dash_white"> | ||
|
||
<LinearLayout | ||
android:id="@+id/main_button" | ||
android:layout_width="match_parent" | ||
android:layout_height="40dp" | ||
android:layout_marginStart="32dp" | ||
android:layout_marginTop="32dp" | ||
android:layout_marginEnd="32dp" | ||
android:layout_marginBottom="32dp" | ||
android:background="@drawable/blue_button_background" | ||
android:gravity="center" | ||
android:orientation="horizontal" | ||
tools:ignore="UseCompoundDrawables"> | ||
|
||
<ImageView | ||
android:id="@+id/main_button_icon" | ||
android:layout_width="24dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginEnd="16dp" | ||
app:srcCompat="@drawable/ic_add_contact_white" | ||
tools:ignore="ContentDescription" /> | ||
|
||
<TextView | ||
android:id="@+id/main_button_text" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/send_contact_request" | ||
android:textColor="@color/dash_white" | ||
android:textSize="14sp" /> | ||
|
||
</LinearLayout> | ||
</FrameLayout> | ||
|
||
<FrameLayout | ||
android:id="@+id/pay_button_pane" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="@color/dash_white" | ||
android:paddingTop="32dp"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical"> | ||
|
||
<FrameLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="1" | ||
tools:ignore="UselessLeaf" /> | ||
|
||
<FrameLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="1" | ||
android:background="@color/bg_less_bright" /> | ||
|
||
</LinearLayout> | ||
|
||
<Button | ||
android:id="@+id/pay_button" | ||
style="@style/DashButton.Blue" | ||
android:layout_width="match_parent" | ||
android:layout_height="40dp" | ||
android:layout_marginStart="30dp" | ||
android:layout_marginEnd="30dp" | ||
android:paddingStart="26dp" | ||
android:paddingEnd="26dp" | ||
android:text="@string/pay" /> | ||
|
||
</FrameLayout> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:id="@+id/contact_request_received_pane" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:paddingBottom="32dp"> | ||
|
||
<TextView | ||
android:id="@+id/request_received_pane_title" | ||
style="@style/MontserratRegular" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginLeft="34dp" | ||
android:layout_marginTop="26dp" | ||
android:layout_marginRight="34dp" | ||
android:textColor="@android:color/black" | ||
android:textSize="13sp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
tools:text="@string/contact_request_received_title" /> | ||
|
||
<androidx.constraintlayout.widget.Guideline | ||
android:id="@+id/request_buttons_guide" | ||
android:layout_width="0dp" | ||
android:layout_height="0dp" | ||
android:orientation="vertical" | ||
app:layout_constraintGuide_percent="0.5" | ||
app:layout_constraintTop_toBottomOf="@id/request_received_pane_title" /> | ||
|
||
<Button | ||
android:id="@+id/accept" | ||
style="@style/DashButton.AquaGreen" | ||
android:layout_width="100dp" | ||
android:layout_height="39dp" | ||
android:layout_marginTop="14dp" | ||
android:layout_marginEnd="5dp" | ||
android:text="@string/contact_request_accept" | ||
app:layout_constraintEnd_toStartOf="@id/request_buttons_guide" | ||
app:layout_constraintTop_toBottomOf="@id/request_received_pane_title" /> | ||
|
||
<Button | ||
android:id="@+id/ignore" | ||
style="@style/DashButton.MediumGray" | ||
android:layout_width="100dp" | ||
android:layout_height="39dp" | ||
android:layout_marginStart="5dp" | ||
android:layout_marginTop="14dp" | ||
android:text="@string/contact_request_ignore" | ||
app:layout_constraintStart_toEndOf="@id/request_buttons_guide" | ||
app:layout_constraintTop_toBottomOf="@id/request_received_pane_title" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
|
||
<LinearLayout | ||
android:id="@+id/contact_history_disclaimer" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="32dp" | ||
android:layout_marginTop="38dp" | ||
android:layout_marginEnd="32dp" | ||
android:layout_marginBottom="32dp" | ||
android:background="@drawable/round_corners_white_bg" | ||
android:orientation="vertical"> | ||
|
||
<ImageView | ||
android:id="@+id/ic_add_stranger" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center_horizontal" | ||
android:layout_marginTop="32dp" | ||
app:srcCompat="@drawable/ic_add_stranger" /> | ||
|
||
<TextView | ||
android:id="@+id/contact_history_disclaimer_text" | ||
style="@style/MontserratRegular" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="26dp" | ||
android:layout_marginTop="24dp" | ||
android:layout_marginEnd="26dp" | ||
android:layout_marginBottom="24dp" | ||
android:gravity="center" | ||
android:textColor="@android:color/black" | ||
android:textSize="16sp" | ||
tools:text="Add Katie Rennie as your contact to Pay Directly to Username and Retain Mutual Transaction History" /> | ||
|
||
<LinearLayout | ||
android:id="@+id/disclaimer_button" | ||
android:layout_width="match_parent" | ||
android:layout_height="40dp" | ||
android:layout_marginStart="32dp" | ||
android:layout_marginEnd="32dp" | ||
android:layout_marginBottom="24dp" | ||
android:background="@drawable/blue_outline_button_bg" | ||
android:gravity="center" | ||
android:orientation="horizontal" | ||
tools:ignore="UseCompoundDrawables"> | ||
|
||
<ImageView | ||
android:id="@+id/disclaimer_button_icon" | ||
android:layout_width="24dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginEnd="16dp" | ||
app:srcCompat="@drawable/inverted_contact_icon" | ||
tools:ignore="ContentDescription" /> | ||
|
||
<TextView | ||
android:id="@+id/disclaimer_button_text" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/send_contact_request" | ||
android:textColor="@color/inverted_button" | ||
android:textSize="14sp" /> | ||
|
||
</LinearLayout> | ||
|
||
</LinearLayout> | ||
|
||
</merge> |
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.