Search in sources :

Example 1 with MainPageReadMoreTopicTask

use of org.wikipedia.page.bottomcontent.MainPageReadMoreTopicTask in project apps-android-wikipedia by wikimedia.

the class BecauseYouReadClient method request.

@Override
public void request(@NonNull Context context, @NonNull final WikiSite wiki, int age, @NonNull final FeedClient.Callback cb) {
    cancel();
    readMoreTopicTask = new MainPageReadMoreTopicTask(age) {

        @Override
        public void onFinish(@Nullable HistoryEntry entry) {
            if (entry == null) {
                cb.success(Collections.emptyList());
                return;
            }
            getCardForHistoryEntry(entry, cb);
        }

        @Override
        public void onCatch(Throwable caught) {
            L.e("Error fetching 'because you read' suggestions", caught);
            cb.error(caught);
        }
    };
    readMoreTopicTask.execute();
}
Also used : HistoryEntry(org.wikipedia.history.HistoryEntry) MainPageReadMoreTopicTask(org.wikipedia.page.bottomcontent.MainPageReadMoreTopicTask)

Aggregations

HistoryEntry (org.wikipedia.history.HistoryEntry)1 MainPageReadMoreTopicTask (org.wikipedia.page.bottomcontent.MainPageReadMoreTopicTask)1