We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
static class AutoLoopTask implements Runnable { private final WeakReference reference;
AutoLoopTask(Banner banner) { this.reference = new WeakReference<>(banner); } @Override public void run() { Banner banner = reference.get(); if (banner != null && banner.mIsAutoLoop) { int count = banner.getItemCount(); if (count == 0) { return; } int next = (banner.getCurrentItem() + 1) % count; banner.setCurrentItem(next); banner.postDelayed(banner.mLoopTask, banner.mLoopTime); } } }
建议添加一下,如果有且只有一条数据,就不要再发送postDelayed了
The text was updated successfully, but these errors were encountered:
这里最大的问题是,需要在执行postDelayed()前 banner.removeCallbacks(banner.mLoopTask); 不然低性能的设备上会出现单次连续执行任务
Sorry, something went wrong.
No branches or pull requests
static class AutoLoopTask implements Runnable {
private final WeakReference reference;
建议添加一下,如果有且只有一条数据,就不要再发送postDelayed了
The text was updated successfully, but these errors were encountered: