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