|
|
@ -63,6 +63,7 @@ import android.view.MotionEvent;
|
|
|
|
import android.view.TouchDelegate;
|
|
|
|
import android.view.TouchDelegate;
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.ViewGroup;
|
|
|
|
import android.view.ViewGroup;
|
|
|
|
|
|
|
|
import android.view.ViewStub;
|
|
|
|
import android.webkit.DownloadListener;
|
|
|
|
import android.webkit.DownloadListener;
|
|
|
|
import android.webkit.WebSettings;
|
|
|
|
import android.webkit.WebSettings;
|
|
|
|
import android.webkit.WebView;
|
|
|
|
import android.webkit.WebView;
|
|
|
@ -224,6 +225,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
private ContentLoadingProgressBar pbLoading;
|
|
|
|
private ContentLoadingProgressBar pbLoading;
|
|
|
|
private View vwRipple;
|
|
|
|
private View vwRipple;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private View vsBody;
|
|
|
|
|
|
|
|
|
|
|
|
private ImageView ivExpanderAddress;
|
|
|
|
private ImageView ivExpanderAddress;
|
|
|
|
|
|
|
|
|
|
|
|
private ImageButton ibSearchContact;
|
|
|
|
private ImageButton ibSearchContact;
|
|
|
@ -324,54 +327,60 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
tvError = itemView.findViewById(R.id.tvError);
|
|
|
|
tvError = itemView.findViewById(R.id.tvError);
|
|
|
|
pbLoading = itemView.findViewById(R.id.pbLoading);
|
|
|
|
pbLoading = itemView.findViewById(R.id.pbLoading);
|
|
|
|
vwRipple = itemView.findViewById(R.id.vwRipple);
|
|
|
|
vwRipple = itemView.findViewById(R.id.vwRipple);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (viewType == ViewType.THREAD) {
|
|
|
|
private void ensureExpanded() {
|
|
|
|
ConstraintLayout inAttachments = itemView.findViewById(R.id.inAttachments);
|
|
|
|
if (vsBody != null)
|
|
|
|
ConstraintLayout inAttachmentsAlt = itemView.findViewById(R.id.inAttachmentsAlt);
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vsBody = ((ViewStub) itemView.findViewById(R.id.vsBody)).inflate();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ConstraintLayout inAttachments = vsBody.findViewById(R.id.inAttachments);
|
|
|
|
|
|
|
|
ConstraintLayout inAttachmentsAlt = vsBody.findViewById(R.id.inAttachmentsAlt);
|
|
|
|
inAttachments.setVisibility(attachments_alt ? View.GONE : View.VISIBLE);
|
|
|
|
inAttachments.setVisibility(attachments_alt ? View.GONE : View.VISIBLE);
|
|
|
|
inAttachmentsAlt.setVisibility(attachments_alt ? View.VISIBLE : View.GONE);
|
|
|
|
inAttachmentsAlt.setVisibility(attachments_alt ? View.VISIBLE : View.GONE);
|
|
|
|
ConstraintLayout attachments = (attachments_alt ? inAttachmentsAlt : inAttachments);
|
|
|
|
ConstraintLayout attachments = (attachments_alt ? inAttachmentsAlt : inAttachments);
|
|
|
|
|
|
|
|
|
|
|
|
ivExpanderAddress = itemView.findViewById(R.id.ivExpanderAddress);
|
|
|
|
ivExpanderAddress = vsBody.findViewById(R.id.ivExpanderAddress);
|
|
|
|
|
|
|
|
|
|
|
|
ibSearchContact = itemView.findViewById(R.id.ibSearchContact);
|
|
|
|
ibSearchContact = vsBody.findViewById(R.id.ibSearchContact);
|
|
|
|
ibNotifyContact = itemView.findViewById(R.id.ibNotifyContact);
|
|
|
|
ibNotifyContact = vsBody.findViewById(R.id.ibNotifyContact);
|
|
|
|
ibAddContact = itemView.findViewById(R.id.ibAddContact);
|
|
|
|
ibAddContact = vsBody.findViewById(R.id.ibAddContact);
|
|
|
|
|
|
|
|
|
|
|
|
tvFromExTitle = itemView.findViewById(R.id.tvFromExTitle);
|
|
|
|
tvFromExTitle = vsBody.findViewById(R.id.tvFromExTitle);
|
|
|
|
tvToTitle = itemView.findViewById(R.id.tvToTitle);
|
|
|
|
tvToTitle = vsBody.findViewById(R.id.tvToTitle);
|
|
|
|
tvReplyToTitle = itemView.findViewById(R.id.tvReplyToTitle);
|
|
|
|
tvReplyToTitle = vsBody.findViewById(R.id.tvReplyToTitle);
|
|
|
|
tvCcTitle = itemView.findViewById(R.id.tvCcTitle);
|
|
|
|
tvCcTitle = vsBody.findViewById(R.id.tvCcTitle);
|
|
|
|
tvBccTitle = itemView.findViewById(R.id.tvBccTitle);
|
|
|
|
tvBccTitle = vsBody.findViewById(R.id.tvBccTitle);
|
|
|
|
tvIdentityTitle = itemView.findViewById(R.id.tvIdentityTitle);
|
|
|
|
tvIdentityTitle = vsBody.findViewById(R.id.tvIdentityTitle);
|
|
|
|
tvTimeExTitle = itemView.findViewById(R.id.tvTimeExTitle);
|
|
|
|
tvTimeExTitle = vsBody.findViewById(R.id.tvTimeExTitle);
|
|
|
|
tvSizeExTitle = itemView.findViewById(R.id.tvSizeExTitle);
|
|
|
|
tvSizeExTitle = vsBody.findViewById(R.id.tvSizeExTitle);
|
|
|
|
|
|
|
|
|
|
|
|
tvFromEx = itemView.findViewById(R.id.tvFromEx);
|
|
|
|
tvFromEx = vsBody.findViewById(R.id.tvFromEx);
|
|
|
|
tvTo = itemView.findViewById(R.id.tvTo);
|
|
|
|
tvTo = vsBody.findViewById(R.id.tvTo);
|
|
|
|
tvReplyTo = itemView.findViewById(R.id.tvReplyTo);
|
|
|
|
tvReplyTo = vsBody.findViewById(R.id.tvReplyTo);
|
|
|
|
tvCc = itemView.findViewById(R.id.tvCc);
|
|
|
|
tvCc = vsBody.findViewById(R.id.tvCc);
|
|
|
|
tvBcc = itemView.findViewById(R.id.tvBcc);
|
|
|
|
tvBcc = vsBody.findViewById(R.id.tvBcc);
|
|
|
|
tvIdentity = itemView.findViewById(R.id.tvIdentity);
|
|
|
|
tvIdentity = vsBody.findViewById(R.id.tvIdentity);
|
|
|
|
tvTimeEx = itemView.findViewById(R.id.tvTimeEx);
|
|
|
|
tvTimeEx = vsBody.findViewById(R.id.tvTimeEx);
|
|
|
|
tvSizeEx = itemView.findViewById(R.id.tvSizeEx);
|
|
|
|
tvSizeEx = vsBody.findViewById(R.id.tvSizeEx);
|
|
|
|
|
|
|
|
|
|
|
|
tvSubjectEx = itemView.findViewById(R.id.tvSubjectEx);
|
|
|
|
tvSubjectEx = vsBody.findViewById(R.id.tvSubjectEx);
|
|
|
|
tvFlags = itemView.findViewById(R.id.tvFlags);
|
|
|
|
tvFlags = vsBody.findViewById(R.id.tvFlags);
|
|
|
|
tvKeywords = itemView.findViewById(R.id.tvKeywords);
|
|
|
|
tvKeywords = vsBody.findViewById(R.id.tvKeywords);
|
|
|
|
|
|
|
|
|
|
|
|
tvHeaders = itemView.findViewById(R.id.tvHeaders);
|
|
|
|
tvHeaders = vsBody.findViewById(R.id.tvHeaders);
|
|
|
|
pbHeaders = itemView.findViewById(R.id.pbHeaders);
|
|
|
|
pbHeaders = vsBody.findViewById(R.id.pbHeaders);
|
|
|
|
tvNoInternetHeaders = itemView.findViewById(R.id.tvNoInternetHeaders);
|
|
|
|
tvNoInternetHeaders = vsBody.findViewById(R.id.tvNoInternetHeaders);
|
|
|
|
|
|
|
|
|
|
|
|
tvCalendarSummary = view.findViewById(R.id.tvCalendarSummary);
|
|
|
|
tvCalendarSummary = vsBody.findViewById(R.id.tvCalendarSummary);
|
|
|
|
tvCalendarStart = view.findViewById(R.id.tvCalendarStart);
|
|
|
|
tvCalendarStart = vsBody.findViewById(R.id.tvCalendarStart);
|
|
|
|
tvCalendarEnd = view.findViewById(R.id.tvCalendarEnd);
|
|
|
|
tvCalendarEnd = vsBody.findViewById(R.id.tvCalendarEnd);
|
|
|
|
tvAttendees = view.findViewById(R.id.tvAttendees);
|
|
|
|
tvAttendees = vsBody.findViewById(R.id.tvAttendees);
|
|
|
|
btnCalendarAccept = view.findViewById(R.id.btnCalendarAccept);
|
|
|
|
btnCalendarAccept = vsBody.findViewById(R.id.btnCalendarAccept);
|
|
|
|
btnCalendarDecline = view.findViewById(R.id.btnCalendarDecline);
|
|
|
|
btnCalendarDecline = vsBody.findViewById(R.id.btnCalendarDecline);
|
|
|
|
btnCalendarMaybe = view.findViewById(R.id.btnCalendarMaybe);
|
|
|
|
btnCalendarMaybe = vsBody.findViewById(R.id.btnCalendarMaybe);
|
|
|
|
pbCalendarWait = view.findViewById(R.id.pbCalendarWait);
|
|
|
|
pbCalendarWait = vsBody.findViewById(R.id.pbCalendarWait);
|
|
|
|
|
|
|
|
|
|
|
|
rvAttachment = attachments.findViewById(R.id.rvAttachment);
|
|
|
|
rvAttachment = attachments.findViewById(R.id.rvAttachment);
|
|
|
|
rvAttachment.setHasFixedSize(false);
|
|
|
|
rvAttachment.setHasFixedSize(false);
|
|
|
@ -387,7 +396,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
btnSaveAttachments = attachments.findViewById(R.id.btnSaveAttachments);
|
|
|
|
btnSaveAttachments = attachments.findViewById(R.id.btnSaveAttachments);
|
|
|
|
tvNoInternetAttachments = attachments.findViewById(R.id.tvNoInternetAttachments);
|
|
|
|
tvNoInternetAttachments = attachments.findViewById(R.id.tvNoInternetAttachments);
|
|
|
|
|
|
|
|
|
|
|
|
bnvActions = itemView.findViewById(R.id.bnvActions);
|
|
|
|
bnvActions = vsBody.findViewById(R.id.bnvActions);
|
|
|
|
if (compact) {
|
|
|
|
if (compact) {
|
|
|
|
bnvActions.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_UNLABELED);
|
|
|
|
bnvActions.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_UNLABELED);
|
|
|
|
ViewGroup.LayoutParams lparam = bnvActions.getLayoutParams();
|
|
|
|
ViewGroup.LayoutParams lparam = bnvActions.getLayoutParams();
|
|
|
@ -395,15 +404,15 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
bnvActions.setLayoutParams(lparam);
|
|
|
|
bnvActions.setLayoutParams(lparam);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tbHtml = itemView.findViewById(R.id.tbHtml);
|
|
|
|
tbHtml = vsBody.findViewById(R.id.tbHtml);
|
|
|
|
ibImages = itemView.findViewById(R.id.ibImages);
|
|
|
|
ibImages = vsBody.findViewById(R.id.ibImages);
|
|
|
|
ibFull = itemView.findViewById(R.id.ibFull);
|
|
|
|
ibFull = vsBody.findViewById(R.id.ibFull);
|
|
|
|
tvBody = itemView.findViewById(R.id.tvBody);
|
|
|
|
tvBody = vsBody.findViewById(R.id.tvBody);
|
|
|
|
vwBody = itemView.findViewById(R.id.vwBody);
|
|
|
|
vwBody = vsBody.findViewById(R.id.vwBody);
|
|
|
|
pbBody = itemView.findViewById(R.id.pbBody);
|
|
|
|
pbBody = vsBody.findViewById(R.id.pbBody);
|
|
|
|
tvNoInternetBody = itemView.findViewById(R.id.tvNoInternetBody);
|
|
|
|
tvNoInternetBody = vsBody.findViewById(R.id.tvNoInternetBody);
|
|
|
|
|
|
|
|
|
|
|
|
rvImage = itemView.findViewById(R.id.rvImage);
|
|
|
|
rvImage = vsBody.findViewById(R.id.rvImage);
|
|
|
|
rvImage.setHasFixedSize(false);
|
|
|
|
rvImage.setHasFixedSize(false);
|
|
|
|
StaggeredGridLayoutManager sglm =
|
|
|
|
StaggeredGridLayoutManager sglm =
|
|
|
|
new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
|
|
|
|
new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
|
|
|
@ -411,13 +420,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
adapterImage = new AdapterImage(context, owner);
|
|
|
|
adapterImage = new AdapterImage(context, owner);
|
|
|
|
rvImage.setAdapter(adapterImage);
|
|
|
|
rvImage.setAdapter(adapterImage);
|
|
|
|
|
|
|
|
|
|
|
|
grpAddresses = itemView.findViewById(R.id.grpAddresses);
|
|
|
|
grpAddresses = vsBody.findViewById(R.id.grpAddresses);
|
|
|
|
grpHeaders = itemView.findViewById(R.id.grpHeaders);
|
|
|
|
grpHeaders = vsBody.findViewById(R.id.grpHeaders);
|
|
|
|
grpCalendar = itemView.findViewById(R.id.grpCalendar);
|
|
|
|
grpCalendar = vsBody.findViewById(R.id.grpCalendar);
|
|
|
|
grpCalendarResponse = itemView.findViewById(R.id.grpCalendarResponse);
|
|
|
|
grpCalendarResponse = vsBody.findViewById(R.id.grpCalendarResponse);
|
|
|
|
grpAttachments = attachments.findViewById(R.id.grpAttachments);
|
|
|
|
grpAttachments = attachments.findViewById(R.id.grpAttachments);
|
|
|
|
grpImages = itemView.findViewById(R.id.grpImages);
|
|
|
|
grpImages = vsBody.findViewById(R.id.grpImages);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Rect getItemRect() {
|
|
|
|
Rect getItemRect() {
|
|
|
@ -446,7 +454,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
ivSnoozed.setOnClickListener(this);
|
|
|
|
ivSnoozed.setOnClickListener(this);
|
|
|
|
ivFlagged.setOnClickListener(this);
|
|
|
|
ivFlagged.setOnClickListener(this);
|
|
|
|
|
|
|
|
|
|
|
|
if (viewType == ViewType.THREAD) {
|
|
|
|
if (vsBody != null) {
|
|
|
|
ivExpanderAddress.setOnClickListener(this);
|
|
|
|
ivExpanderAddress.setOnClickListener(this);
|
|
|
|
ibSearchContact.setOnClickListener(this);
|
|
|
|
ibSearchContact.setOnClickListener(this);
|
|
|
|
ibNotifyContact.setOnClickListener(this);
|
|
|
|
ibNotifyContact.setOnClickListener(this);
|
|
|
@ -477,7 +485,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
ivSnoozed.setOnClickListener(null);
|
|
|
|
ivSnoozed.setOnClickListener(null);
|
|
|
|
ivFlagged.setOnClickListener(null);
|
|
|
|
ivFlagged.setOnClickListener(null);
|
|
|
|
|
|
|
|
|
|
|
|
if (viewType == ViewType.THREAD) {
|
|
|
|
if (vsBody != null) {
|
|
|
|
ivExpanderAddress.setOnClickListener(null);
|
|
|
|
ivExpanderAddress.setOnClickListener(null);
|
|
|
|
ibSearchContact.setOnClickListener(null);
|
|
|
|
ibSearchContact.setOnClickListener(null);
|
|
|
|
ibNotifyContact.setOnClickListener(null);
|
|
|
|
ibNotifyContact.setOnClickListener(null);
|
|
|
@ -537,8 +545,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
tvFrom.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize * (message.unseen > 0 ? 1.1f : 1f));
|
|
|
|
tvFrom.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize * (message.unseen > 0 ? 1.1f : 1f));
|
|
|
|
tvSubject.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize * 0.9f);
|
|
|
|
tvSubject.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize * 0.9f);
|
|
|
|
tvPreview.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize * 0.9f);
|
|
|
|
tvPreview.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize * 0.9f);
|
|
|
|
if (viewType == ViewType.THREAD)
|
|
|
|
|
|
|
|
tvBody.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int px = Math.round(TypedValue.applyDimension(
|
|
|
|
int px = Math.round(TypedValue.applyDimension(
|
|
|
|
TypedValue.COMPLEX_UNIT_PX, textSize * (compact ? 1.5f : 3.0f),
|
|
|
|
TypedValue.COMPLEX_UNIT_PX, textSize * (compact ? 1.5f : 3.0f),
|
|
|
@ -762,6 +768,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void clearExpanded() {
|
|
|
|
private void clearExpanded() {
|
|
|
|
|
|
|
|
if (vsBody == null)
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
cowner.stop();
|
|
|
|
cowner.stop();
|
|
|
|
|
|
|
|
|
|
|
|
if (compact) {
|
|
|
|
if (compact) {
|
|
|
@ -856,6 +865,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
tvSubject.setSingleLine(false);
|
|
|
|
tvSubject.setSingleLine(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ensureExpanded();
|
|
|
|
|
|
|
|
|
|
|
|
grpAddresses.setVisibility(View.VISIBLE);
|
|
|
|
grpAddresses.setVisibility(View.VISIBLE);
|
|
|
|
|
|
|
|
|
|
|
|
boolean hasFrom = (message.from != null && message.from.length > 0);
|
|
|
|
boolean hasFrom = (message.from != null && message.from.length > 0);
|
|
|
@ -887,6 +898,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
ibImages.setVisibility(View.INVISIBLE);
|
|
|
|
ibImages.setVisibility(View.INVISIBLE);
|
|
|
|
ibFull.setVisibility(show_html ? View.INVISIBLE : View.GONE);
|
|
|
|
ibFull.setVisibility(show_html ? View.INVISIBLE : View.GONE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (textSize != 0)
|
|
|
|
|
|
|
|
tvBody.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
|
|
|
|
|
|
|
|
|
|
|
|
tvBody.setTypeface(monospaced ? Typeface.MONOSPACE : Typeface.DEFAULT);
|
|
|
|
tvBody.setTypeface(monospaced ? Typeface.MONOSPACE : Typeface.DEFAULT);
|
|
|
|
tvBody.setVisibility(!show_html ? View.INVISIBLE : View.GONE);
|
|
|
|
tvBody.setVisibility(!show_html ? View.INVISIBLE : View.GONE);
|
|
|
|
vwBody.setVisibility(show_html ? View.INVISIBLE : View.GONE);
|
|
|
|
vwBody.setVisibility(show_html ? View.INVISIBLE : View.GONE);
|
|
|
|