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

Feature: episode sort button #1565

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

Conversation

coderang-gk
Copy link
Contributor

Feature: Sort Button with Existing Theming
Fixes #958 #1069
This PR introduces a Sort Button that allows users to sort episodes based on different criteria. By default, it displays sorting options for episode number (ascending/descending) and, if available, rating and air date.

Key Changes:
• Added a Sort Button to trigger the sorting dialog.
• Uses the same styling as the existing Season Selection Dialog (AlertDialogCustom).
• Ensures sorting options include:
• Episode Number (Asc/Desc) - Always available
• Rating (High-Low / Low-High) - Only if episodes have ratings
• Air Date (Newest-Oldest / Oldest-Newest) - Only if episodes have air dates

This change maintains UI consistency while improving the sorting functionality.

- Add sort button next to episode count
- Implement ascending/descending episode sort toggle
- Add sort direction indicator (▲/▼) to button text
- Make sort button visible when episodes are loaded
- Position sort button after episode count text
- Only show rating sort options when episodes have rating data
- Only show air date sort options when episodes have air date data
- Episode number sorting always available
- Improved sort button text to reflect available options
- Fallback to episode sorting when selected sort data unavailable
Copy link
Contributor

@CranberrySoup CranberrySoup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code generally looks good.
It does not support TV, is this intentional or work in progress?

Edit: I was wrong with my earlier assumption

- Remove usage of requireContext() and requireActivity()
- Use safe context handling with view.context
- Consolidate string resources using format arguments
- Add null safety checks for activity and context
- Remove redundant dialog configuration
- Improve sort options handling with conditional visibility
- Fix dialog showing logic
- Add empty list check to disable sort options when no episodes
@coderang-gk
Copy link
Contributor Author

The code generally looks good. It does not support TV, is this intentional or work in progress?

Edit: I was wrong with my earlier assumption

Yes it does not support TV, ill send a new PR for TV, having trouble getting the extensions installed on emulator TV

@fire-light42
Copy link
Collaborator

Worked well when testing, however we might want to

  1. Store the preferred sorting method, so the user does not have to re-select it every time.
  2. Reconsider some UI placements, as in some cases we will have squished UI. Here we might want to move down the "%d Episodes" down to a separate line, or place it last and let it overflow to the next line.
    image

- Set sort button to always appear at the end of its row
- Add proper margin spacing to sort button and episodes text
- Use FlexboxLayout's justifyContent and layout_order attributes
- Ensure consistent margins across UI elements
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 episodes in ascending/descending order
3 participants