Glide là thư viện load ảnh phổ biến (caching, placeholder, error, transform).
Dependency: implementation 'com.github.bumptech.glide:glide:4.x.x'.
Ví dụ các tính năng:
- Load drawable:
Glide.with(this).load(R.drawable.image).into(imageView); - Placeholder:
.placeholder(R.drawable.placeholder) - Load URL:
.load("https://...").placeholder(...) - Error:
.error(R.drawable.error) - Resize:
.apply(new RequestOptions().override(200,200)) - Rotate:
imageView.setRotation(90)(sau khi load)
UI: 6 button điều khiển các chế độ, 1 ImageView hiển thị.