use of org.geometerplus.fbreader.book.Bookmark in project FBReaderJ by geometer.
the class SelectionBookmarkAction method run.
@Override
protected void run(Object... params) {
final Bookmark bookmark;
if (params.length != 0) {
bookmark = (Bookmark) params[0];
} else {
bookmark = Reader.addSelectionBookmark();
}
if (bookmark == null) {
return;
}
final SuperActivityToast toast = new SuperActivityToast(BaseActivity, SuperToast.Type.BUTTON);
toast.setText(bookmark.getText());
toast.setDuration(SuperToast.Duration.EXTRA_LONG);
toast.setButtonIcon(android.R.drawable.ic_menu_edit, ZLResource.resource("dialog").getResource("button").getResource("edit").getValue());
toast.setOnClickWrapper(new OnClickWrapper("bkmk", new SuperToast.OnClickListener() {
@Override
public void onClick(View view, Parcelable token) {
final Intent intent = new Intent(BaseActivity.getApplicationContext(), EditBookmarkActivity.class);
FBReaderIntents.putBookmarkExtra(intent, bookmark);
OrientationUtil.startActivity(BaseActivity, intent);
}
}));
BaseActivity.showToast(toast);
}
Aggregations