Пример #1
0
 private void onLoadChapterFailure(int chapter)
 {
     if (listener != null)
     {
         listener.onLoadChapterFailure(chapter);
     }
 }
Пример #2
0
 public /*synchronized*/ void init(int theme)
 {
     if (!isPrepared)
     {
         try {
             pagefactory.setBgBitmap(ThemeManager.getThemeDrawable(theme));
             // 自动跳转到上次阅读位置
             int[] pos = Settings.GetReadProgress(bookId);
             int   ret = pagefactory.openBook(pos[0], new int[] { pos[1], pos[2] });
             LogUtils.i("上次阅读位置:chapter=" + pos[0] + " startPos=" + pos[1] + " endPos=" + pos[2]);
             if (ret == 0)
             {
                 listener.onLoadChapterFailure(pos[0]);
                 return;
             }
             pagefactory.onDraw(mCurrentPageCanvas);
             PostInvalidate();
         } catch (Java.Lang.Exception e) {
         }
         isPrepared = true;
     }
 }