Beispiel #1
0
  private void onDrawInScrolling(Canvas canvas) {
    final ZLView view = ZLApplication.Instance().getCurrentView();

    //		final int w = getWidth();
    //		final int h = getMainAreaHeight();

    final AnimationProvider animator = getAnimationProvider();
    final AnimationProvider.Mode oldMode = animator.getMode();
    animator.doStep();
    if (animator.inProgress()) {
      animator.draw(canvas);
      if (animator.getMode().Auto) {
        postInvalidate();
      }
      drawFooter(canvas);
    } else {
      switch (oldMode) {
        case AnimatedScrollingForward:
          {
            final ZLView.PageIndex index = animator.getPageToScrollTo();
            myBitmapManager.shift(index == ZLView.PageIndex.next);
            view.onScrollingFinished(index);
            ZLApplication.Instance().onRepaintFinished();
            break;
          }
        case AnimatedScrollingBackward:
          view.onScrollingFinished(ZLView.PageIndex.current);
          break;
      }
      onDrawStatic(canvas);
    }
  }
Beispiel #2
0
 private void onDrawStatic(final Canvas canvas) {
   myBitmapManager.setSize(getWidth(), getMainAreaHeight());
   canvas.drawBitmap(myBitmapManager.getBitmap(ZLView.PageIndex.current), 0, 0, myPaint);
   drawFooter(canvas);
   new Thread() {
     @Override
     public void run() {
       final ZLView view = ZLApplication.Instance().getCurrentView();
       final ZLAndroidPaintContext context =
           new ZLAndroidPaintContext(
               canvas,
               getWidth(),
               getMainAreaHeight(),
               view.isScrollbarShown() ? getVerticalScrollbarWidth() : 0);
       view.preparePage(context, ZLView.PageIndex.next);
     }
   }.start();
 }
Beispiel #3
0
 @Override
 public void reset() {
   myBitmapManager.reset();
 }