Fixed seen updates in message view

This commit is contained in:
M66B 2018-08-27 05:44:13 +00:00
parent 2937f66e93
commit 6244a4557e
1 changed files with 19 additions and 10 deletions

View File

@ -519,16 +519,7 @@ public class FragmentMessage extends FragmentEx {
}); });
} }
int typeface = (message.ui_seen ? Typeface.NORMAL : Typeface.BOLD); setSeen();
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);
pbWait.setVisibility(View.GONE); pbWait.setVisibility(View.GONE);
@ -557,6 +548,11 @@ public class FragmentMessage extends FragmentEx {
finish(); finish();
return; 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 @Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.menu_view, menu); inflater.inflate(R.menu.menu_view, menu);