Bug 1234331 - Push bookmarked item into readercache when entering readermode r?margaret
If the user has already bookmarked a page and then enters readermode, we can presume
that they would like to read this page in readermode in future.
(Note that if you exit readermode again, we will remove the page from the readercache,
i.e. the bookmark returns to its normal state.)
MozReview-Commit-ID: GZ8Gkvs9Ygt
--- a/mobile/android/base/java/org/mozilla/gecko/Tab.java
+++ b/mobile/android/base/java/org/mozilla/gecko/Tab.java
@@ -746,16 +746,21 @@ public class Tab {
public void run() {
// tab.getURL() may return null
if (!TextUtils.equals(oldURL, getURL()))
return;
ThumbnailHelper.getInstance().getAndProcessThumbnailFor(tab);
}
}, 500);
+
+ // Ensure we store bookmarked pages in the readercache if we open them into readermode
+ if (success && isBookmark() && AboutPages.isAboutReader(oldURL)) {
+ ReadingListHelper.cacheReaderItem(ReaderModeUtils.stripAboutReaderUrl(oldURL), mAppContext);
+ }
}
void handleContentLoaded() {
setLoadProgressIfLoading(LOAD_PROGRESS_LOADED);
}
protected void saveThumbnailToDB(final BrowserDB db) {
final BitmapDrawable thumbnail = mThumbnail;