Compare commits

...

8 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] c60c8a7937 Apply maxWidth to content views instead of container to properly limit bubble width
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2026-01-02 18:03:47 +00:00
copilot-swe-agent[bot] 07d6d8e81d Wrap body_bubble in FrameLayout to make maxWidth work with RelativeLayout constraints
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2026-01-02 17:46:03 +00:00
copilot-swe-agent[bot] 9bcc241445 Update comments to explain software layer and bubble width constraint relationship
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2026-01-02 16:38:46 +00:00
copilot-swe-agent[bot] 6b42987c9a Limit message bubble width on large screens to prevent software layer overflow
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2026-01-02 16:36:45 +00:00
copilot-swe-agent[bot] 6d4f5bc2ca Extract magic number to named constant for better code quality
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2026-01-02 16:05:08 +00:00
copilot-swe-agent[bot] 9c678db7cb Add conditional software layer based on screen size with proper documentation
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2026-01-02 16:03:44 +00:00
copilot-swe-agent[bot] 84bea44f2c Fix: Remove software layer from RecyclerView to prevent memory overflow on foldables
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2026-01-01 12:13:37 +00:00
copilot-swe-agent[bot] d5e994d8d3 Initial plan 2026-01-01 12:09:20 +00:00
5 changed files with 47 additions and 21 deletions
@@ -152,6 +152,8 @@ public class ConversationFragment extends MessageSelectorFragment
// setLayerType() is needed to allow larger items (long texts in our case)
// with hardware layers, drawing may result in errors as "OpenGLRenderer: Path too large to be rendered into a texture"
// On foldable devices with large screens, software layer can exceed memory limits (~11MB).
// To prevent this, message bubble width is constrained via maxWidth in layout files.
list.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
return view;
@@ -38,13 +38,13 @@
android:id="@+id/reply_icon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignStart="@id/body_bubble"
android:layout_alignTop="@id/body_bubble"
android:layout_alignBottom="@id/body_bubble"
android:layout_alignStart="@id/body_bubble_wrapper"
android:layout_alignTop="@id/body_bubble_wrapper"
android:layout_alignBottom="@id/body_bubble_wrapper"
android:alpha="0"
app:srcCompat="?menu_reply_icon"
android:tint="?icon_tint"
android:layout_alignLeft="@id/body_bubble" />
android:layout_alignLeft="@id/body_bubble_wrapper" />
<FrameLayout
android:id="@+id/contact_photo_container"
@@ -52,7 +52,7 @@
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignBottom="@id/body_bubble">
android:layout_alignBottom="@id/body_bubble_wrapper">
<org.thoughtcrime.securesms.components.AvatarImageView
android:id="@+id/contact_photo"
@@ -65,8 +65,8 @@
</FrameLayout>
<LinearLayout
android:id="@+id/body_bubble"
<FrameLayout
android:id="@+id/body_bubble_wrapper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/message_bubble_edge_margin"
@@ -74,7 +74,12 @@
android:layout_marginLeft="6dp"
android:layout_marginStart="6dp"
android:layout_toRightOf="@id/contact_photo_container"
android:layout_toEndOf="@id/contact_photo_container"
android:layout_toEndOf="@id/contact_photo_container">
<LinearLayout
android:id="@+id/body_bubble"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:clipToPadding="false"
android:clipChildren="false"
@@ -112,6 +117,7 @@
android:id="@+id/quote_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="@dimen/message_bubble_max_width"
android:layout_marginTop="@dimen/message_bubble_top_padding"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
@@ -186,6 +192,7 @@
android:id="@+id/conversation_item_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="@dimen/message_bubble_max_width"
android:layout_marginBottom="@dimen/message_bubble_collapsed_footer_padding"
android:layout_marginLeft="@dimen/message_bubble_horizontal_padding"
android:layout_marginRight="@dimen/message_bubble_horizontal_padding"
@@ -247,12 +254,14 @@
</LinearLayout>
</FrameLayout>
<org.thoughtcrime.securesms.reactions.ReactionsConversationView
android:id="@+id/reactions_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/body_bubble"
android:layout_alignStart="@id/body_bubble"
android:layout_below="@id/body_bubble_wrapper"
android:layout_alignStart="@id/body_bubble_wrapper"
android:layout_marginTop="-4dp"
android:orientation="horizontal"
app:message_type="incoming" />
+20 -11
View File
@@ -40,24 +40,29 @@
android:id="@+id/reply_icon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignStart="@id/body_bubble"
android:layout_alignTop="@id/body_bubble"
android:layout_alignBottom="@id/body_bubble"
android:layout_alignStart="@id/body_bubble_wrapper"
android:layout_alignTop="@id/body_bubble_wrapper"
android:layout_alignBottom="@id/body_bubble_wrapper"
android:alpha="0"
app:srcCompat="?menu_reply_icon"
android:tint="?icon_tint"
android:layout_alignLeft="@id/body_bubble" />
android:layout_alignLeft="@id/body_bubble_wrapper" />
<FrameLayout
android:id="@+id/body_bubble_wrapper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/indicators_parent"
android:layout_toStartOf="@+id/indicators_parent"
android:layout_alignWithParentIfMissing="true"
android:layout_marginLeft="@dimen/message_bubble_edge_margin"
android:layout_marginStart="@dimen/message_bubble_edge_margin">
<LinearLayout
android:id="@+id/body_bubble"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toLeftOf="@+id/indicators_parent"
android:layout_toStartOf="@+id/indicators_parent"
android:layout_alignWithParentIfMissing="true"
android:layout_marginLeft="@dimen/message_bubble_edge_margin"
android:layout_marginStart="@dimen/message_bubble_edge_margin"
android:clipToPadding="false"
android:clipChildren="false"
android:background="@color/white"
@@ -94,6 +99,7 @@
android:id="@+id/quote_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="@dimen/message_bubble_max_width"
android:layout_marginTop="@dimen/message_bubble_top_padding"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
@@ -168,6 +174,7 @@
android:id="@+id/conversation_item_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="@dimen/message_bubble_max_width"
android:layout_marginLeft="@dimen/message_bubble_horizontal_padding"
android:layout_marginRight="@dimen/message_bubble_horizontal_padding"
android:layout_marginBottom="@dimen/message_bubble_collapsed_footer_padding"
@@ -228,12 +235,14 @@
</LinearLayout>
</FrameLayout>
<org.thoughtcrime.securesms.reactions.ReactionsConversationView
android:id="@+id/reactions_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/body_bubble"
android:layout_alignEnd="@id/body_bubble"
android:layout_below="@id/body_bubble_wrapper"
android:layout_alignEnd="@id/body_bubble_wrapper"
android:layout_marginTop="-4dp"
android:orientation="horizontal"
app:message_type="outgoing" />
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Limit bubble width on large screens (tablets/foldable devices) to prevent software layer overflow -->
<dimen name="message_bubble_max_width">600dp</dimen>
</resources>
+1
View File
@@ -23,6 +23,7 @@
<dimen name="message_bubble_edge_margin">32dp</dimen>
<dimen name="message_bubble_bottom_padding">6dp</dimen>
<dimen name="message_bubble_showmore_padding">8dp</dimen>
<dimen name="message_bubble_max_width">512dp</dimen>
<dimen name="transparent_footer_padding">2dp</dimen>
<dimen name="media_bubble_remove_button_size">24dp</dimen>
<dimen name="media_bubble_edit_button_size">24dp</dimen>