-
Notifications
You must be signed in to change notification settings - Fork 490
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: sort attendee list on the basis of ticket type (#781) #782
Conversation
Hi @AkshayCHD! It looks like one or more of your builds have failed.
|
Hi @AkshayCHD! It looks like one or more of your builds have failed.
|
Hi @AkshayCHD! It looks like one or more of your builds have failed.
|
@iamareebjamal please review |
Codecov Report
@@ Coverage Diff @@
## development #782 +/- ##
=================================================
- Coverage 32.52% 32.24% -0.29%
Complexity 449 449
=================================================
Files 122 122
Lines 3557 3588 +31
Branches 127 129 +2
=================================================
Hits 1157 1157
- Misses 2354 2385 +31
Partials 46 46
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use fastadapter for sorting
@@ -19,5 +19,8 @@ | |||
android:title="@string/filter_by_sync" /> | |||
</menu> | |||
</item> | |||
<item android:id="@+id/sort" | |||
android:title="@string/sort" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use explicit dialog box, see above how the filter menu is created
@iamareebjamal sorting in fastadapter requires min api level 24 |
Where is it written so, it is a library and hence shouldn't have any min API constraint |
@iamareebjamal the sort function, which uses comparators to sort adapteritems requires api 24 |
Can you point to doc reference please |
@iamareebjamal the only way to sort lists in fast adapter is as shown here, https://github.com/mikepenz/FastAdapter/blob/6b7b1cf2fe7a6d86ce8eb3ae725470d6477df356/app/src/main/java/com/mikepenz/fastadapter/app/SortActivity.java and in my opinion the already implemented way is better than that. As the method here was not added initially but was later added as in the discussion here mikepenz/FastAdapter#51 in the method we have to make a new comparator and then implement all the methods of the superclass, whereas right now sorting requires only Collection.sort() function which is simply implemented using lambda notation |
Comparator can be created as a lamda as well |
@iamareebjamal please review |
Hi @AkshayCHD! It looks like one or more of your builds have failed.
|
@iamareebjamal i have added some new features to my proposal can you review them please https://docs.google.com/document/d/1pkm8zEYxfGR809NOQNMwaMsbh5T4HSmrFcf-4nDNC_w/edit?usp=sharing |
@AkshayCHD Please update the PR |
791509b
to
fe86d2c
Compare
Hi @AkshayCHD! It looks like one or more of your builds have failed.
|
Hi @AkshayCHD! It looks like one or more of your builds have failed.
|
@@ -19,5 +19,15 @@ | |||
android:title="@string/filter_by_sync" /> | |||
</menu> | |||
</item> | |||
<item android:id="@+id/sortAttendee" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have an icon
@iamareebjamal please review |
@@ -3,5 +3,5 @@ | |||
android:width="24dp" | |||
android:viewportWidth="24" | |||
android:viewportHeight="24"> | |||
<path android:fillColor="#000" android:pathData="M6,13H18V11H6M3,6V8H21V6M10,18H14V16H10V18Z" /> | |||
<path android:fillColor="#000" android:pathData="M3,2H21V2H21V4H20.92L14,10.92V22.91L10,18.91V10.91L3.09,4H3V2Z" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
Hi @AkshayCHD! It looks like one or more of your builds have failed.
|
app/src/main/res/values/strings.xml
Outdated
@@ -106,6 +106,7 @@ | |||
<string name="create_event">Create Event</string> | |||
<string name="event_name">Event Name</string> | |||
<string name="payment_currency">Payment Currency</string> | |||
<string name="sort_by_ticket_type">Ticket</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be ticket
default: | ||
return super.onOptionsItemSelected(item); | ||
} | ||
} | ||
|
||
void sortAttendees(int sortBy) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be private
@Override | ||
public void onDestroy() { | ||
super.onDestroy(); | ||
fastAdapter.unregisterAdapterDataObserver(observer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check for nulls
@iamareebjamal I have improved the drawable used for filtering, the new one is more relevant to the functionality provided and also is easily distinguishable from the one used for sorting, I have updated the screenshots please have a look |
app/src/main/res/values/strings.xml
Outdated
@@ -106,6 +106,7 @@ | |||
<string name="create_event">Create Event</string> | |||
<string name="event_name">Event Name</string> | |||
<string name="payment_currency">Payment Currency</string> | |||
<string name="sort_by_ticket">Ticket</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be ticket
@iamareebjamal please review |
Hi @AkshayCHD! It looks like one or more of your builds have failed.
|
Fixes #781 #275
Changes:Add sorting feature to sort attendee list on the basis of ticket type
Screenshots for the change: