From 80c8cd0fdae1a5ebe4c79fcefe9d136f01a2f623 Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Mon, 30 Dec 2024 05:49:00 -0800 Subject: [PATCH] feat(voting): improve voting button and grouping by date (#1335) * feat: add voting period ends improvements * feat: use thumbs up/down logos instead * fix: crash on empty list * fix: update sorting to match user selection * feat: improve sorting * fix: prevent crash after view destroyed * chore: cleanup and add license --- wallet/res/drawable/ic_thumb_down_red.xml | 25 +++ wallet/res/drawable/ic_thumb_down_white.xml | 25 +++ wallet/res/drawable/ic_thumb_up_blue.xml | 25 +++ wallet/res/drawable/ic_thumb_up_white.xml | 25 +++ .../dialog_username_request_filters.xml | 28 +++ .../fragment_username_request_details.xml | 24 +++ .../res/layout/username_request_date_view.xml | 37 ++++ .../layout/username_request_group_view.xml | 57 ++++-- wallet/res/layout/username_request_view.xml | 25 ++- wallet/res/navigation/nav_voting.xml | 4 + wallet/res/values/strings-dashpay.xml | 25 +-- .../wallet/database/dao/UsernameRequestDao.kt | 3 + .../UsernameRequestDetailsFragment.kt | 8 + .../username/UsernameRequestFilterDialog.kt | 50 +++++- .../ui/username/UsernameRequestsFragment.kt | 42 ++++- .../ui/username/UsernameRequestsViewModel.kt | 59 +++++- .../adapters/UsernameRequestGroupAdapter.kt | 168 +++++++++++++----- .../adapters/UsernameRequestGroupView.kt | 22 ++- .../voting/RequestUserNameViewModel.kt | 6 + .../voting/VotingRequestDetailsFragment.kt | 65 ++++--- 20 files changed, 594 insertions(+), 129 deletions(-) create mode 100644 wallet/res/drawable/ic_thumb_down_red.xml create mode 100644 wallet/res/drawable/ic_thumb_down_white.xml create mode 100644 wallet/res/drawable/ic_thumb_up_blue.xml create mode 100644 wallet/res/drawable/ic_thumb_up_white.xml create mode 100644 wallet/res/layout/username_request_date_view.xml diff --git a/wallet/res/drawable/ic_thumb_down_red.xml b/wallet/res/drawable/ic_thumb_down_red.xml new file mode 100644 index 0000000000..3ca1632e87 --- /dev/null +++ b/wallet/res/drawable/ic_thumb_down_red.xml @@ -0,0 +1,25 @@ + + + + diff --git a/wallet/res/drawable/ic_thumb_down_white.xml b/wallet/res/drawable/ic_thumb_down_white.xml new file mode 100644 index 0000000000..8156ea16af --- /dev/null +++ b/wallet/res/drawable/ic_thumb_down_white.xml @@ -0,0 +1,25 @@ + + + + diff --git a/wallet/res/drawable/ic_thumb_up_blue.xml b/wallet/res/drawable/ic_thumb_up_blue.xml new file mode 100644 index 0000000000..55dec1e2d7 --- /dev/null +++ b/wallet/res/drawable/ic_thumb_up_blue.xml @@ -0,0 +1,25 @@ + + + + diff --git a/wallet/res/drawable/ic_thumb_up_white.xml b/wallet/res/drawable/ic_thumb_up_white.xml new file mode 100644 index 0000000000..a22d1332fc --- /dev/null +++ b/wallet/res/drawable/ic_thumb_up_white.xml @@ -0,0 +1,25 @@ + + + + diff --git a/wallet/res/layout/dialog_username_request_filters.xml b/wallet/res/layout/dialog_username_request_filters.xml index 7f5c0b87d7..6b25ae8c80 100644 --- a/wallet/res/layout/dialog_username_request_filters.xml +++ b/wallet/res/layout/dialog_username_request_filters.xml @@ -66,12 +66,40 @@ android:layout_marginTop="5dp" app:layout_constraintTop_toBottomOf="@id/header"> + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wallet/res/layout/username_request_group_view.xml b/wallet/res/layout/username_request_group_view.xml index 7d21e9eab8..e0e284c1eb 100644 --- a/wallet/res/layout/username_request_group_view.xml +++ b/wallet/res/layout/username_request_group_view.xml @@ -62,7 +62,7 @@ android:id="@+id/link_included" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="link included" + android:text="@string/link_included" style="@style/Caption.Blue" app:layout_constraintTop_toTopOf="@id/link_badge" app:layout_constraintStart_toEndOf="@id/link_badge" /> @@ -79,32 +79,61 @@ app:layout_constraintBottom_toBottomOf="@id/username" tools:text="4 requests" /> -