本文整理汇总了Java中org.geometerplus.fbreader.book.SerializerUtil类的典型用法代码示例。如果您正苦于以下问题:Java SerializerUtil类的具体用法?Java SerializerUtil怎么用?Java SerializerUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SerializerUtil类属于org.geometerplus.fbreader.book包,在下文中一共展示了SerializerUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openBook
import org.geometerplus.fbreader.book.SerializerUtil; //导入依赖的package包/类
private synchronized void openBook(Intent intent, Runnable action, boolean force)
{
if (!force && myBook != null) { return; }
myBook = SerializerUtil.deserializeBook(intent.getStringExtra(BOOKMARK_KEY));
final Bookmark bookmark = SerializerUtil.deserializeBookmark(intent.getStringExtra(BOOKMARK_KEY));
String fromIntentBookKey = intent.getStringExtra(BOOK_KEY);
if (!TextUtils.isEmpty(fromIntentBookKey))
{
myBook = createBookForFile(ZLFile.createFileByPath(fromIntentBookKey));
}
else
{
if (myBook == null)
{
final Uri data = intent.getData();
if (data != null)
{
myBook = createBookForFile(ZLFile.createFileByPath(data.getPath()));
}
}
}
boolean gotoPosition = getIntent().getBooleanExtra("goto_position", true);
myFBReaderApp.openBook(myBook, bookmark, action, gotoPosition);
}
示例2: onStart
import org.geometerplus.fbreader.book.SerializerUtil; //导入依赖的package包/类
@Override
protected void onStart() {
super.onStart();
myCollection.bindToService(this, new Runnable() {
public void run() {
myExistingBookmark = getIntent().getBooleanExtra(EXISTING_BOOKMARK_KEY, false);
myBookmark = SerializerUtil.deserializeBookmark(
getIntent().getStringExtra(CoreReadActivity.BOOKMARK_KEY)
);
if (myBookmark == null) {
finish();
return;
}
final List<HighlightingStyle> styles = myCollection.highlightingStyles();
if (styles.isEmpty()) {
finish();
return;
}
final ActionListAdapter adapter = new ActionListAdapter(styles);
setListAdapter(adapter);
getListView().setOnItemClickListener(adapter);
myCollection.addListener(StyleListActivity.this);
}
});
}
示例3: onCreate
import org.geometerplus.fbreader.book.SerializerUtil; //导入依赖的package包/类
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
// Thread.setDefaultUncaughtExceptionHandler(new
// org.geometerplus.zlibrary.ui.android.library.UncaughtExceptionHandler(this));
//requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
// requestWindowFeature(Window.FEATURE_NO_TITLE);
setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
// ADD ACTIONBAR
bar = this.getActionBar();
bar.setTitle("书签管理");
bar.setDisplayHomeAsUpEnabled(true);
bar.setDisplayShowHomeEnabled(true);
bar.setDisplayShowTitleEnabled(true);
//
final SearchManager manager = (SearchManager) getSystemService(SEARCH_SERVICE);
manager.setOnCancelListener(null);
final TabHost host = getTabHost();
LayoutInflater.from(this).inflate(R.layout.bookmarks,
host.getTabContentView(), true);
myBook = SerializerUtil.deserializeBook(getIntent().getStringExtra(
CoreReadActivity.BOOK_KEY));
}
示例4: onReceive
import org.geometerplus.fbreader.book.SerializerUtil; //导入依赖的package包/类
public void onReceive(Context context, Intent intent) {
if (!hasListeners()) {
return;
}
try {
final String type = intent.getStringExtra("type");
if (LibraryService.BOOK_EVENT_ACTION.equals(intent.getAction())) {
final Book book = SerializerUtil.deserializeBook(intent.getStringExtra("book"));
fireBookEvent(BookEvent.valueOf(type), book);
} else {
fireBuildEvent(Status.valueOf(type));
}
} catch (Exception e) {
// ignore
}
}
示例5: onCreate
import org.geometerplus.fbreader.book.SerializerUtil; //导入依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
if (myRootTree == null) {
myRootTree = new RootTree(new BookCollectionShadow());
}
myRootTree.Collection.addListener(this);
mySelectedBook =
SerializerUtil.deserializeBook(getIntent().getStringExtra(CoreReadActivity.BOOK_KEY));
new LibraryTreeAdapter(this);
init(getIntent());
getListView().setTextFilterEnabled(true);
getListView().setOnCreateContextMenuListener(this);
((BookCollectionShadow)myRootTree.Collection).bindToService(this, new Runnable() {
public void run() {
setProgressBarIndeterminateVisibility(!myRootTree.Collection.status().IsCompleted);
}
});
}
示例6: openBook
import org.geometerplus.fbreader.book.SerializerUtil; //导入依赖的package包/类
private synchronized void openBook(Intent intent, Runnable action,
boolean force) {
if (!force && myBook != null) {
return;
}
myBook = SerializerUtil
.deserializeBook(intent.getStringExtra(BOOK_KEY));
final Bookmark bookmark = SerializerUtil.deserializeBookmark(intent
.getStringExtra(BOOKMARK_KEY));
if (myBook == null) {
final Uri data = intent.getData();
if (data != null) {
this.myBook = createBookForFile(ZLFile.createFileByPath(data
.getPath()));
}
}
myFBReaderApp.openBook(myBook, bookmark, action);
}
示例7: onItemClick
import org.geometerplus.fbreader.book.SerializerUtil; //导入依赖的package包/类
public final void onItemClick(AdapterView<?> parent, View view, int position, long id) {
final Intent data = new Intent();
final CancelMenuHelper.ActionDescription item = getItem(position);
data.putExtra(TYPE_KEY, item.Type.name());
if (item instanceof CancelMenuHelper.BookmarkDescription) {
data.putExtra(
BOOKMARK_KEY,
SerializerUtil.serialize(((CancelMenuHelper.BookmarkDescription)item).Bookmark)
);
}
setResult(RESULT_FIRST_USER, data);
finish();
}
示例8: startBookmarksActivity
import org.geometerplus.fbreader.book.SerializerUtil; //导入依赖的package包/类
private void startBookmarksActivity(Intent intent) {
intent.putExtra(
CoreReadActivity.BOOK_KEY, SerializerUtil.serialize(Reader.Model.Book)
);
intent.putExtra(
CoreReadActivity.BOOKMARK_KEY, SerializerUtil.serialize(Reader.createBookmark(20, true))
);
OrientationUtil.startActivity(BaseActivity, intent);
}
示例9: addBookmark
import org.geometerplus.fbreader.book.SerializerUtil; //导入依赖的package包/类
private void addBookmark() {
final Bookmark bookmark = SerializerUtil
.deserializeBookmark(getIntent().getStringExtra(
CoreReadActivity.BOOKMARK_KEY));
if (bookmark != null) {
myCollection.saveBookmark(bookmark);
myThisBookAdapter.add(bookmark);
myAllBooksAdapter.add(bookmark);
}
}
示例10: books
import org.geometerplus.fbreader.book.SerializerUtil; //导入依赖的package包/类
public synchronized List<Book> books(BookQuery query) {
if (myInterface == null) {
return Collections.emptyList();
}
try {
return SerializerUtil.deserializeBookList(myInterface.books(SerializerUtil.serialize(query)));
} catch (RemoteException e) {
return Collections.emptyList();
}
}
示例11: hasBooks
import org.geometerplus.fbreader.book.SerializerUtil; //导入依赖的package包/类
public synchronized boolean hasBooks(Filter filter) {
if (myInterface == null) {
return false;
}
try {
return myInterface.hasBooks(SerializerUtil.serialize(new BookQuery(filter, 1)));
} catch (RemoteException e) {
return false;
}
}
示例12: recentBooks
import org.geometerplus.fbreader.book.SerializerUtil; //导入依赖的package包/类
public synchronized List<Book> recentBooks() {
if (myInterface == null) {
return Collections.emptyList();
}
try {
return SerializerUtil.deserializeBookList(myInterface.recentBooks());
} catch (RemoteException e) {
return Collections.emptyList();
}
}
示例13: getRecentBook
import org.geometerplus.fbreader.book.SerializerUtil; //导入依赖的package包/类
public synchronized Book getRecentBook(int index) {
if (myInterface == null) {
return null;
}
try {
return SerializerUtil.deserializeBook(myInterface.getRecentBook(index));
} catch (RemoteException e) {
return null;
}
}
示例14: getBookByFile
import org.geometerplus.fbreader.book.SerializerUtil; //导入依赖的package包/类
public synchronized Book getBookByFile(ZLFile file) {
if (myInterface == null) {
return null;
}
try {
return SerializerUtil.deserializeBook(myInterface.getBookByFile(file.getPath()));
} catch (RemoteException e) {
return null;
}
}
示例15: getBookById
import org.geometerplus.fbreader.book.SerializerUtil; //导入依赖的package包/类
public synchronized Book getBookById(long id) {
if (myInterface == null) {
return null;
}
try {
return SerializerUtil.deserializeBook(myInterface.getBookById(id));
} catch (RemoteException e) {
return null;
}
}