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

Honor sort in episode list view in Android Auto #6756

Merged
merged 16 commits into from Nov 17, 2023

Conversation

tonytamsf
Copy link
Member

@tonytamsf tonytamsf commented Nov 12, 2023

Fix #6752

Honor sort order in all episode list as well as episode list per feed view in Android Auto

This is the new preference for the AllEpisodesFragment in order for this preference to be shared

/data/data/de.danoeh.antennapod.debug/shared_prefs/de.danoeh.antennapod.debug_preferences.xml

<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
    <string name="prefEpisodesSort">2</string>
    <string name="prefEpisodeFilter">unplayed</string>
</map>

@ByteHamster
Copy link
Member

Isn't the issue about the "all epsiodes" list? (not that we shouldn't also fix it here)

@tonytamsf
Copy link
Member Author

tonytamsf commented Nov 12, 2023

Isn't the issue about the "all epsiodes" list? (not that we shouldn't also fix it here)

Ah, you are right. In this single PR I have fixed respecting the sort for all Episodes and feed episodes in Android Auto

@ByteHamster could I move the preferences for AllEpisodesFragment into UserPreferences so that I can access it via PlaybackService.java?

Otherwise, I'm not sure how I could get the preference from PrefAllEpisodesFragment without importing the app code into core (PlaybackService)

Copy link
Member

@ByteHamster ByteHamster left a comment

Choose a reason for hiding this comment

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

Thanks! Some comments below :)

}

@Override
protected int loadTotalItemCount() {
return DBReader.getTotalEpisodeCount(getFilter());
}


Copy link
Member

Choose a reason for hiding this comment

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

Unrelated change

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

}

@Override
protected String getFragmentTag() {
return TAG;
}

@Override
protected String getPrefName() {
return PREF_NAME;
Copy link
Member

Choose a reason for hiding this comment

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

I think this should stay, that's where the parent class stores the scroll position

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you, I learned something new

@@ -867,4 +872,22 @@ public static void setSubscriptionsFilter(SubscriptionsFilter value) {
public static boolean shouldShowSubscriptionTitle() {
return prefs.getBoolean(PREF_SUBSCRIPTION_TITLE, false);
}

public static void setAllEpisodeSortOrder(SortOrder s) {
Copy link
Member

Choose a reason for hiding this comment

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

Not setAllEpisodesSortOrder (episodeS)?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch

@tonytamsf
Copy link
Member Author

Thanks! Some comments below :)

ready for another round of reviews

@tonytamsf tonytamsf added the Functionality: Interacting devices Anything related to Android Auto, smart watches & smart speakers label Nov 13, 2023
Copy link
Member

@ByteHamster ByteHamster left a comment

Choose a reason for hiding this comment

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

One more round of review :)

tonytamsf and others added 7 commits November 14, 2023 13:02
…pgrader.java

Co-authored-by: ByteHamster <ByteHamster@users.noreply.github.com>
…pgrader.java

Co-authored-by: ByteHamster <ByteHamster@users.noreply.github.com>
…PlaybackService.java

Co-authored-by: ByteHamster <ByteHamster@users.noreply.github.com>
…/preferences/UserPreferences.java

Co-authored-by: ByteHamster <ByteHamster@users.noreply.github.com>
…/preferences/UserPreferences.java

Co-authored-by: ByteHamster <ByteHamster@users.noreply.github.com>
…pgrader.java

Co-authored-by: ByteHamster <ByteHamster@users.noreply.github.com>
@tonytamsf
Copy link
Member Author

One more round of review :)

Ready for one more round.

@ByteHamster ByteHamster changed the title honor sort in episode list view in Android Auto Honor sort in episode list view in Android Auto Nov 17, 2023
@ByteHamster ByteHamster merged commit c7d6cd3 into AntennaPod:develop Nov 17, 2023
7 checks passed
@ByteHamster
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality: Interacting devices Anything related to Android Auto, smart watches & smart speakers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android auto sort order error
2 participants