Clock icon indicating copy to clipboard operation
Clock copied to clipboard

FEAT Added custom sorting to the alarms and timers sorting dialogs

Open ronniedroid opened this issue 1 year ago • 10 comments

What is it?

  • [ ] Bugfix
  • [x] Feature
  • [ ] Codebase improvement

Description of the changes in your PR

  • Added custom option to the sorting dialogs
  • Added alarmsCustomSorting and timersCustomSorting to the config
  • handled custom sorting in the alarms and timers fragments
  • added a handle to the alarm and timer item xml.
  • Made sure the handle shows whenever the user selects an item (long press on an item)
  • Set the sorting to custom if the user rearranges the items.

Before/After Screenshots/Screen Record

https://github.com/FossifyOrg/Clock/assets/9327361/dd34eef4-7828-4b6f-937b-5e163334889f

Fixes the following issue(s)

  • Fixes #8

Relies on the following changes

  • #67 being merged

Acknowledgement

ronniedroid avatar Apr 28 '24 09:04 ronniedroid

We should have a similar UX in all apps. Custom sorting is already in Notes app (in checklists), and it works different. Most importantly, users shouldn't need to invoke manually custom sorting - it should be possible to move items after long pressing them.

Aga-C avatar Apr 28 '24 09:04 Aga-C

We should have a similar UX in all apps. Custom sorting is already in Notes app (in checklists), and it works different. Most importantly, users shouldn't need to invoke manually custom sorting - it should be possible to move items after long pressing them.

I checked other fossify apps and they have a custom entry in the sorting options, so I did the same.

I think that having to manually invoke custom sorting makes more sense than just hold and drag on any sorting option.

ronniedroid avatar Apr 28 '24 09:04 ronniedroid

I checked other fossify apps and they have a custom entry in the sorting options, so I did the same.

I didn't mean entry itself, but how it works. In other apps, you don't need to check this option to move items around. Also, thanks to moving after long pressing, handles don't need to be always visible like in your case. This UX is in Notes, Contacts and Phone, and nobody complain about it. We have to be consistent.

Aga-C avatar Apr 28 '24 10:04 Aga-C

Ok I get what you mean, I do not like it, but I will change it to what you are saying by tomorrow.

I don't like it because every time you are in a mode that is not the custom mode, and you start dragging, you reset the custom order you had before, which I myself find annoying, I find the separation of sorting modes to be a better way.

ronniedroid avatar Apr 28 '24 12:04 ronniedroid

@Aga-C done

ronniedroid avatar Apr 29 '24 07:04 ronniedroid

Custom sorting seems to work fine, but in Timers for some reason some entries get smaller while moving them. See the recording below:

https://github.com/FossifyOrg/Clock/assets/85929121/24cb879d-122d-4bf6-8bfd-fa4297dcfa82

Aga-C avatar Apr 29 '24 09:04 Aga-C

Ok, that is weird, I will look into it tomorrow. I think it might be because the timers_time's width is set to 0dp.

ronniedroid avatar Apr 29 '24 09:04 ronniedroid

@Aga-C this only happens when we have a timer with HH:MM:SS, so I had to adjust the timer_timer text size to be smaller than the alarm_text_size.

but one over issue I found with this approach (long press to show the drag handles) is that if a timer is running, you can't show the handles, they disappear immediately.

ronniedroid avatar Apr 30 '24 05:04 ronniedroid

So, how should we handle this? should we pause the timer when a user long presses? or not enable dragging at all when a timer is running? I think this issue was introduced by switching the timer adapter to the MyRecyclerViewAdapter from the MyRecyclerViewListAdapter.

This is a little (A lot) above my skills tbh.

ronniedroid avatar Apr 30 '24 06:04 ronniedroid

So, how should we handle this? should we pause the timer when a user long presses? or not enable dragging at all when a timer is running? I think this issue was introduced by switching the timer adapter to the MyRecyclerViewAdapter from the MyRecyclerViewListAdapter.

I'm thinking whether it wouldn't be better to stop updating the timer while dragging (but it still would be running in a background). But honestly, I don't know what would be the best approach. Maybe Naveen will come up with something when he'll be checking this PR.

This is a little (A lot) above my skills tbh.

No worries, you've done a lot. Now only what's left is polishing.

Aga-C avatar Apr 30 '24 09:04 Aga-C

Now only what's left is polishing.

It should be shining by now ;)

Thanks, guys!

naveensingh avatar Mar 05 '25 19:03 naveensingh