Fixed message unseen color

pull/30/head
M66B 6 years ago
parent d263720b56
commit 3a55ea5269

@ -120,8 +120,10 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
tvSubject.setTypeface(null, typeface);
tvCount.setTypeface(null, typeface);
tvFrom.setTextColor(Helper.resolveColor(context, unseen ? R.attr.colorUnread : android.R.attr.textColorSecondary));
tvTime.setTextColor(Helper.resolveColor(context, unseen ? R.attr.colorUnread : android.R.attr.textColorSecondary));
int colorUnseen = Helper.resolveColor(context, unseen
? R.attr.colorUnread : android.R.attr.textColorSecondary);
tvFrom.setTextColor(colorUnseen);
tvTime.setTextColor(colorUnseen);
}
@Override
@ -138,7 +140,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
if (EntityFolder.TYPE_DRAFTS.equals(message.folderType))
context.startActivity(
new Intent(context, ActivityCompose.class)
.putExtra("id" , message.id));
.putExtra("id", message.id));
else {
boolean outbox = EntityFolder.TYPE_OUTBOX.equals(message.folderType);
if (!outbox && !message.seen && !message.ui_seen) {
@ -151,7 +153,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast(
new Intent(ActivityView.ACTION_VIEW_MESSAGE)
.putExtra("id" , message.id));
.putExtra("id", message.id));
}
} catch (Throwable ex) {
Log.e(Helper.TAG, ex + "\n" + Log.getStackTraceString(ex));
@ -165,7 +167,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
super(DIFF_CALLBACK);
this.context = context;
this.viewType = viewType;
this.debug = PreferenceManager.getDefaultSharedPreferences(context).getBoolean("debug" , false);
this.debug = PreferenceManager.getDefaultSharedPreferences(context).getBoolean("debug", false);
}
public static final DiffUtil.ItemCallback<TupleMessageEx> DIFF_CALLBACK =

@ -135,7 +135,7 @@ public class FragmentMessage extends FragmentEx {
URLSpan[] link = buffer.getSpans(off, off, URLSpan.class);
if (link.length != 0) {
Bundle args = new Bundle();
args.putString("link" , link[0].getURL());
args.putString("link", link[0].getURL());
FragmentWebView fragment = new FragmentWebView();
fragment.setArguments(args);
@ -230,11 +230,16 @@ public class FragmentMessage extends FragmentEx {
tvSubject.setText(message.subject);
tvCount.setText(Integer.toString(message.count));
int visibility = (message.ui_seen ? Typeface.NORMAL : Typeface.BOLD);
tvFrom.setTypeface(null, visibility);
tvTime.setTypeface(null, visibility);
tvSubject.setTypeface(null, visibility);
tvCount.setTypeface(null, visibility);
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);
DB.getInstance(getContext()).attachment().liveAttachments(id).removeObservers(FragmentMessage.this);
DB.getInstance(getContext()).attachment().liveAttachments(id).observe(FragmentMessage.this,
@ -341,7 +346,7 @@ public class FragmentMessage extends FragmentEx {
private void onActionThread(long id) {
Bundle args = new Bundle();
args.putLong("thread" , id); // message ID
args.putLong("thread", id); // message ID
FragmentMessages fragment = new FragmentMessages();
fragment.setArguments(args);
@ -353,14 +358,14 @@ public class FragmentMessage extends FragmentEx {
private void onActionForward(long id) {
startActivity(new Intent(getContext(), ActivityCompose.class)
.putExtra("id" , id)
.putExtra("action" , "forward"));
.putExtra("id", id)
.putExtra("action", "forward"));
}
private void onActionReplyAll(long id) {
startActivity(new Intent(getContext(), ActivityCompose.class)
.putExtra("id" , id)
.putExtra("action" , "reply_all"));
.putExtra("id", id)
.putExtra("action", "reply_all"));
}
private void onActionDelete(final long id) {
@ -443,7 +448,7 @@ public class FragmentMessage extends FragmentEx {
private void onActionMove(final long id) {
Bundle args = new Bundle();
args.putLong("id" , id);
args.putLong("id", id);
getLoaderManager().restartLoader(ActivityView.LOADER_MESSAGE_MOVE, args, moveLoaderCallbacks).forceLoad();
}
@ -469,8 +474,8 @@ public class FragmentMessage extends FragmentEx {
private void onActionReply(long id) {
startActivity(new Intent(getContext(), ActivityCompose.class)
.putExtra("id" , id)
.putExtra("action" , "reply"));
.putExtra("id", id)
.putExtra("action", "reply"));
}
private static class MoveLoader extends AsyncTaskLoader<List<EntityFolder>> {

Loading…
Cancel
Save