From 4b8609ea5a0b840c7889e9cf1aefd6fdd8a0d744 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Fri, 4 Sep 2020 18:45:00 +1000 Subject: [PATCH] Revert "Make text bubbles a bit smaller" This reverts commit db0fd21097c3ed66e9633c6aef745dbb0e0e2b3b. --- res/layout/conversation_item_received.xml | 42 +++++++++---------- res/layout/conversation_item_sent.xml | 36 ++++++++-------- res/layout/document_view.xml | 1 - res/layout/quote_view.xml | 3 +- .../conversation/ConversationItem.java | 11 +++-- 5 files changed, 45 insertions(+), 48 deletions(-) diff --git a/res/layout/conversation_item_received.xml b/res/layout/conversation_item_received.xml index 063b5dd939..5b7d503cdf 100644 --- a/res/layout/conversation_item_received.xml +++ b/res/layout/conversation_item_received.xml @@ -59,8 +59,8 @@ android:layout_height="wrap_content" android:layout_marginEnd="@dimen/massive_spacing" android:layout_marginStart="12dp" - android:paddingTop="12dp" - android:paddingBottom="12dp" + android:paddingTop="@dimen/medium_spacing" + android:paddingBottom="@dimen/medium_spacing" android:orientation="vertical" android:clipToPadding="false" android:clipChildren="false" @@ -71,9 +71,9 @@ android:id="@+id/group_sender_holder" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginStart="12dp" - android:layout_marginBottom="12dp" - android:layout_marginEnd="12dp" + android:layout_marginStart="@dimen/message_bubble_horizontal_padding" + android:layout_marginBottom="@dimen/medium_spacing" + android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" android:orientation="horizontal" android:visibility="gone" tools:visibility="visible"> @@ -113,9 +113,9 @@ android:id="@+id/quote_view" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginStart="20dp" - android:layout_marginBottom="12dp" - android:layout_marginEnd="20dp" + android:layout_marginStart="@dimen/large_spacing" + android:layout_marginBottom="@dimen/medium_spacing" + android:layout_marginEnd="@dimen/large_spacing" android:visibility="gone" app:message_type="incoming" app:quote_colorPrimary="@color/text" @@ -127,7 +127,7 @@ android:layout="@layout/conversation_item_received_shared_contact" android:layout_width="@dimen/media_bubble_default_dimens" android:layout_height="wrap_content" - android:layout_marginTop="12dp" + android:layout_marginTop="@dimen/message_bubble_top_padding" android:visibility="gone"/> + android:layout_marginStart="@dimen/message_bubble_horizontal_padding" + android:layout_marginBottom="6dp" + android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" /> + android:layout_marginStart="@dimen/message_bubble_horizontal_padding" + android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" /> + android:layout_marginStart="@dimen/message_bubble_horizontal_padding" + android:layout_marginBottom="6dp" + android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" /> + android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" /> diff --git a/res/layout/quote_view.xml b/res/layout/quote_view.xml index 8b1fa969df..50b270b500 100644 --- a/res/layout/quote_view.xml +++ b/res/layout/quote_view.xml @@ -73,7 +73,7 @@ android:layout_height="wrap_content" style="@style/Signal.Text.Body" android:textColor="@color/text" - android:textSize="@dimen/small_font_size" + android:textSize="@dimen/medium_font_size" android:maxLines="1" android:ellipsize="end" tools:text="The-Amazing-Spider-Man.cba" /> @@ -99,7 +99,6 @@ android:layout_height="wrap_content" android:layout_marginTop="4dp" style="@style/Signal.Text.Body" - android:textSize="@dimen/small_font_size" android:ellipsize="end" android:maxLines="2" tools:text="With great power comes great responsibility." diff --git a/src/org/thoughtcrime/securesms/conversation/ConversationItem.java b/src/org/thoughtcrime/securesms/conversation/ConversationItem.java index 385c0fa9ab..ca3d10db17 100644 --- a/src/org/thoughtcrime/securesms/conversation/ConversationItem.java +++ b/src/org/thoughtcrime/securesms/conversation/ConversationItem.java @@ -87,7 +87,6 @@ import org.thoughtcrime.securesms.jobs.SmsSendJob; import org.thoughtcrime.securesms.linkpreview.LinkPreview; import org.thoughtcrime.securesms.linkpreview.LinkPreviewUtil; import org.thoughtcrime.securesms.logging.Log; -import org.thoughtcrime.securesms.loki.utilities.GeneralUtilitiesKt; import org.thoughtcrime.securesms.loki.utilities.MentionUtilities; import org.thoughtcrime.securesms.loki.views.ProfilePictureView; import org.thoughtcrime.securesms.mms.GlideRequests; @@ -503,23 +502,23 @@ public class ConversationItem extends LinearLayout if (hasOnlyThumbnail(messageRecord)) { int topPadding = 0; if (groupSenderHolder.getVisibility() == VISIBLE) { - topPadding = GeneralUtilitiesKt.toPx(12, getResources()); + topPadding = (int)getResources().getDimension(R.dimen.medium_spacing); } int bottomPadding = 0; if (messageRecord.getBody().length() > 0) { - bodyTextLayoutParams.topMargin = GeneralUtilitiesKt.toPx(12, getResources()); - bottomPadding = GeneralUtilitiesKt.toPx(12, getResources()); + bodyTextLayoutParams.topMargin = (int)getResources().getDimension(R.dimen.medium_spacing); + bottomPadding = (int)getResources().getDimension(R.dimen.medium_spacing); } bodyBubble.setPadding(0, topPadding, 0, bottomPadding); } else { - bodyBubble.setPadding(0, GeneralUtilitiesKt.toPx(12, getResources()), 0, GeneralUtilitiesKt.toPx(12, getResources())); + bodyBubble.setPadding(0, (int)getResources().getDimension(R.dimen.medium_spacing), 0, (int)getResources().getDimension(R.dimen.medium_spacing)); } bodyText.setLayoutParams(bodyTextLayoutParams); LinearLayout.LayoutParams senderHolderLayoutParams = (LinearLayout.LayoutParams)groupSenderHolder.getLayoutParams(); if (groupSenderHolder.getVisibility() == VISIBLE && hasOnlyText(messageRecord)) { senderHolderLayoutParams.bottomMargin = (int)(getResources().getDisplayMetrics().density * 4); } else { - senderHolderLayoutParams.bottomMargin = GeneralUtilitiesKt.toPx(12, getResources()); + senderHolderLayoutParams.bottomMargin = (int)getResources().getDimension(R.dimen.medium_spacing); } groupSenderHolder.setLayoutParams(senderHolderLayoutParams); if (documentViewStub.resolved()) {