gpt4 book ai didi

com.koolearn.klibrary.core.view.ZLView.onScrollingFinished()方法的使用及代码示例

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

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

ZLView.onScrollingFinished介绍

暂无

代码示例

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

@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
  super.onSizeChanged(w, h, oldw, oldh);
  // 新打开时调用
  getAnimationProvider().terminate();
  if (myScreenIsTouched) {
    // 手指触摸屏幕,并旋转手机
    final ZLView view = ZLApplication.Instance().getCurrentView();
    myScreenIsTouched = false;
    view.onScrollingFinished(ZLView.PageIndex.current);
  }
}

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

@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
  super.onSizeChanged(w, h, oldw, oldh);
  // 新打开时调用
  getAnimationProvider().terminate();
  if (myScreenIsTouched) {
    // 手指触摸屏幕,并旋转手机
    final ZLView view = ZLApplication.Instance().getCurrentView();
    myScreenIsTouched = false;
    view.onScrollingFinished(ZLView.PageIndex.current);
  }
}

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

@Override
public void shift(int paramBoolean) {
  switch (paramBoolean){
    case CurlView.CURL_RIGHT:
      forwardShift(true);
      ZLApplication.Instance().getCurrentView().onScrollingFinished(ZLView.PageIndex.next);
      break;
    case CurlView.CURL_LEFT:
      forwardShift(false);
      ZLApplication.Instance().getCurrentView().onScrollingFinished(ZLView.PageIndex.previous);
      break;
    case CurlView.CURL_NONE:
      ZLApplication.Instance().getCurrentView().onScrollingFinished(ZLView.PageIndex.current);
      break;
  }
}

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

@Override
public void shift(int paramBoolean) {
  switch (paramBoolean){
    case CurlView.CURL_RIGHT:
      forwardShift(true);
      ZLApplication.Instance().getCurrentView().onScrollingFinished(ZLView.PageIndex.next);
      break;
    case CurlView.CURL_LEFT:
      forwardShift(false);
      ZLApplication.Instance().getCurrentView().onScrollingFinished(ZLView.PageIndex.previous);
      break;
    case CurlView.CURL_NONE:
      ZLApplication.Instance().getCurrentView().onScrollingFinished(ZLView.PageIndex.current);
      break;
  }
}

代码示例来源: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);
  }
}

代码示例来源: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);
  }
}

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