yanzhenjie / Album

:watermelon: Album and Gallery for Android platform.
https://github.com/yanzhenjie/Album
Apache License 2.0
2.51k stars 507 forks source link

设置.filterMimeType,过滤掉gif,但并没有起作用,然而过滤Jpeg或png都正常,如下: #195

Open gyb3320 opened 6 years ago

gyb3320 commented 6 years ago

我引用的是2.1.1版本: Album.image(this) .singleChoice() .filterMimeType(new Filter() { // MimeType of File. @Override public boolean filter(String attributes) { // MimeType: image/jpeg, image/png, video/mp4, video/3gp... return attributes.contains("gif"); } })

yanzhenjie commented 6 years ago

这个不是bug吧,你可以把所有的属性打印出来看看,处理的是否严谨。

gyb3320 commented 6 years ago

ok,按照你的思路指引,已解决,方法如下: Album.image(this).filterMimeType(new Filter() { // MimeType of File. @Override public boolean filter(String attributes) { // MimeType: image/jpeg, image/png, video/mp4, video/3gp... return attributes.contains("octet-stream");//该句话过滤掉GIF } })