gpt4 book ai didi

com.koolearn.klibrary.core.application.ZLApplication.onRepaintFinished()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 12:13:40 27 4
gpt4 key购买 nike

本文整理了Java中com.koolearn.klibrary.core.application.ZLApplication.onRepaintFinished()方法的一些代码示例,展示了ZLApplication.onRepaintFinished()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZLApplication.onRepaintFinished()方法的具体详情如下:
包路径:com.koolearn.klibrary.core.application.ZLApplication
类名称:ZLApplication
方法名:onRepaintFinished

ZLApplication.onRepaintFinished介绍

暂无

代码示例

代码示例来源:origin: ydcx/KooReader

@Override
public void onDraw(final Canvas canvas) {
  final Context context = getContext();
  if (context instanceof KooReader) {
    ((KooReader) context).createWakeLock();
  } else {
    System.err.println("A surprise: view's context is not an KooReader");
  }
  myBitmapManager.setSize(getWidth(), getHeight());
  if (getAnimationProvider().inProgress()) {
    onDrawInScrolling(canvas); // 翻页过程中调用
  } else {
    onDrawStatic(canvas); // 首次/页面跳转时调用,防止黑屏
    ZLApplication.Instance().onRepaintFinished();
  }
}

代码示例来源:origin: Jiangzqts/EpubRead

@Override
public void onDraw(final Canvas canvas) {
  final Context context = getContext();
  if (context instanceof KooReader) {
    ((KooReader) context).createWakeLock();
  } else {
    System.err.println("A surprise: view's context is not an KooReader");
  }
  myBitmapManager.setSize(getWidth(), getHeight());
  if (getAnimationProvider().inProgress()) {
    onDrawInScrolling(canvas); // 翻页过程中调用
  } else {
    onDrawStatic(canvas); // 首次/页面跳转时调用,防止黑屏
    ZLApplication.Instance().onRepaintFinished();
  }
}

代码示例来源:origin: ydcx/KooReader

private void onDrawInScrolling(Canvas canvas) {
  final ZLView view = ZLApplication.Instance().getCurrentView();
  final AnimationProvider animator = getAnimationProvider();
  final AnimationProvider.Mode oldMode = animator.getMode();
  animator.doStep();
  if (animator.inProgress()) { // 动画过程中执行
    animator.draw(canvas); // 动画绘制
    if (animator.getMode().Auto) { // 松手后完成后续绘制
      postInvalidate();
    }
  } else {                     // 动画结束后执行, 无动画情况只会调用这个
    switch (oldMode) {
      case AnimatedScrollingForward: { // 当翻到 下一页/上一页 时调用
        final ZLView.PageIndex index = animator.getPageToScrollTo(); // 得到翻页后的KooView 向左翻->next 向右翻->previous
        // 若为next     -> next->current,current->previous
        // 若为previous -> current->next,previous->current
        myBitmapManager.shift(index == ZLView.PageIndex.next);
        view.onScrollingFinished(index);
        ZLApplication.Instance().onRepaintFinished();
        break;
      }
      case AnimatedScrollingBackward: // 没有翻到 下一页/上一页 则还在当前页
        view.onScrollingFinished(ZLView.PageIndex.current);
        break;
    }
    onDrawStatic(canvas);
  }
}

代码示例来源:origin: Jiangzqts/EpubRead

private void onDrawInScrolling(Canvas canvas) {
  final ZLView view = ZLApplication.Instance().getCurrentView();
  final AnimationProvider animator = getAnimationProvider();
  final AnimationProvider.Mode oldMode = animator.getMode();
  animator.doStep();
  if (animator.inProgress()) { // 动画过程中执行
    animator.draw(canvas); // 动画绘制
    if (animator.getMode().Auto) { // 松手后完成后续绘制
      postInvalidate();
    }
  } else {                     // 动画结束后执行, 无动画情况只会调用这个
    switch (oldMode) {
      case AnimatedScrollingForward: { // 当翻到 下一页/上一页 时调用
        final ZLView.PageIndex index = animator.getPageToScrollTo(); // 得到翻页后的KooView 向左翻->next 向右翻->previous
        // 若为next     -> next->current,current->previous
        // 若为previous -> current->next,previous->current
        myBitmapManager.shift(index == ZLView.PageIndex.next);
        view.onScrollingFinished(index);
        ZLApplication.Instance().onRepaintFinished();
        break;
      }
      case AnimatedScrollingBackward: // 没有翻到 下一页/上一页 则还在当前页
        view.onScrollingFinished(ZLView.PageIndex.current);
        break;
    }
    onDrawStatic(canvas);
  }
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com