|
@ -58,6 +58,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess |
|
|
implements View.OnClickListener, View.OnLongClickListener { |
|
|
implements View.OnClickListener, View.OnLongClickListener { |
|
|
View itemView; |
|
|
View itemView; |
|
|
TextView tvFrom; |
|
|
TextView tvFrom; |
|
|
|
|
|
TextView tvSize; |
|
|
TextView tvTime; |
|
|
TextView tvTime; |
|
|
ImageView ivAttachments; |
|
|
ImageView ivAttachments; |
|
|
TextView tvSubject; |
|
|
TextView tvSubject; |
|
@ -71,6 +72,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess |
|
|
|
|
|
|
|
|
this.itemView = itemView; |
|
|
this.itemView = itemView; |
|
|
tvFrom = itemView.findViewById(R.id.tvFrom); |
|
|
tvFrom = itemView.findViewById(R.id.tvFrom); |
|
|
|
|
|
tvSize = itemView.findViewById(R.id.tvSize); |
|
|
tvTime = itemView.findViewById(R.id.tvTime); |
|
|
tvTime = itemView.findViewById(R.id.tvTime); |
|
|
ivAttachments = itemView.findViewById(R.id.ivAttachments); |
|
|
ivAttachments = itemView.findViewById(R.id.ivAttachments); |
|
|
tvSubject = itemView.findViewById(R.id.tvSubject); |
|
|
tvSubject = itemView.findViewById(R.id.tvSubject); |
|
@ -92,10 +94,13 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess |
|
|
|
|
|
|
|
|
private void clear() { |
|
|
private void clear() { |
|
|
tvFrom.setText(null); |
|
|
tvFrom.setText(null); |
|
|
|
|
|
tvSize.setText(null); |
|
|
tvTime.setText(null); |
|
|
tvTime.setText(null); |
|
|
tvSubject.setText(null); |
|
|
tvSubject.setText(null); |
|
|
ivAttachments.setVisibility(View.GONE); |
|
|
ivAttachments.setVisibility(View.GONE); |
|
|
|
|
|
tvFolder.setText(null); |
|
|
tvCount.setText(null); |
|
|
tvCount.setText(null); |
|
|
|
|
|
tvError.setText(null); |
|
|
pbLoading.setVisibility(View.VISIBLE); |
|
|
pbLoading.setVisibility(View.VISIBLE); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -112,21 +117,23 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess |
|
|
tvTime.setText(DateUtils.getRelativeTimeSpanString(context, message.received)); |
|
|
tvTime.setText(DateUtils.getRelativeTimeSpanString(context, message.received)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
ivAttachments.setVisibility(message.attachments > 0 ? View.VISIBLE : View.GONE); |
|
|
|
|
|
|
|
|
tvSize.setVisibility(View.GONE); |
|
|
|
|
|
|
|
|
tvSubject.setText(message.subject); |
|
|
tvSubject.setText(message.subject); |
|
|
|
|
|
ivAttachments.setVisibility(message.attachments > 0 ? View.VISIBLE : View.GONE); |
|
|
|
|
|
|
|
|
if (viewType == ViewType.UNIFIED) { |
|
|
|
|
|
|
|
|
if (viewType == ViewType.UNIFIED) |
|
|
tvFolder.setText(message.accountName); |
|
|
tvFolder.setText(message.accountName); |
|
|
tvCount.setText(Integer.toString(message.count)); |
|
|
|
|
|
tvCount.setVisibility(debug || message.count > 1 ? View.VISIBLE : View.GONE); |
|
|
|
|
|
} else if (viewType == ViewType.FOLDER) { |
|
|
|
|
|
|
|
|
else if (viewType == ViewType.FOLDER) |
|
|
tvFolder.setVisibility(View.GONE); |
|
|
tvFolder.setVisibility(View.GONE); |
|
|
|
|
|
else |
|
|
|
|
|
tvFolder.setText(Helper.localizeFolderName(context, message.folderName)); |
|
|
|
|
|
|
|
|
|
|
|
if (viewType == ViewType.THREAD) |
|
|
|
|
|
tvCount.setVisibility(View.GONE); |
|
|
|
|
|
else { |
|
|
tvCount.setText(Integer.toString(message.count)); |
|
|
tvCount.setText(Integer.toString(message.count)); |
|
|
tvCount.setVisibility(debug || message.count > 1 ? View.VISIBLE : View.GONE); |
|
|
tvCount.setVisibility(debug || message.count > 1 ? View.VISIBLE : View.GONE); |
|
|
} else { |
|
|
|
|
|
tvCount.setVisibility(View.GONE); |
|
|
|
|
|
tvFolder.setText(Helper.localizeFolderName(context, message.folderName)); |
|
|
|
|
|
tvFolder.setVisibility(View.VISIBLE); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (debug) { |
|
|
if (debug) { |
|
|