Desmond Yao

Results 14 comments of Desmond Yao

Yes, it is. You can just take padding property value by content's attributes, and apply it in your it in your `onLayout()` :)

@XavierSAndroid 谢谢你的建议。 确实对于ChrisBanes的PTR可能刻薄了点,但是相比于在gradle里面添加一个依赖,我直接传一个View或者XML简单配置一下就能够达到的自定义效果,ChrisBanes那套需要整个代码copy进来并且extend它的LoadingLayout。这额外工作让我对它感觉大幅降低。 第二点建议很不错,我会将他们加入到我的评论中,谢谢:)

@ChenSiLiang 我看了你在Fresco的issue,老外可能觉得你会oom不告诉你方法= = 这个问题我这几天看下来有一种解决方法,亲测可行: ``` ControllerListener listener = new BaseControllerListener(){ @Override public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable animatable) { super.onFinalImageSet(id, imageInfo, animatable); if(imageInfo instanceof CloseableAnimatedImage){ AnimatedImageResult result = ((CloseableAnimatedImage)...

@ChenSiLiang 这个场景有点复杂,祝你好运~ 有啥图片加载方面的问题可以一起研究:)

@zhanxiuwen `draweeController.getHierarchy() .getTopLevelDrawable()`是无法获取你的目标图片的,因为它是一个`ArrayDrawable`,里面含有一个`Drawable`数组,数组中的某一个才是你的目标图片。如果真的想对图片做处理,可以这样: ``` ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse("url")) .setPostprocessor((new BasePostprocessor() { @Override public void process(Bitmap bitmap) { super.process(bitmap); //它就是你要的bitmap,在这里处理 } }).build(); DraweeController controller = Fresco.newDraweeControllerBuilder() .setImageRequest(request) .build(); draweeView.setController(controller); ```

@zhanxiuwen 方便的话把相关代码贴出来?这么说我无法知道问题的原因

@huli1987 仅某个情况用时,你可以只清除指定url的缓存: ``` java final ImageRequest request = ImageRequest.fromUri(Uri.parse("url")); CacheKey cacheKey = DefaultCacheKeyFactory.getInstance().getEncodedCacheKey(request); StagingArea.getInstance().remove(cacheKey); Fresco.getImagePipelineFactory().getMainDiskStorageCache().remove(cacheKey); ``` 你一定要达到这种目的的话,可以在`ImageRequest`设置最低缓存层级,禁止这次的请求获取缓存内容,但是它至少会检查内存缓存。 ``` java ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse("url")) .setLowestPermittedRequestLevel(ImageRequest.RequestLevel.BITMAP_MEMORY_CACHE) .build(); ``` 如果一定要全局这么搞,你可以在初始化的时候设置CacheKeyFactory给ImagePipelineConfig,让它每次返回不同的缓存key,就能达到你的目的了

是这样的,命令行到sdk/platform-tools/systrace下,输入systrace命令: python systrace.py --time=1 -o mynewtrace.html sched gfx view wm 然后马上开始你的操作,它会在1秒钟之后停止截取并输出文件。 这条命令意思就是: - --time=1 监视接下来1秒的操作 - -o mynewtrace.html 文件存储到mynewtrace.html - 检测Graphic, View, WindowManager,并输出Task名字 具体可以看参考3:[systrace-doc](http://developer.android.com/tools/help/systrace.html)

@BlakeWL 谢谢,有什么建议随时交流:)

是手动的,也可以通过代码。手动与代码各有得失(当然,手动非常简单),在重点看systrace中的各项**时间分布**,而不重点看**具体时间**时,我觉得手动足够展示出各个库的区别了。而时间分布确实是我本次考察的重点,因为各个开源库顶部视图不同,代码复杂程度也不同,只能通过trace时间分布的合理性来判断性能。