android-glide
How to make border for circle cropped image in glide
With compose Remember to add dependencies to build.gradle: implementation ‘androidx.constraintlayout:constraintlayout-compose:1.0.0-beta02’ In your activity class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { ShapeImageApplicationTheme { Surface(color = MaterialTheme.colors.background) { RoundedCornerShapeDemo() } } } } } @Composable fun RoundedCornerShapeDemo() { ImageResource(shape = RoundedCornerShape(10.dp)) } @Composable fun ImageResource(shape: Shape) { ConstraintLayout(modifier = Modifier.fillMaxSize()) { … Read more
Glide – adding header to request
Since 3.6.0 it’s possible to set custom headers for each request: GlideUrl glideUrl = new GlideUrl(“url”, new LazyHeaders.Builder() .addHeader(“key1”, “value”) .addHeader(“key2”, new LazyHeaderFactory() { @Override public String buildHeader() { String expensiveAuthHeader = computeExpensiveAuthHeader(); return expensiveAuthHeader; } }) .build()); Glide….load(glideUrl)….;
Glide not updating image android of same url?
//Use bellow code, it work for me.Set skip Memory Cache to true. it will load the image every time. Glide.with(Activity.this) .load(theImagePath) .diskCacheStrategy(DiskCacheStrategy.NONE) .skipMemoryCache(true) .into(myImageViewPhoto);
How to load image through byte array using Glide?
Lets say your base64 string is String imageBytes = “HVao14fpmtHSev3OgsrQNsawkFzXNcY3BsfQla6…” You should convert imageBytes String to array of bytes through byte[] imageByteArray = Base64.decode(imageBytes, Base64.DEFAULT); afterwards pass this imageByteArray to Glide. Glide.with(context) .asBitmap() .load(imageByteArray) .placeholder(R.drawable.ic_broken) .into(rowImageView);