44import android .content .Context ;
55import android .content .DialogInterface ;
66import android .graphics .Bitmap ;
7+ import android .graphics .BitmapFactory ;
78import android .view .LayoutInflater ;
89import android .view .View ;
910import android .view .ViewGroup ;
2627import com .cometchat .pro .uikit .R ;
2728import com .cometchat .pro .uikit .databinding .UserListRowBinding ;
2829
30+ import java .io .ByteArrayOutputStream ;
2931import java .util .ArrayList ;
3032import java .util .List ;
3133
@@ -172,29 +174,16 @@ private void setImageData(ImageViewHolder viewHolder, int i) {
172174 String smallUrl = Extensions .getThumbnailGeneration (context ,message );
173175
174176 if (smallUrl !=null ) {
175- Glide .with (context ).asBitmap ().load (smallUrl ).into (new SimpleTarget <Bitmap >() {
176- @ Override
177- public void onResourceReady (@ NonNull Bitmap resource , @ Nullable Transition <? super Bitmap > transition ) {
178- if (isImageNotSafe )
179- viewHolder .imageView .setImageBitmap (Utils .blur (context ,resource ));
180- else
181- viewHolder .imageView .setImageBitmap (resource );
182- }
183- });
177+ Glide .with (context ).asBitmap ().load (smallUrl ).into (viewHolder .imageView );
184178 } else {
185- Glide .with (context ).asBitmap ().load (((MediaMessage )message ).getAttachment ().getFileUrl ()).into (new SimpleTarget <Bitmap >() {
186- @ Override
187- public void onResourceReady (@ NonNull Bitmap resource , @ Nullable Transition <? super Bitmap > transition ) {
188- if (isImageNotSafe )
189- viewHolder .imageView .setImageBitmap (Utils .blur (context ,resource ));
190- else
191- viewHolder .imageView .setImageBitmap (resource );
192- }
193- });
179+ Glide .with (context ).asBitmap ().load (((MediaMessage )message ).getAttachment ().getFileUrl ())
180+ .into (viewHolder .imageView );
194181 }
195182 if (isImageNotSafe ) {
183+ viewHolder .imageView .setAlpha (0.3f );
196184 viewHolder .sensitiveLayout .setVisibility (View .VISIBLE );
197185 } else {
186+ viewHolder .imageView .setAlpha (1f );
198187 viewHolder .sensitiveLayout .setVisibility (View .GONE );
199188 }
200189 viewHolder .imageView .setOnClickListener (view -> {
@@ -219,7 +208,6 @@ public void onClick(DialogInterface dialog, int which) {
219208 } else {
220209 MediaUtils .openFile (((MediaMessage ) message ).getAttachment ().getFileUrl (), context );
221210 }
222-
223211 });
224212 viewHolder .itemView .setTag (R .string .baseMessage , message );
225213 }
0 commit comments