Refactor
This commit is contained in:
parent
397cd8c636
commit
404a9c2fbf
|
@ -228,7 +228,7 @@ public class FeedInfoActivity extends AppCompatActivity {
|
|||
cbxAutoDownload.setChecked(prefs.getAutoDownload());
|
||||
cbxAutoDownload.setOnCheckedChangeListener((compoundButton, checked) -> {
|
||||
feed.getPreferences().setAutoDownload(checked);
|
||||
feed.savePreferences(FeedInfoActivity.this);
|
||||
feed.savePreferences();
|
||||
updateAutoDownloadSettings();
|
||||
ApplyToEpisodesDialog dialog = new ApplyToEpisodesDialog(FeedInfoActivity.this,
|
||||
feed, checked);
|
||||
|
@ -237,7 +237,7 @@ public class FeedInfoActivity extends AppCompatActivity {
|
|||
cbxKeepUpdated.setChecked(prefs.getKeepUpdated());
|
||||
cbxKeepUpdated.setOnCheckedChangeListener((compoundButton, checked) -> {
|
||||
feed.getPreferences().setKeepUpdated(checked);
|
||||
feed.savePreferences(FeedInfoActivity.this);
|
||||
feed.savePreferences();
|
||||
});
|
||||
spnAutoDelete.setOnItemSelectedListener(new OnItemSelectedListener() {
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package de.danoeh.antennapod.core.feed;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
|
@ -21,9 +20,9 @@ import de.danoeh.antennapod.core.util.flattr.FlattrThing;
|
|||
* @author daniel
|
||||
*/
|
||||
public class Feed extends FeedFile implements FlattrThing, ImageResource {
|
||||
|
||||
public static final int FEEDFILETYPE_FEED = 0;
|
||||
public static final String TYPE_RSS2 = "rss";
|
||||
public static final String TYPE_RSS091 = "rss";
|
||||
public static final String TYPE_ATOM1 = "atom";
|
||||
|
||||
/* title as defined by the feed */
|
||||
|
@ -221,33 +220,6 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource {
|
|||
return feed;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns true if at least one item in the itemlist is unread.
|
||||
*
|
||||
*/
|
||||
public boolean hasNewItems() {
|
||||
for (FeedItem item : items) {
|
||||
if (item.isNew()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if at least one item in the itemlist is unread.
|
||||
*
|
||||
*/
|
||||
public boolean hasUnplayedItems() {
|
||||
for (FeedItem item : items) {
|
||||
if (!item.isNew() && !item.isPlayed()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of FeedItems.
|
||||
*
|
||||
|
@ -511,7 +483,7 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource {
|
|||
return preferences;
|
||||
}
|
||||
|
||||
public void savePreferences(Context context) {
|
||||
public void savePreferences() {
|
||||
DBWriter.setFeedPreferences(preferences);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue