I'm trying to load a profile image using the firebase storage url inside an item's icon of a bottom navigation bar, here's my code:
Glide.with(getApplicationContext()).asBitmap().load(profilePicUrl)
.into(new CustomTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
Drawable profileImage = new BitmapDrawable(getResources(), resource);
bottomNav.getMenu().getItem(4).setIcon(profileImage);
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
}
});
The profilePicUrl
does work, I already use it to for another image view. However when I run the app, the dimensions of the icon changes corresponding to the picture that I'm trying to load but there's no image inside, here's how it looks.