aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/ui/adapter
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-04-01 17:52:14 +0200
committerChristian Schneppe <christian@pix-art.de>2018-04-01 17:52:14 +0200
commit34706a5e024df16027a292953606114db7e12dbe (patch)
tree5f97609f6b790195ffde305ac24cf8dedceae135 /src/main/java/de/pixart/messenger/ui/adapter
parenta69c98c5c58da0babe570a1b7eebaacf58ae5a05 (diff)
use text styles in more places
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/adapter')
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
index defaffa99..436f0f219 100644
--- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
+++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
@@ -304,7 +304,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
break;
}
if (error && type == SENT) {
- viewHolder.time.setTextColor(activity.getWarningTextColor());
+ viewHolder.time.setTextAppearance(getContext(), R.style.TextAppearance_Conversations_Caption_Waring);
DownloadableFile file = activity.xmppConnectionService.getFileBackend().getFile(message);
if (file.exists()) {
if (activity.xmppConnectionService.mHttpConnectionManager.getAutoAcceptFileSize() >= message.getFileParams().size) {
@@ -329,6 +329,11 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
viewHolder.resend_button.setVisibility(View.GONE);
viewHolder.time.setTextColor(this.getMessageTextColor(darkBackground, false));
} else {
+ if (darkBackground) {
+ viewHolder.time.setTextAppearance(getContext(), R.style.TextAppearance_Conversations_Caption_OnDark);
+ } else {
+ viewHolder.time.setTextAppearance(getContext(), R.style.TextAppearance_Conversations_Caption);
+ }
viewHolder.time.setTextColor(this.getMessageTextColor(darkBackground, false));
}
if (message.getEncryption() == Message.ENCRYPTION_NONE) {
@@ -386,8 +391,11 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
viewHolder.image.setVisibility(View.GONE);
viewHolder.messageBody.setVisibility(View.VISIBLE);
viewHolder.messageBody.setText(text);
- viewHolder.messageBody.setTextColor(getMessageTextColor(darkBackground, false));
- viewHolder.messageBody.setTypeface(null, Typeface.ITALIC);
+ if (darkBackground) {
+ viewHolder.messageBody.setTextAppearance(getContext(), R.style.TextAppearance_Conversations_Body1_Secondary_OnDark);
+ } else {
+ viewHolder.messageBody.setTextAppearance(getContext(), R.style.TextAppearance_Conversations_Body1_Secondary);
+ }
viewHolder.messageBody.setTextIsSelectable(false);
}
@@ -396,10 +404,11 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
viewHolder.image.setVisibility(View.GONE);
viewHolder.audioPlayer.setVisibility(View.GONE);
viewHolder.messageBody.setVisibility(View.VISIBLE);
- viewHolder.messageBody.setText(getContext().getString(
- R.string.decryption_failed));
- viewHolder.messageBody.setTextColor(getMessageTextColor(darkBackground, false));
- viewHolder.messageBody.setTypeface(null, Typeface.NORMAL);
+ if (darkBackground) {
+ viewHolder.messageBody.setTextAppearance(getContext(), R.style.TextAppearance_Conversations_Body1_Secondary_OnDark);
+ } else {
+ viewHolder.messageBody.setTextAppearance(getContext(), R.style.TextAppearance_Conversations_Body1_Secondary);
+ }
viewHolder.messageBody.setTextIsSelectable(false);
}
@@ -507,8 +516,11 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
viewHolder.image.setVisibility(View.GONE);
viewHolder.audioPlayer.setVisibility(View.GONE);
viewHolder.messageBody.setVisibility(View.VISIBLE);
- viewHolder.messageBody.setTextColor(this.getMessageTextColor(darkBackground, true));
- viewHolder.messageBody.setLinkTextColor(this.getMessageTextColor(darkBackground, true));
+ if (darkBackground) {
+ viewHolder.messageBody.setTextAppearance(getContext(), R.style.TextAppearance_Conversations_Body1_OnDark);
+ } else {
+ viewHolder.messageBody.setTextAppearance(getContext(), R.style.TextAppearance_Conversations_Body1);
+ }
viewHolder.messageBody.setHighlightColor(ContextCompat.getColor(activity, darkBackground ? R.color.grey800 : R.color.grey500));
viewHolder.messageBody.setTypeface(null, Typeface.NORMAL);
if (message.getBody() != null) {
@@ -853,7 +865,6 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
} else {
viewHolder.status_message.setText(DateUtils.formatDateTime(activity, message.getTimeSent(), DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR));
}
- viewHolder.status_message.setTextColor(activity.getSecondaryTextColor());
return view;
} else if (type == STATUS) {
if ("LOAD_MORE".equals(message.getBody())) {