Fixed seen updates in message view

pull/72/head
M66B 6 years ago
parent 2937f66e93
commit 6244a4557e

@ -519,16 +519,7 @@ public class FragmentMessage extends FragmentEx {
});
}
int typeface = (message.ui_seen ? Typeface.NORMAL : Typeface.BOLD);
tvFrom.setTypeface(null, typeface);
tvTime.setTypeface(null, typeface);
tvSubject.setTypeface(null, typeface);
tvCount.setTypeface(null, typeface);
int colorUnseen = Helper.resolveColor(getContext(), message.ui_seen
? android.R.attr.textColorSecondary : R.attr.colorUnread);
tvFrom.setTextColor(colorUnseen);
tvTime.setTextColor(colorUnseen);
setSeen();
pbWait.setVisibility(View.GONE);
@ -557,6 +548,11 @@ public class FragmentMessage extends FragmentEx {
finish();
return;
}
// Messages are immutable except for flags
FragmentMessage.this.message.seen = message.seen;
FragmentMessage.this.message.ui_seen = message.ui_seen;
setSeen();
}
});
@ -615,6 +611,19 @@ public class FragmentMessage extends FragmentEx {
}
}
private void setSeen() {
int typeface = (message.ui_seen ? Typeface.NORMAL : Typeface.BOLD);
tvFrom.setTypeface(null, typeface);
tvTime.setTypeface(null, typeface);
tvSubject.setTypeface(null, typeface);
tvCount.setTypeface(null, typeface);
int colorUnseen = Helper.resolveColor(getContext(), message.ui_seen
? android.R.attr.textColorSecondary : R.attr.colorUnread);
tvFrom.setTextColor(colorUnseen);
tvTime.setTextColor(colorUnseen);
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.menu_view, menu);

Loading…
Cancel
Save