1
0
Fork 1

Apply option to show less avatars

This commit is contained in:
Arne 2024-09-05 21:40:10 +02:00
parent 2beb216727
commit 5c35f0cbf0
6 changed files with 19 additions and 3 deletions

View file

@ -1105,6 +1105,9 @@ public class MessageAdapter extends ArrayAdapter<Message> {
viewHolder.message_box_inner = view.findViewById(R.id.message_box_inner);
viewHolder.message_box = view.findViewById(R.id.message_box);
viewHolder.contact_picture = view.findViewById(R.id.message_photo);
if (activity.xmppConnectionService != null && !activity.xmppConnectionService.getBooleanPreference("show_less_avatars", R.bool.show_less_avatars)) {
viewHolder.contact_picture.setVisibility(View.VISIBLE);
}
viewHolder.download_button = view.findViewById(R.id.download_button);
viewHolder.indicator = view.findViewById(R.id.security_indicator);
viewHolder.edit_indicator = view.findViewById(R.id.edit_indicator);
@ -1125,6 +1128,9 @@ public class MessageAdapter extends ArrayAdapter<Message> {
viewHolder.message_box_inner = view.findViewById(R.id.message_box_inner);
viewHolder.message_box = view.findViewById(R.id.message_box);
viewHolder.contact_picture = view.findViewById(R.id.message_photo);
if (message.getConversation().getMode() == Conversation.MODE_SINGLE && activity.xmppConnectionService.getBooleanPreference("show_less_avatars", R.bool.show_less_avatars)) {
viewHolder.contact_picture.setVisibility(View.GONE);
}
viewHolder.download_button = view.findViewById(R.id.download_button);
viewHolder.indicator = view.findViewById(R.id.security_indicator);
viewHolder.edit_indicator = view.findViewById(R.id.edit_indicator);
@ -1292,7 +1298,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
} else if (message.getCounterpart() != null
|| message.getTrueCounterpart() != null
|| (message.getCounterparts() != null
&& message.getCounterparts().size() > 0)) {
&& !message.getCounterparts().isEmpty())) {
showAvatar = true;
AvatarWorkerTask.loadAvatar(
message, viewHolder.contact_picture, R.dimen.avatar_on_status_message);

View file

@ -34,7 +34,8 @@
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginEnd="0dp"
android:scaleType="centerCrop" />
android:scaleType="centerCrop"
android:visibility="visible" />
<LinearLayout
android:id="@+id/message_box"

View file

@ -41,7 +41,8 @@
android:id="@+id/message_photo"
android:layout_width="48dp"
android:layout_height="48dp"
android:scaleType="centerCrop" />
android:scaleType="centerCrop"
android:visibility="gone" />
</LinearLayout>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="show_avatar_incoming_call">true</bool>
<bool name="show_less_avatars">true</bool>
</resources>

View file

@ -1079,4 +1079,6 @@
<string name="do_you_really_want_to_retract_this_message">Do you really want to retract this message?</string>
<string name="show_avatar">Show avatar</string>
<string name="block_avatar">Block avatar</string>
<string name="pref_show_less_avatars">Show less avatars</string>
<string name="pref_show_less_avatars_summary">Show only needed avatars in the chats</string>
</resources>

View file

@ -91,6 +91,11 @@
android:icon="@drawable/ic_delete_24dp"
android:summary="@string/pref_delete_background_summary"
android:title="@string/delete_background" />
<SwitchPreferenceCompat
android:defaultValue="@bool/show_less_avatars"
android:key="show_less_avatars"
android:summary="@string/pref_show_less_avatars_summary"
android:title="@string/pref_show_less_avatars" />
<SwitchPreferenceCompat
android:defaultValue="@bool/show_nav_bar"
android:key="show_nav_bar"