Skip to content
New issue

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

切换动画丢失 #143

Open
sichuanyl opened this issue Nov 6, 2019 · 5 comments
Open

切换动画丢失 #143

sichuanyl opened this issue Nov 6, 2019 · 5 comments

Comments

@sichuanyl
Copy link

version:all

question:使用在列表中,滑出界面再滑回来后第一次自动轮播切换动画丢失(view内容直接替换没有动画,不自然),第二次切换恢复transform动画,

模式 app:isClipChildrenMode="true"

adapter中:
override fun onViewDetachedFromWindow(holder: KotlinBaseViewHolder) {
super.onViewDetachedFromWindow(holder)
with(holder.itemView) {
xb_banner?.stopAutoPlay()
}
}

override fun onViewAttachedToWindow(holder: KotlinBaseViewHolder) {
    super.onViewAttachedToWindow(holder)
    with(holder.itemView) {
        xb_banner?.startAutoPlay()
    }
}

这点在使用时该怎样解决?

@sichuanyl
Copy link
Author

onBindViewHolder中这样写的:
override fun onBindViewHolder(holder: KotlinBaseViewHolder, position: Int) {
with(holder.itemView) {
if (xb_banner?.viewPager?.adapter == null) {
xb_banner?.setBannerData(R.layout.item_today_rec, dataList)
xb_banner?.viewPager?.overScrollMode = View.OVER_SCROLL_NEVER
xb_banner?.setPointsIsVisible(false)
xb_banner?.setViewPagerMargin(21)
xb_banner?.loadImage { _, item, view, position ->
with(view) {
ImageLoader.instance.loadWithResize(
context,
iv_cover,
(item as SimpleBannerInfo).xBannerUrl.toString(),
ImageLoader.baseSimpleWidth * 4,
ImageLoader.baseSimpleHeight * 4
)
}
view.setOnClickListener {
}
}
}
xb_banner?.startAutoPlay()
}
}

@xiaohaibin
Copy link
Owner

stopAutoPlay() starAutoplay方法可以不用自己单独去调用,框架已经增加了判断,会根据屏幕状态去判断

@sichuanyl
Copy link
Author

sichuanyl commented Nov 11, 2019 via email

@Juziwsw
Copy link

Juziwsw commented Nov 27, 2019

动画丢失问题也遇到了,请问解决了吗

@sichuanyl
Copy link
Author

sichuanyl commented Nov 27, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants