Add "has media" filtering to gears dialog

This commit is contained in:
Martin Fietz 2016-10-03 17:21:11 +02:00
parent d0ed378e1e
commit cc675b06be
3 changed files with 18 additions and 0 deletions

View File

@ -225,6 +225,9 @@ public class EpisodesApplyActionFragment extends Fragment {
checkQueued(false); checkQueued(false);
resId = R.string.selected_not_queued_label; resId = R.string.selected_not_queued_label;
break; break;
case R.id.check_has_media:
checkWithMedia();
resId = R.string.selected_has_media_label;
case R.id.sort_title_a_z: case R.id.sort_title_a_z:
sortByTitle(false); sortByTitle(false);
return true; return true;
@ -357,6 +360,17 @@ public class EpisodesApplyActionFragment extends Fragment {
refreshCheckboxes(); refreshCheckboxes();
} }
private void checkWithMedia() {
for (FeedItem episode : episodes) {
if(episode.hasMedia()) {
checkedIds.add(episode.getId());
} else {
checkedIds.remove(episode.getId());
}
}
refreshCheckboxes();
}
private void refreshTitles() { private void refreshTitles() {
titles.clear(); titles.clear();
for(FeedItem episode : episodes) { for(FeedItem episode : episodes) {

View File

@ -46,6 +46,8 @@
android:title="@string/queued_label"/> android:title="@string/queued_label"/>
<item android:id="@+id/check_not_queued" <item android:id="@+id/check_not_queued"
android:title="@string/not_queued_label"/> android:title="@string/not_queued_label"/>
<item android:id="@+id/check_has_media"
android:title="@string/has_media"/>
</menu> </menu>
</item> </item>

View File

@ -587,6 +587,8 @@
<string name="selected_queued_label">Selected queued Episodes</string> <string name="selected_queued_label">Selected queued Episodes</string>
<string name="not_queued_label">Not queued</string> <string name="not_queued_label">Not queued</string>
<string name="selected_not_queued_label">Selected not queued Episodes</string> <string name="selected_not_queued_label">Selected not queued Episodes</string>
<string name="has_media">Has media</string>
<string name="selected_has_media_label">Selected episodes with media</string>
<!-- Sort --> <!-- Sort -->
<string name="sort_title_a_z">Title (A \u2192 Z)</string> <string name="sort_title_a_z">Title (A \u2192 Z)</string>