Closed liujingxing closed 1 year ago
我看WebpDrawable构造方法是可以拿到Webp图片自身的loopCount,当这个loopCount大于0时,赋值给maxLoopCount是否更为合理,如下:
WebpDrawable(WebpState state) { this.isVisible = true; int intrinsicCount = state.frameLoader.getLoopCount(); this.maxLoopCount = intrinsicCount > 0 ? intrinsicCount : LOOP_FOREVER; this.state = Preconditions.checkNotNull(state); }
现在我想仅播放一次的话,还是略微有点麻烦,我大部分场景webp自身的loopCount都等于1
跟GifDrawable行为对齐的,大部分webp都没有设置loopCount
感觉很不合理,如果是这样的话,webp自带的loopCount就没有多大的意义; 顺便说下,Fresco就是优先取webp自带的loopCount,如果可以的话,还是希望支持下。
如果fresco用的webp自带的loopCount,可以优化对齐,可以提个修复MR
我看WebpDrawable构造方法是可以拿到Webp图片自身的loopCount,当这个loopCount大于0时,赋值给maxLoopCount是否更为合理,如下:
现在我想仅播放一次的话,还是略微有点麻烦,我大部分场景webp自身的loopCount都等于1