|
|
|
@ -463,6 +463,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
private TextView tvBody;
|
|
|
|
|
private View wvBody;
|
|
|
|
|
private ContentLoadingProgressBar pbBody;
|
|
|
|
|
private View vwRipple;
|
|
|
|
|
private TextView tvNoInternetBody;
|
|
|
|
|
private ImageButton ibDownloading;
|
|
|
|
|
private Group grpDownloading;
|
|
|
|
@ -584,9 +585,11 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
if (image.length > 0 && image[0].getSource() != null) {
|
|
|
|
|
ImageHelper.AnnotatedSource a = new ImageHelper.AnnotatedSource(image[0].getSource());
|
|
|
|
|
Uri uri = Uri.parse(a.getSource());
|
|
|
|
|
if ("http".equals(uri.getScheme()) || "https".equals(uri.getScheme()))
|
|
|
|
|
if ("http".equals(uri.getScheme()) || "https".equals(uri.getScheme())) {
|
|
|
|
|
ripple(event);
|
|
|
|
|
if (onOpenLink(uri, null, false))
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -602,6 +605,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
if (url.equals(title))
|
|
|
|
|
title = null;
|
|
|
|
|
|
|
|
|
|
ripple(event);
|
|
|
|
|
if (onOpenLink(uri, title, false))
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -611,8 +615,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
ImageHelper.AnnotatedSource a = new ImageHelper.AnnotatedSource(image[0].getSource());
|
|
|
|
|
String source = a.getSource();
|
|
|
|
|
if (!TextUtils.isEmpty(source)) {
|
|
|
|
|
if (!a.isTracking())
|
|
|
|
|
if (!a.isTracking()) {
|
|
|
|
|
ripple(event);
|
|
|
|
|
onOpenImage(message.id, source);
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -626,6 +632,18 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ripple(MotionEvent event) {
|
|
|
|
|
int r = context.getResources().getDimensionPixelSize(R.dimen.ripple_radius);
|
|
|
|
|
vwRipple.setLeft(tvBody.getLeft() + Math.round(event.getX()) - r);
|
|
|
|
|
vwRipple.setTop(tvBody.getTop() + Math.round(event.getY()) - r);
|
|
|
|
|
vwRipple.setRight(tvBody.getLeft() + Math.round(event.getX()) + r);
|
|
|
|
|
vwRipple.setBottom(tvBody.getTop() + Math.round(event.getY()) + r);
|
|
|
|
|
vwRipple.setClickable(true);
|
|
|
|
|
vwRipple.setPressed(true);
|
|
|
|
|
vwRipple.setPressed(false);
|
|
|
|
|
vwRipple.setClickable(false);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -858,6 +876,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
tvBody = vsBody.findViewById(R.id.tvBody);
|
|
|
|
|
wvBody = vsBody.findViewById(R.id.wvBody);
|
|
|
|
|
pbBody = vsBody.findViewById(R.id.pbBody);
|
|
|
|
|
vwRipple = vsBody.findViewById(R.id.vwRipple);
|
|
|
|
|
tvNoInternetBody = vsBody.findViewById(R.id.tvNoInternetBody);
|
|
|
|
|
ibDownloading = vsBody.findViewById(R.id.ibDownloading);
|
|
|
|
|
grpDownloading = vsBody.findViewById(R.id.grpDownloading);
|
|
|
|
|