Renamed methods
This commit is contained in:
parent
fb4ba95789
commit
bd1b07150b
|
@ -144,6 +144,15 @@ public class Feed extends FeedFile {
|
|||
}
|
||||
}
|
||||
|
||||
/** Calls cacheDescriptions on all items. */
|
||||
protected void cacheDescriptionsOfItems() {
|
||||
if (items != null) {
|
||||
for (FeedItem item : items) {
|
||||
item.cacheDescriptions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTypeAsInt() {
|
||||
return FEEDFILETYPE_FEED;
|
||||
|
|
|
@ -41,6 +41,21 @@ public class FeedItem extends FeedComponent {
|
|||
this.read = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the 'description' and 'contentEncoded' field of feeditem to their
|
||||
* SoftReference fields.
|
||||
*/
|
||||
protected void cacheDescriptions() {
|
||||
if (description != null) {
|
||||
cachedDescription = new SoftReference<String>(description);
|
||||
}
|
||||
if (contentEncoded != null) {
|
||||
cachedContentEncoded = new SoftReference<String>(contentEncoded);
|
||||
}
|
||||
description = null;
|
||||
contentEncoded = null;
|
||||
}
|
||||
|
||||
/** Get the chapter that fits the position. */
|
||||
public Chapter getCurrentChapter(int position) {
|
||||
Chapter current = null;
|
||||
|
|
|
@ -774,6 +774,7 @@ public class FeedManager {
|
|||
PodDBAdapter adapter = new PodDBAdapter(context);
|
||||
adapter.open();
|
||||
adapter.setCompleteFeed(feed);
|
||||
feed.cacheDescriptionsOfItems();
|
||||
adapter.close();
|
||||
}
|
||||
});
|
||||
|
@ -867,6 +868,7 @@ public class FeedManager {
|
|||
public void setFeed(Feed feed, PodDBAdapter adapter) {
|
||||
if (adapter != null) {
|
||||
adapter.setFeed(feed);
|
||||
feed.cacheDescriptionsOfItems();
|
||||
} else {
|
||||
Log.w(TAG, "Adapter in setFeed was null");
|
||||
}
|
||||
|
@ -914,6 +916,7 @@ public class FeedManager {
|
|||
PodDBAdapter adapter = new PodDBAdapter(context);
|
||||
adapter.open();
|
||||
adapter.setFeed(feed);
|
||||
feed.cacheDescriptionsOfItems();
|
||||
adapter.close();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue