2
votes

I have two screens of the app.One is edit screen and another is modify screen.I am loading the images into list using Glide in edit screen with 100*100 size successfully using below code.

public static void loadEditImage(ImageView view, String imageUrl){
        Glide.with(view.getContext())
                .load(imageUrl)
                .transform(new CircleTransform(mContext))
//                .placeholder(R.drawable.car_logo_bg)
                .override(600, 200)

                .diskCacheStrategy(DiskCacheStrategy.NONE)
                .skipMemoryCache(true)
                .into(view);
    }

Same image i am trying to display in modify screen with 140*140 size using same image URL. But the image its displaying the size with 100*100 instead of 140*140. Below glide code is using for this screen.

public static void loadModifyImage(ImageView view, String modifyImageUrl){
        Glide.with(view.getContext())
                .load(modifyImageUrl)
                .asBitmap()
                .transform(new CircleTransform(mContext))
//                .placeholder(R.drawable.car_logo_bg)
                .override(600, 200)

//                .centerCrop()
//                .fitCenter()
                .diskCacheStrategy(DiskCacheStrategy.NONE)
                .skipMemoryCache(true)
                .signature(new StringSignature(String.valueOf(System.currentTimeMillis())))
                .into(view);
    }

Please let me know if i am doing anything wrong and help me to display the image with the size of 140*140.

1
you have use centerCrop() ?? - Nguyễn Trung Hiếu
yes if i use that image is displaying center of the ImageView. But i want to display that in fullsize. - malli
Why you .override(600, 200) ? - Nguyễn Trung Hiếu
for resizing the image i am using override(600,200). - malli

1 Answers

0
votes

Try

imageview.setLayoutParams(140, 140);