Skip to content

Conversation

@tejas-rkd
Copy link

Purpose

The implemented changes address two key user experience issues with the sort functionality: (fixes #304)

  1. Radio Button Selection: Fix the issue where the selected sort option wasn't being highlighted in the menu.
  2. Sort Direction Indication: Add a visual indicator that shows whether the list is sorted in ascending or descending order.

Solution

1. Radio Button Highlighting

Added proper selection state management to ensure the currently active sort option is visually indicated with a radio button:

  • Enhanced onCreateOptionsMenu() to initialize the selected sort option based on the user's last selection
  • Modified each sort method to update the menu selection when a new sort order is chosen
  • Added a helper method updateSortMenuSelection() to manage the checked states across all menu items

2. Sort Direction Indication

Created a visual indicator for sort direction by rotating the sort icon:

  • Created a dedicated rotated drawable (ic_action_sort_asc.xml) for descending order
  • Added logic to switch between regular and rotated sort icons based on the current sort direction
  • Updated the sort methods to properly track and communicate the sort direction

Testing

Demo Link: https://drive.google.com/file/d/1vrV5PFoD7OInxs3mIR93doYdfAJRbyBS/view?usp=drivesdk

  1. On app launch, sorting property and it's order are loaded. (Defaults to status and Descending)
  2. Selecting different sorting property, we now show radio box check and background torrent list is sorted on that parameter.
  3. Clicking same property sets it's order in ascending mode and the icon is rotated 180 degree.
  4. Works fine with existing filtering logic.

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.

Sort order isn't properly visualised

1 participant