Further layout fixes

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-07-13 11:02:42 +02:00
parent 9a6775a3e8
commit d234722c7c
2 changed files with 8 additions and 6 deletions

View File

@ -104,6 +104,9 @@ public class MagicIncomingTextMessageViewHolder
Context context = NextcloudTalkApplication.getSharedApplication().getApplicationContext();
itemView.setSelected(false);
FlexboxLayout.LayoutParams layoutParams = (FlexboxLayout.LayoutParams) messageTimeView.getLayoutParams();
layoutParams.setWrapBefore(false);
Spannable messageString = new SpannableString(message.getText());
if (messageParameters != null && message.getMessageParameters().size() > 0) {
@ -128,12 +131,11 @@ public class MagicIncomingTextMessageViewHolder
} else if (EmoticonUtils.isMessageWithSingleEmoticonOnly(context, message.getText())) {
messageString.setSpan(new RelativeSizeSpan(2.5f), 0, messageString.length(),
Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
FlexboxLayout.LayoutParams layoutParams = (FlexboxLayout.LayoutParams) messageTimeView.getLayoutParams();
layoutParams.setWrapBefore(true);
messageTimeView.setLayoutParams(layoutParams);
itemView.setSelected(true);
}
messageTimeView.setLayoutParams(layoutParams);
messageText.setText(messageString);
}
}

View File

@ -79,9 +79,11 @@ public class MagicOutcomingTextMessageViewHolder extends MessageHolders.Outcomin
Spannable messageString = new SpannableString(message.getText());
Context context = NextcloudTalkApplication.getSharedApplication().getApplicationContext();
itemView.setSelected(false);
FlexboxLayout.LayoutParams layoutParams = (FlexboxLayout.LayoutParams) messageTimeView.getLayoutParams();
layoutParams.setWrapBefore(false);
if (messageParameters != null && message.getMessageParameters().size() > 0) {
for (String key : message.getMessageParameters().keySet()) {
HashMap<String, String> individualHashMap = message.getMessageParameters().get(key);
@ -98,14 +100,12 @@ public class MagicOutcomingTextMessageViewHolder extends MessageHolders.Outcomin
} else if (EmoticonUtils.isMessageWithSingleEmoticonOnly(context, message.getText())) {
messageString.setSpan(new RelativeSizeSpan(2.5f), 0, messageString.length(),
Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
FlexboxLayout.LayoutParams layoutParams = (FlexboxLayout.LayoutParams) messageTimeView.getLayoutParams();
layoutParams.setWrapBefore(true);
messageTimeView.setLayoutParams(layoutParams);
messageTimeView.setTextColor(context.getResources().getColor(R.color.warm_grey_four));
itemView.setSelected(true);
}
messageTimeView.setLayoutParams(layoutParams);
messageText.setText(messageString);
}
}