Search in sources :

Example 1 with ReadingListBookmarkMenu

use of org.wikipedia.readinglist.ReadingListBookmarkMenu in project apps-android-wikipedia by wikimedia.

the class RandomFragment method onSaveShareClick.

@OnClick(R.id.random_save_button)
void onSaveShareClick() {
    PageTitle title = getTopTitle();
    if (title == null) {
        return;
    }
    if (saveButtonState) {
        new ReadingListBookmarkMenu(saveButton, new ReadingListBookmarkMenu.Callback() {

            @Override
            public void onAddRequest(@Nullable ReadingListPage page) {
                onAddPageToList(title);
            }

            @Override
            public void onDeleted(@Nullable ReadingListPage page) {
                FeedbackUtil.showMessage(getActivity(), getString(R.string.reading_list_item_deleted, title.getDisplayText()));
                updateSaveShareButton(title);
            }

            @Override
            public void onShare() {
            // ignore
            }
        }).show(title);
    } else {
        onAddPageToList(title);
    }
}
Also used : ReadingListBookmarkMenu(org.wikipedia.readinglist.ReadingListBookmarkMenu) PageTitle(org.wikipedia.page.PageTitle) ReadingListPage(org.wikipedia.readinglist.database.ReadingListPage) Nullable(android.support.annotation.Nullable) OnClick(butterknife.OnClick)

Aggregations

Nullable (android.support.annotation.Nullable)1 OnClick (butterknife.OnClick)1 PageTitle (org.wikipedia.page.PageTitle)1 ReadingListBookmarkMenu (org.wikipedia.readinglist.ReadingListBookmarkMenu)1 ReadingListPage (org.wikipedia.readinglist.database.ReadingListPage)1