/**
* Glide 设置图片适应屏幕
*
* @param context
* @param view
* @param url
*/
public static void setGlideim(Context context, final View view, String url) {
Glide.with(context).load(url).into(new SimpleTarget<Drawable>() {
@Override
public void onResourceReady(Drawable resource, Transition<? super Drawable> transition) {
int w = resource.getMinimumWidth();
int h = resource.getMinimumHeight();
LogUtils.w("手机----------w" + ScreenUtils.getScreenWidth(), "33-----------w---" + w + "---------h--------" + h);
view.setLayoutParams(new LinearLayout.LayoutParams(ScreenUtils.getScreenWidth(), (ScreenUtils.getScreenWidth() * h) / w));//720*365
view.setBackground(resource);
}
});
}