mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
Make text bubbles a bit smaller
This commit is contained in:
parent
31916a95d5
commit
db0fd21097
@ -59,8 +59,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/massive_spacing"
|
||||
android:layout_marginStart="12dp"
|
||||
android:paddingTop="@dimen/medium_spacing"
|
||||
android:paddingBottom="@dimen/medium_spacing"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
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="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginBottom="@dimen/medium_spacing"
|
||||
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
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="@dimen/large_spacing"
|
||||
android:layout_marginBottom="@dimen/medium_spacing"
|
||||
android:layout_marginEnd="@dimen/large_spacing"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
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="@dimen/message_bubble_top_padding"
|
||||
android:layout_marginTop="12dp"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ViewStub
|
||||
@ -153,9 +153,9 @@
|
||||
android:layout="@layout/conversation_item_received_audio"
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" />
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginEnd="12dp" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/document_view_stub"
|
||||
@ -163,15 +163,15 @@
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" />
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||
android:id="@+id/conversation_item_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
style="@style/Signal.Text.Body"
|
||||
android:textColor="?conversation_item_received_text_primary_color"
|
||||
android:textColorLink="?conversation_item_received_text_primary_color"
|
||||
@ -185,8 +185,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:alpha="0.6"
|
||||
@ -197,9 +197,9 @@
|
||||
android:id="@+id/conversation_item_sticker_footer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:visibility="gone"
|
||||
|
@ -37,8 +37,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="@dimen/massive_spacing"
|
||||
android:paddingTop="@dimen/medium_spacing"
|
||||
android:paddingBottom="@dimen/medium_spacing"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:layout_gravity="end"
|
||||
android:clipToPadding="false"
|
||||
android:clipChildren="false"
|
||||
@ -49,9 +49,9 @@
|
||||
android:id="@+id/quote_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/large_spacing"
|
||||
android:layout_marginBottom="@dimen/medium_spacing"
|
||||
android:layout_marginEnd="@dimen/large_spacing"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:visibility="gone"
|
||||
app:message_type="outgoing"
|
||||
app:quote_colorPrimary="@color/text"
|
||||
@ -63,7 +63,7 @@
|
||||
android:layout="@layout/conversation_item_sent_shared_contact"
|
||||
android:layout_width="@dimen/media_bubble_default_dimens"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/medium_spacing"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ViewStub
|
||||
@ -89,25 +89,25 @@
|
||||
android:layout="@layout/conversation_item_sent_audio"
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" />
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginEnd="12dp" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/document_view_stub"
|
||||
android:layout="@layout/conversation_item_sent_document"
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" />
|
||||
android:layout_marginEnd="12dp" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||
android:id="@+id/conversation_item_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
style="@style/Signal.Text.Body"
|
||||
android:textColor="?conversation_item_sent_text_primary_color"
|
||||
android:textColorLink="?conversation_item_sent_text_primary_color"
|
||||
@ -139,8 +139,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
app:footer_text_color="?attr/conversation_item_sent_text_secondary_color"
|
||||
@ -150,9 +150,9 @@
|
||||
android:id="@+id/conversation_item_sticker_footer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:visibility="gone"
|
||||
|
@ -9,6 +9,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:layout_marginBottom="-4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
@ -73,7 +73,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Signal.Text.Body"
|
||||
android:textColor="@color/text"
|
||||
android:textSize="@dimen/medium_font_size"
|
||||
android:textSize="@dimen/small_font_size"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
tools:text="The-Amazing-Spider-Man.cba" />
|
||||
@ -99,6 +99,7 @@
|
||||
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."
|
||||
|
@ -87,6 +87,7 @@ 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;
|
||||
@ -502,23 +503,23 @@ public class ConversationItem extends LinearLayout
|
||||
if (hasOnlyThumbnail(messageRecord)) {
|
||||
int topPadding = 0;
|
||||
if (groupSenderHolder.getVisibility() == VISIBLE) {
|
||||
topPadding = (int)getResources().getDimension(R.dimen.medium_spacing);
|
||||
topPadding = GeneralUtilitiesKt.toPx(12, getResources());
|
||||
}
|
||||
int bottomPadding = 0;
|
||||
if (messageRecord.getBody().length() > 0) {
|
||||
bodyTextLayoutParams.topMargin = (int)getResources().getDimension(R.dimen.medium_spacing);
|
||||
bottomPadding = (int)getResources().getDimension(R.dimen.medium_spacing);
|
||||
bodyTextLayoutParams.topMargin = GeneralUtilitiesKt.toPx(12, getResources());
|
||||
bottomPadding = GeneralUtilitiesKt.toPx(12, getResources());
|
||||
}
|
||||
bodyBubble.setPadding(0, topPadding, 0, bottomPadding);
|
||||
} else {
|
||||
bodyBubble.setPadding(0, (int)getResources().getDimension(R.dimen.medium_spacing), 0, (int)getResources().getDimension(R.dimen.medium_spacing));
|
||||
bodyBubble.setPadding(0, GeneralUtilitiesKt.toPx(12, getResources()), 0, GeneralUtilitiesKt.toPx(12, getResources()));
|
||||
}
|
||||
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 = (int)getResources().getDimension(R.dimen.medium_spacing);
|
||||
senderHolderLayoutParams.bottomMargin = GeneralUtilitiesKt.toPx(12, getResources());
|
||||
}
|
||||
groupSenderHolder.setLayoutParams(senderHolderLayoutParams);
|
||||
if (documentViewStub.resolved()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user