@Override protected void onResume() { super.onResume(); Book book = Bookshelf.getCurrentBook(); tagManager = book.getTagManager(); tagManager.sort(); tags = Bookshelf.getCurrentBook().currentPage().tags; tagList.setTagSet(tags); tagCloud.setTagSet(tags); updateStatusBar(); }
protected void tagsChanged(boolean onlySelection) { tagList.notifyTagsChanged(); if (onlySelection) tagCloud.notifyTagSelectionChanged(); else tagCloud.notifyTagsChanged(); updateStatusBar(); Bookshelf.getCurrentBook().currentPage().touch(); }
@Override public void onClick(View v) { Bookshelf bookshelf = Bookshelf.getBookshelf(); BookshelfActivity activity = ((BookshelfActivity) getActivity()); switch (v.getId()) { case R.id.edit_notebook_button: BookPreview previous = Bookshelf.getCurrentBookPreview(); String title = text.getText().toString(); if (title.equals(Bookshelf.getCurrentBook().getTitle())) return; bookshelf.setCurrentBook(notebook); Book book = Bookshelf.getCurrentBook(); book.setTitle(title); // book.save(); bookshelf.setCurrentBook(previous); // notebook.reload(); activity.adapter.notifyDataSetChanged(); dismiss(); break; case R.id.edit_notebook_cancel: if (is_new_notebook_dialog) { Bookshelf.getBookshelf().deleteBook(notebook.getUUID()); activity.adapter.notifyDataSetChanged(); } dismiss(); break; case R.id.edit_notebook_export: bookshelf.setCurrentBook(notebook); Intent exportIntent = new Intent(getActivity(), ExportActivity.class); exportIntent.putExtra("filename", text.getText().toString()); startActivity(exportIntent); dismiss(); break; case R.id.edit_notebook_delete: dismiss(); activity.showDeleteConfirmationDialog(position); break; } }