Show recipient in outgoing folders

pull/146/head
M66B 7 years ago
parent f4f8d33aeb
commit f16a58bdf7

@ -1078,6 +1078,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
Bundle args = new Bundle();
args.putLong("account", intent.getLongExtra("account", -1));
args.putLong("folder", intent.getLongExtra("folder", -1));
args.putBoolean("outgoing", intent.getBooleanExtra("outgoing", false));
FragmentMessages fragment = new FragmentMessages();
fragment.setArguments(args);

@ -158,7 +158,8 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
lbm.sendBroadcast(
new Intent(ActivityView.ACTION_VIEW_MESSAGES)
.putExtra("account", folder.account)
.putExtra("folder", folder.id));
.putExtra("folder", folder.id)
.putExtra("outgoing", folder.isOutgoing()));
}
@Override

@ -109,6 +109,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
private LifecycleOwner owner;
private FragmentManager fragmentManager;
private ViewType viewType;
private boolean outgoing;
private IProperties properties;
private boolean compact;
@ -307,7 +308,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
pbLoading.setVisibility(View.GONE);
boolean photo = false;
if (avatars) {
if (avatars && !outgoing) {
if (message.avatar != null)
try {
ContentResolver resolver = context.getContentResolver();
@ -342,7 +343,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
else
ivFlagged.setVisibility(message.count - message.unflagged > 0 ? View.VISIBLE : View.GONE);
tvFrom.setText(MessageHelper.getFormattedAddresses(message.from, !compact));
tvFrom.setText(MessageHelper.getFormattedAddresses(outgoing ? message.to : message.from, !compact));
tvTime.setText(DateUtils.getRelativeTimeSpanString(context, message.received));
tvSize.setText(message.size == null ? null : Helper.humanReadableByteCount(message.size, true));
@ -1361,12 +1362,14 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
}
}
AdapterMessage(Context context, LifecycleOwner owner, FragmentManager fragmentManager, ViewType viewType, IProperties properties) {
AdapterMessage(Context context, LifecycleOwner owner, FragmentManager fragmentManager,
ViewType viewType, boolean outgoing, IProperties properties) {
super(DIFF_CALLBACK);
this.context = context;
this.owner = owner;
this.fragmentManager = fragmentManager;
this.viewType = viewType;
this.outgoing = outgoing;
this.properties = properties;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);

@ -89,8 +89,9 @@ public class FragmentMessages extends FragmentEx {
private FloatingActionButton fab;
private FloatingActionButton fabMore;
private long folder = -1;
private long account = -1;
private long folder = -1;
private boolean outgoing = false;
private String thread = null;
private boolean found = false;
private String search = null;
@ -133,6 +134,7 @@ public class FragmentMessages extends FragmentEx {
Bundle args = getArguments();
account = args.getLong("account", -1);
folder = args.getLong("folder", -1);
outgoing = args.getBoolean("outgoing", false);
thread = args.getString("thread");
found = args.getBoolean("found", false);
search = args.getString("search");
@ -221,7 +223,10 @@ public class FragmentMessages extends FragmentEx {
LinearLayoutManager llm = new LinearLayoutManager(getContext());
rvMessage.setLayoutManager(llm);
adapter = new AdapterMessage(getContext(), getViewLifecycleOwner(), getFragmentManager(), viewType, new AdapterMessage.IProperties() {
adapter = new AdapterMessage(
getContext(), getViewLifecycleOwner(), getFragmentManager(),
viewType, outgoing,
new AdapterMessage.IProperties() {
@Override
public void setExpanded(long id, boolean expand) {
if (expand) {

Loading…
Cancel
Save