Merge pull request 'Fix overlapping status text if squared avatars are enabled' (#183) from tfl/monocles_chat:fix_overlapping_text_on_squared_avatars into master

Reviewed-on: https://codeberg.org/monocles/monocles_chat/pulls/183
This commit is contained in:
Arne-Brün Vogelsang 2024-05-10 13:19:49 +00:00
commit 2fabf12827

View file

@ -1536,10 +1536,18 @@ public class MessageAdapter extends ArrayAdapter<Message> {
view = activity.getLayoutInflater().inflate(R.layout.message_status, parent, false); view = activity.getLayoutInflater().inflate(R.layout.message_status, parent, false);
if (activity.xmppConnectionService != null && activity.xmppConnectionService.getBooleanPreference("set_round_avatars", R.bool.set_round_avatars)) { if (activity.xmppConnectionService != null && activity.xmppConnectionService.getBooleanPreference("set_round_avatars", R.bool.set_round_avatars)) {
viewHolder.contact_picture = view.findViewById(R.id.message_photo); viewHolder.contact_picture = view.findViewById(R.id.message_photo);
viewHolder.status_message = view.findViewById(R.id.status_message);
} else { } else {
viewHolder.contact_picture = view.findViewById(R.id.message_photo_square); viewHolder.contact_picture = view.findViewById(R.id.message_photo_square);
// Update layout constraints because the textview would now reference the wrong ShapeableImageView
// This should only be the case in MUC's where the participants can see the READ status
TextView status_message = view.findViewById(R.id.status_message);
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) status_message.getLayoutParams();
params.addRule(RelativeLayout.RIGHT_OF, R.id.message_photo_square);
params.addRule(RelativeLayout.END_OF, R.id.message_photo_square);
status_message.setLayoutParams(params);
viewHolder.status_message = status_message;
} }
viewHolder.status_message = view.findViewById(R.id.status_message);
viewHolder.load_more_messages = view.findViewById(R.id.load_more_messages); viewHolder.load_more_messages = view.findViewById(R.id.load_more_messages);
break; break;
default: default: