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
|
@Override
|
||||||
public int getTypeAsInt() {
|
public int getTypeAsInt() {
|
||||||
return FEEDFILETYPE_FEED;
|
return FEEDFILETYPE_FEED;
|
||||||
|
|
|
@ -41,6 +41,21 @@ public class FeedItem extends FeedComponent {
|
||||||
this.read = true;
|
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. */
|
/** Get the chapter that fits the position. */
|
||||||
public Chapter getCurrentChapter(int position) {
|
public Chapter getCurrentChapter(int position) {
|
||||||
Chapter current = null;
|
Chapter current = null;
|
||||||
|
|
|
@ -774,6 +774,7 @@ public class FeedManager {
|
||||||
PodDBAdapter adapter = new PodDBAdapter(context);
|
PodDBAdapter adapter = new PodDBAdapter(context);
|
||||||
adapter.open();
|
adapter.open();
|
||||||
adapter.setCompleteFeed(feed);
|
adapter.setCompleteFeed(feed);
|
||||||
|
feed.cacheDescriptionsOfItems();
|
||||||
adapter.close();
|
adapter.close();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -867,6 +868,7 @@ public class FeedManager {
|
||||||
public void setFeed(Feed feed, PodDBAdapter adapter) {
|
public void setFeed(Feed feed, PodDBAdapter adapter) {
|
||||||
if (adapter != null) {
|
if (adapter != null) {
|
||||||
adapter.setFeed(feed);
|
adapter.setFeed(feed);
|
||||||
|
feed.cacheDescriptionsOfItems();
|
||||||
} else {
|
} else {
|
||||||
Log.w(TAG, "Adapter in setFeed was null");
|
Log.w(TAG, "Adapter in setFeed was null");
|
||||||
}
|
}
|
||||||
|
@ -914,6 +916,7 @@ public class FeedManager {
|
||||||
PodDBAdapter adapter = new PodDBAdapter(context);
|
PodDBAdapter adapter = new PodDBAdapter(context);
|
||||||
adapter.open();
|
adapter.open();
|
||||||
adapter.setFeed(feed);
|
adapter.setFeed(feed);
|
||||||
|
feed.cacheDescriptionsOfItems();
|
||||||
adapter.close();
|
adapter.close();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue