Beispiel #1
0
  @Override
  public BaseGLSurfaceView initView() {
    Log.d("[MainView]", "initView");
    this.setBkgColor(
        Settings.bkgColorA, Settings.bkgColorR, Settings.bkgColorG, Settings.bkgColorB);

    // mFPS = new FPSObj(this);
    // layerMgr.insertDrawable(mFPS);

    bookName =
        new StaticTextObj(
            this, mContext.getResources().getString(R.string.BOOK_NAME), Settings.FONTSIZE * 3 / 4);
    bookName.setPos((int) ((this.viewWidth - bookName.getWidth()) / 2), 0);
    layerMgr.insertDrawable(bookName);

    nowTime = new TimeObj(this, Settings.FONTSIZE * 3 / 4);
    nowTime.setPos(padLeft, 0);
    layerMgr.insertDrawable(nowTime);

    percentage =
        new StaticTextObj(
            this,
            String.format(
                    "%.1f", FileHelper.getPercentage(mContext, Settings.FILENAME, Settings.OFFSET))
                + "%",
            Settings.FONTSIZE * 3 / 4);
    percentage.setPos((int) (this.viewWidth - padLeft - percentage.getWidth()), 0);
    layerMgr.insertDrawable(percentage);

    createCurrentPage();
    return this;
  }
Beispiel #2
0
  private void createCurrentPage() {
    currentPage = new PageObj(this, viewWidth - 2 * padLeft, viewHeight - 2 * (padTop + padButtom));
    currentPage.setPos(padLeft, padButtom);
    layerMgr.insertDrawable(currentPage);

    ((StaticTextObj) percentage)
        .setText(
            String.format(
                    "%.1f", FileHelper.getPercentage(mContext, Settings.FILENAME, Settings.OFFSET))
                + "%");
    percentage.setPos((int) (this.viewWidth - padLeft - percentage.getWidth()), 0);
  }