Glide除了常用的加载带有后缀名的url,对于没有后缀名的文件流格式该如何显示?
比如:http://10.19.98.163:8081/tanka/v1/content/auth/thumbnail?mediaId=mxc://ryJpIbsfMPbufZRHrRKKhRvp&width=200&height=200
废话不多说,直接上代码:
String url = "http://10.19.98.163:8081/tanka/v1/content/auth/thumbnail?mediaId=mxc://ryJpIbsfMPbufZRHrRKKhRvp&width=200&height=200"
GlideUrl glideUrl = new GlideUrl(url, new LazyHeaders.Builder()
.addHeader("clientToken", "QHRhbmthLnFpYW54dT00MHNoYW5kYS5j0cml4LnRhbmthLWRldi5hcHAubnBjLndvcmtAQDo6LTo6QE==")
.addHeader("deviceId","112244")
.addHeader("deviceType","2")
.build());
Glide.with(this).load(glideUrl).into(new SimpleTarget<Drawable>() {
@Override
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
imgView.setImageDrawable(resource);
}
});
网友评论