目录
Glide中文文档:https://muyangmin.github.io/glide-docs-cn/#glide-v4-android-english-tip
Glide API:https://muyangmin.github.io/glide-docs-cn/javadocs/480/index.html
implementation 'com.github.bumptech.glide:glide:4.8.0'
ImageView imageView = (ImageView) findViewById(R.id.img_show);
String imgUrl1 = "https://i.imgur.com/CqmBjo5.jpg";
Glide.with(context).load(imgUrl1).into(imageView);
ImageView imageView = (ImageView) findViewById(R.id.img_show);
String imgUrl2 = "https://i.imgur.com/0gqnEaY.jpg";
Glide.with(context).load(Uri.parse(imgUrl2)).into(imageView);
ImageView imageView = (ImageView) findViewById(R.id.img_show);
String imgUrl3 = Environment.getExternalStorageDirectory().getPath() + "/img3.jpg";
File file = new File(imgUrl3);
Glide.with(context).load(file).into(imageView);
ImageView imageView = (ImageView) findViewById(R.id.img_show);
Glide.with(context).load("file:///android_asset/img5.jpg").into(imageView);
ImageView imageView = (ImageView) findViewById(R.id.img_show);
Glide.with(context).load(R.mipmap.img1).into(imageView);
ImageView imageView = (ImageView) findViewById(R.id.img_show);
Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(),R.mipmap.img_error);
Glide.with(context).load(bitmap).into(imageView);
ImageView imageView = (ImageView) findViewById(R.id.img_show);
Drawable drawable = getResources().getDrawable(R.mipmap.img1);
Glide.with(context).load(drawable).into(imageView);
Glide.with(context).clear(imageView);