本文整理了Java中com.koolearn.klibrary.ui.android.view.ZLAndroidWidget.onDrawStatic()
方法的一些代码示例,展示了ZLAndroidWidget.onDrawStatic()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZLAndroidWidget.onDrawStatic()
方法的具体详情如下:
包路径:com.koolearn.klibrary.ui.android.view.ZLAndroidWidget
类名称:ZLAndroidWidget
方法名:onDrawStatic
暂无
代码示例来源: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);
}
}
内容来源于网络,如有侵权,请联系作者删除!