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 Added custom sorting to the alarms and timers sorting dialogs #69

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ronniedroid
Copy link

@ronniedroid ronniedroid commented Apr 28, 2024

What is it?

  • Bugfix
  • 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

screen-20240429-101246.mp4

Fixes the following issue(s)

Relies on the following changes

Acknowledgement

@ronniedroid ronniedroid changed the title [FEAT] Added sorting dialog to the alarms and timer tab [FEAT] Added custom sorting to the alarms and timers sorting dialogs Apr 28, 2024
@ronniedroid ronniedroid changed the title [FEAT] Added custom sorting to the alarms and timers sorting dialogs FEAT Added custom sorting to the alarms and timers sorting dialogs Apr 28, 2024
@Aga-C
Copy link
Member

Aga-C commented Apr 28, 2024

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.

@ronniedroid
Copy link
Author

ronniedroid commented Apr 28, 2024

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.

@Aga-C
Copy link
Member

Aga-C commented Apr 28, 2024

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.

@ronniedroid
Copy link
Author

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
Copy link
Author

@Aga-C done

@Aga-C
Copy link
Member

Aga-C commented Apr 29, 2024

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

qemu-system-x86_64_eFtwz8QhTJ.mp4

@ronniedroid
Copy link
Author

ronniedroid commented Apr 29, 2024

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
Copy link
Author

@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
Copy link
Author

ronniedroid commented Apr 30, 2024

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.

@Aga-C
Copy link
Member

Aga-C commented Apr 30, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature request] Add Sorting option - my own sorting by drag and drop - Alarms/Timers
2 participants