diff --git a/src/main/java/eu/siacs/conversations/ui/BindingAdapters.java b/src/main/java/eu/siacs/conversations/ui/BindingAdapters.java index 11cb11a4d..952c76fb5 100644 --- a/src/main/java/eu/siacs/conversations/ui/BindingAdapters.java +++ b/src/main/java/eu/siacs/conversations/ui/BindingAdapters.java @@ -13,6 +13,8 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableSet; +import eu.siacs.conversations.AppSettings; +import eu.siacs.conversations.Conversations; import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Reaction; @@ -25,7 +27,6 @@ import java.util.function.Consumer; import java.util.stream.Collectors; public class BindingAdapters { - public static void setReactionsOnReceived( final ChipGroup chipGroup, final Conversation conversation, @@ -58,6 +59,7 @@ public class BindingAdapters { final var corner = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 35, context.getResources().getDisplayMetrics()); final var layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, size); final List>> reactions = aggregated.reactions; + final AppSettings appSettings = new AppSettings(context); if (reactions == null || reactions.isEmpty()) { chipGroup.setVisibility(View.GONE); } else { @@ -68,7 +70,15 @@ public class BindingAdapters { final var count = reaction.getValue().size(); final Chip chip = new Chip(chipGroup.getContext()); //chip.setEnsureMinTouchTargetSize(false); - chip.setChipMinHeight(size-32.0f); + if (appSettings.isLargeFont()) { + chip.setTextAppearance( + com.google.android.material.R.style.TextAppearance_Material3_BodyLarge); + chip.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18); + } else { + chip.setTextAppearance( + com.google.android.material.R.style.TextAppearance_Material3_BodyMedium); + } + chip.setChipMinHeight(size-22.0f); chip.ensureAccessibleTouchTarget(size); chip.setLayoutParams(layoutParams); chip.setChipCornerRadius(corner); @@ -125,7 +135,15 @@ public class BindingAdapters { } if (addReaction != null) { final Chip chip = new Chip(chipGroup.getContext()); - chip.setChipMinHeight(size-32.0f); + if (appSettings.isLargeFont()) { + chip.setTextAppearance( + com.google.android.material.R.style.TextAppearance_Material3_BodyLarge); + chip.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18); + } else { + chip.setTextAppearance( + com.google.android.material.R.style.TextAppearance_Material3_BodyMedium); + } + chip.setChipMinHeight(size-22.0f); chip.ensureAccessibleTouchTarget(size); chip.setLayoutParams(layoutParams); chip.setChipCornerRadius(corner); diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 0b267eb92..e8d8539b5 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -54,6 +54,7 @@ import android.text.TextWatcher; import android.text.style.ImageSpan; import android.util.DisplayMetrics; import android.util.Log; +import android.util.TypedValue; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.Gravity; @@ -134,6 +135,7 @@ import net.java.otr4j.session.SessionStatus; import org.jetbrains.annotations.NotNull; +import eu.siacs.conversations.AppSettings; import eu.siacs.conversations.entities.Bookmark; import eu.siacs.conversations.medialib.activities.EditActivity; import eu.siacs.conversations.ui.util.QuoteHelper; @@ -1734,7 +1736,12 @@ public class ConversationFragment extends XmppFragment DisplayMetrics displayMetrics = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); if (displayMetrics.heightPixels > 0) binding.textinput.setMaxHeight(displayMetrics.heightPixels / 4); - + final var appSettings = new AppSettings(activity); + if (appSettings.isLargeFont()) { + binding.textinput.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20); + } else { + binding.textinput.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16); + } binding.textSendButton.setOnClickListener(this.mSendButtonListener); binding.cancelButton.setOnClickListener(this.mCancelVoiceRecord); binding.shareButton.setOnClickListener(this.mShareVoiceRecord); @@ -2082,6 +2089,15 @@ public class ConversationFragment extends XmppFragment } messageListAdapter.handleTextQuotes(binding.contextPreviewText, body); binding.contextPreviewText.setText(body); + final var appSettings = new AppSettings(activity); + if (appSettings.isLargeFont()) { + binding.contextPreviewText.setTextAppearance( + com.google.android.material.R.style.TextAppearance_Material3_BodyLarge); + binding.contextPreviewText.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18); + } else { + binding.contextPreviewText.setTextAppearance( + com.google.android.material.R.style.TextAppearance_Material3_BodyMedium); + } binding.contextPreview.setVisibility(View.VISIBLE); } diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java index 625f86d35..66375cb9d 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -606,7 +606,14 @@ public class MessageAdapter extends ArrayAdapter { final ViewGroup.LayoutParams layoutParams = viewHolder.messageBody().getLayoutParams(); layoutParams.width = ViewGroup.LayoutParams.WRAP_CONTENT; viewHolder.messageBody().setLayoutParams(layoutParams); - + if (appSettings.isLargeFont()) { + viewHolder.inReplyToQuote().setTextAppearance( + com.google.android.material.R.style.TextAppearance_Material3_BodyLarge); + viewHolder.inReplyToQuote().setTextSize(TypedValue.COMPLEX_UNIT_SP, 18); + } else { + viewHolder.inReplyToQuote().setTextAppearance( + com.google.android.material.R.style.TextAppearance_Material3_BodyMedium); + } final ViewGroup.LayoutParams qlayoutParams = viewHolder.inReplyToQuote().getLayoutParams(); qlayoutParams.width = ViewGroup.LayoutParams.WRAP_CONTENT; viewHolder.messageBody().setLayoutParams(qlayoutParams); diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 27246f703..ed847b77f 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -1066,7 +1066,7 @@ Accept invites from strangers for MUCs When acting as a UnifiedPush Distributor the persistent, reliable and battery-friendly XMPP connection will be utilized to wake up other UnifiedPush compatible app such as Tusky, Ltt.rs, FluffyChat and more. Large font - Increase font size in message bubbles + Increase font size in message bubbles, reactions and input field Create one-off, Schedule recurring Create one-off backup Recurring backup diff --git a/src/main/res/xml/preferences_interface.xml b/src/main/res/xml/preferences_interface.xml index a25031204..8fd78b252 100644 --- a/src/main/res/xml/preferences_interface.xml +++ b/src/main/res/xml/preferences_interface.xml @@ -134,6 +134,12 @@ app:fragment="eu.siacs.conversations.ui.fragment.settings.InterfaceBubblesSettingsFragment" app:summary="@string/pref_chat_bubbles_summary" app:title="@string/pref_chat_bubbles" /> + - \ No newline at end of file