mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-26 21:37:34 +00:00
Render images in a conversation true-to-size.
Previously, we were always rendering images as squares. Instead of doing that, we now render them as close to true-to-size as possible (within reasonable min/max width/height boundaries).
This commit is contained in:

committed by
Moxie Marlinspike

parent
9f8b4cf892
commit
ea374735e1
@@ -27,7 +27,11 @@
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="@string/conversation_activity__attachment_thumbnail"
|
||||
app:backgroundColorHint="?conversation_background" />
|
||||
app:backgroundColorHint="?conversation_background"
|
||||
app:minWidth="100dp"
|
||||
app:maxWidth="300dp"
|
||||
app:minHeight="100dp"
|
||||
app:maxHeight="300dp" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.AudioView
|
||||
android:id="@+id/attachment_audio"
|
||||
|
@@ -78,8 +78,8 @@
|
||||
<ViewStub
|
||||
android:id="@+id/image_view_stub"
|
||||
android:layout="@layout/conversation_item_received_thumbnail"
|
||||
android:layout_width="@dimen/media_bubble_height"
|
||||
android:layout_height="@dimen/media_bubble_height"/>
|
||||
android:layout_width="@dimen/media_bubble_default_dimens"
|
||||
android:layout_height="@dimen/media_bubble_default_dimens"/>
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/audio_view_stub"
|
||||
|
@@ -2,12 +2,17 @@
|
||||
<org.thoughtcrime.securesms.components.ThumbnailView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/image_view"
|
||||
android:layout_width="@dimen/media_bubble_height"
|
||||
android:layout_height="@dimen/media_bubble_height"
|
||||
android:layout_width="@dimen/media_bubble_default_dimens"
|
||||
android:layout_height="@dimen/media_bubble_default_dimens"
|
||||
android:scaleType="centerCrop"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/conversation_item__mms_image_description"
|
||||
android:visibility="gone"
|
||||
app:minWidth="@dimen/media_bubble_min_width"
|
||||
app:maxWidth="@dimen/media_bubble_max_width"
|
||||
app:minHeight="@dimen/media_bubble_min_height"
|
||||
app:maxHeight="@dimen/media_bubble_max_height"
|
||||
tools:src="@drawable/ic_video_light"
|
||||
tools:visibility="gone" />
|
||||
|
@@ -40,9 +40,9 @@
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/image_view_stub"
|
||||
android:layout_width="@dimen/media_bubble_height"
|
||||
android:layout_height="@dimen/media_bubble_height"
|
||||
android:layout="@layout/conversation_item_sent_thumbnail"/>
|
||||
android:layout_width="@dimen/media_bubble_default_dimens"
|
||||
android:layout_height="@dimen/media_bubble_default_dimens"
|
||||
android:layout="@layout/conversation_item_sent_thumbnail" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/audio_view_stub"
|
||||
|
@@ -2,14 +2,19 @@
|
||||
<org.thoughtcrime.securesms.components.ThumbnailView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/image_view"
|
||||
android:layout_width="@dimen/media_bubble_height"
|
||||
android:layout_height="@dimen/media_bubble_height"
|
||||
android:layout_width="@dimen/media_bubble_default_dimens"
|
||||
android:layout_height="@dimen/media_bubble_default_dimens"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/conversation_item__mms_image_description"
|
||||
android:visibility="gone"
|
||||
app:minWidth="@dimen/media_bubble_min_width"
|
||||
app:maxWidth="@dimen/media_bubble_max_width"
|
||||
app:minHeight="@dimen/media_bubble_min_height"
|
||||
app:maxHeight="@dimen/media_bubble_max_height"
|
||||
tools:src="@drawable/ic_video_light"
|
||||
tools:visibility="visible" />
|
||||
|
5
res/values-sw320dp/dimens.xml
Normal file
5
res/values-sw320dp/dimens.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="media_bubble_max_width">220dp</dimen>
|
||||
<dimen name="media_bubble_max_height">300dp</dimen>
|
||||
</resources>
|
@@ -147,6 +147,10 @@
|
||||
|
||||
<declare-styleable name="ThumbnailView">
|
||||
<attr name="backgroundColorHint" format="color" />
|
||||
<attr name="minWidth" format="dimension" />
|
||||
<attr name="maxWidth" format="dimension" />
|
||||
<attr name="minHeight" format="dimension" />
|
||||
<attr name="maxHeight" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="DeliveryStatusView">
|
||||
|
@@ -18,9 +18,13 @@
|
||||
|
||||
<dimen name="message_bubble_corner_radius">4dp</dimen>
|
||||
<dimen name="message_bubble_shadow_distance">1.5dp</dimen>
|
||||
<dimen name="media_bubble_height">210dp</dimen>
|
||||
<dimen name="media_bubble_remove_button_size">24dp</dimen>
|
||||
<dimen name="media_bubble_edit_button_size">24dp</dimen>
|
||||
<dimen name="media_bubble_default_dimens">210dp</dimen>
|
||||
<dimen name="media_bubble_min_width">150dp</dimen>
|
||||
<dimen name="media_bubble_max_width">250dp</dimen>
|
||||
<dimen name="media_bubble_min_height">100dp</dimen>
|
||||
<dimen name="media_bubble_max_height">320dp</dimen>
|
||||
|
||||
<integer name="media_overview_cols">3</integer>
|
||||
<dimen name="message_details_table_row_pad">10dp</dimen>
|
||||
|
Reference in New Issue
Block a user