diff --git a/src/main/java/org/thoughtcrime/securesms/ConversationFragment.java b/src/main/java/org/thoughtcrime/securesms/ConversationFragment.java index ecd0b8d34..55430c4fe 100644 --- a/src/main/java/org/thoughtcrime/securesms/ConversationFragment.java +++ b/src/main/java/org/thoughtcrime/securesms/ConversationFragment.java @@ -152,6 +152,8 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, // 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; diff --git a/src/main/res/layout/conversation_item_received.xml b/src/main/res/layout/conversation_item_received.xml index 2e3e5d2a9..0046b44dc 100644 --- a/src/main/res/layout/conversation_item_received.xml +++ b/src/main/res/layout/conversation_item_received.xml @@ -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" /> + android:layout_alignBottom="@id/body_bubble_wrapper"> - + + + + diff --git a/src/main/res/layout/conversation_item_sent.xml b/src/main/res/layout/conversation_item_sent.xml index 5b165fbd2..38044fd7d 100644 --- a/src/main/res/layout/conversation_item_sent.xml +++ b/src/main/res/layout/conversation_item_sent.xml @@ -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" /> - + + + + diff --git a/src/main/res/values-sw600dp/dimens.xml b/src/main/res/values-sw600dp/dimens.xml new file mode 100644 index 000000000..adc1dd339 --- /dev/null +++ b/src/main/res/values-sw600dp/dimens.xml @@ -0,0 +1,5 @@ + + + + 600dp + diff --git a/src/main/res/values/dimens.xml b/src/main/res/values/dimens.xml index 1d16f6c72..9da808ea8 100644 --- a/src/main/res/values/dimens.xml +++ b/src/main/res/values/dimens.xml @@ -23,6 +23,7 @@ 32dp 6dp 8dp + 512dp 2dp 24dp 24dp