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
LoadingDrawable + Fresco + RecyclerView 场景:RecyclerView 加载两列,每个Item使用Fresco自带的View; setProgressImage(LoadingDrawable); 目标:使用LoadingDrawable,实现Fresco加载过程的动画,即:LoadingDrawable一直播放,指导Fresco加载完成,加载完图片
问题:LoadingDrawable变形了。 分析可能原因:Fresco因为RecyclerView导致,给定LoadingDrawable的高度和宽度,比例变成了,2:1;导致LoadingDrawable变形了
The text was updated successfully, but these errors were encountered:
解决方案:LoadingDrawable中,有一个系统回调: protected void onBoundsChange(Rect bounds)
该方法中,对bounds进行校对,即:匹配成宽高比为,1:1
具体为:LoadingDrawable.java @OverRide protected void onBoundsChange(Rect bounds) { super.onBoundsChange(bounds);
int width = bounds.width(); int height = bounds.height(); int minSize = Math.min(Math.abs(width), Math.abs(height)); int right = bounds.left + (width > 0 ? minSize : -minSize); int bottom = bounds.top + (height > 0 ? minSize : -minSize); this.mLoadingRender.setBounds(new Rect(bounds.left, bounds.top, right, bottom)); }
Sorry, something went wrong.
No branches or pull requests
LoadingDrawable + Fresco + RecyclerView
场景:RecyclerView 加载两列,每个Item使用Fresco自带的View;
setProgressImage(LoadingDrawable);
目标:使用LoadingDrawable,实现Fresco加载过程的动画,即:LoadingDrawable一直播放,指导Fresco加载完成,加载完图片
问题:LoadingDrawable变形了。 分析可能原因:Fresco因为RecyclerView导致,给定LoadingDrawable的高度和宽度,比例变成了,2:1;导致LoadingDrawable变形了
The text was updated successfully, but these errors were encountered: