From ba77e7fcc9a5f5f495ed5d3bf76bc947c834b628 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Sun, 15 Jan 2023 11:54:04 +0100 Subject: [PATCH] Image rich replies: Enforce smaller max width Fixes https://github.com/SchildiChat/SchildiChat-android/issues/172 Change-Id: I23979ef1790f9881fd57395b56e5cf6bd61326e3 --- library/ui-styles/src/main/res/values-w320dp/dimens_sc.xml | 7 +++++++ library/ui-styles/src/main/res/values-w360dp/dimens_sc.xml | 7 +++++++ library/ui-styles/src/main/res/values-w400dp/dimens_sc.xml | 7 +++++++ library/ui-styles/src/main/res/values-w440dp/dimens_sc.xml | 7 +++++++ library/ui-styles/src/main/res/values-w480dp/dimens_sc.xml | 7 +++++++ library/ui-styles/src/main/res/values/dimens_sc.xml | 3 ++- vector/src/main/res/layout/view_in_reply_to.xml | 4 +++- 7 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 library/ui-styles/src/main/res/values-w320dp/dimens_sc.xml create mode 100644 library/ui-styles/src/main/res/values-w360dp/dimens_sc.xml create mode 100644 library/ui-styles/src/main/res/values-w400dp/dimens_sc.xml create mode 100644 library/ui-styles/src/main/res/values-w440dp/dimens_sc.xml create mode 100644 library/ui-styles/src/main/res/values-w480dp/dimens_sc.xml diff --git a/library/ui-styles/src/main/res/values-w320dp/dimens_sc.xml b/library/ui-styles/src/main/res/values-w320dp/dimens_sc.xml new file mode 100644 index 0000000000..18fe90794a --- /dev/null +++ b/library/ui-styles/src/main/res/values-w320dp/dimens_sc.xml @@ -0,0 +1,7 @@ + + + + 160dp + + + diff --git a/library/ui-styles/src/main/res/values-w360dp/dimens_sc.xml b/library/ui-styles/src/main/res/values-w360dp/dimens_sc.xml new file mode 100644 index 0000000000..f1778d3bb0 --- /dev/null +++ b/library/ui-styles/src/main/res/values-w360dp/dimens_sc.xml @@ -0,0 +1,7 @@ + + + + 200dp + + + diff --git a/library/ui-styles/src/main/res/values-w400dp/dimens_sc.xml b/library/ui-styles/src/main/res/values-w400dp/dimens_sc.xml new file mode 100644 index 0000000000..86c826f742 --- /dev/null +++ b/library/ui-styles/src/main/res/values-w400dp/dimens_sc.xml @@ -0,0 +1,7 @@ + + + + 240dp + + + diff --git a/library/ui-styles/src/main/res/values-w440dp/dimens_sc.xml b/library/ui-styles/src/main/res/values-w440dp/dimens_sc.xml new file mode 100644 index 0000000000..02d7a78a29 --- /dev/null +++ b/library/ui-styles/src/main/res/values-w440dp/dimens_sc.xml @@ -0,0 +1,7 @@ + + + + 280dp + + + diff --git a/library/ui-styles/src/main/res/values-w480dp/dimens_sc.xml b/library/ui-styles/src/main/res/values-w480dp/dimens_sc.xml new file mode 100644 index 0000000000..c1561535e5 --- /dev/null +++ b/library/ui-styles/src/main/res/values-w480dp/dimens_sc.xml @@ -0,0 +1,7 @@ + + + + 320dp + + + diff --git a/library/ui-styles/src/main/res/values/dimens_sc.xml b/library/ui-styles/src/main/res/values/dimens_sc.xml index c0ff389d2a..2cddf6403f 100644 --- a/library/ui-styles/src/main/res/values/dimens_sc.xml +++ b/library/ui-styles/src/main/res/values/dimens_sc.xml @@ -46,6 +46,7 @@ 96sp 32sp 120dp - 840dp + + 120dp diff --git a/vector/src/main/res/layout/view_in_reply_to.xml b/vector/src/main/res/layout/view_in_reply_to.xml index d933728b25..ee99b4e9d6 100644 --- a/vector/src/main/res/layout/view_in_reply_to.xml +++ b/vector/src/main/res/layout/view_in_reply_to.xml @@ -35,12 +35,14 @@ android:id="@+id/replyThumbnailView" android:layout_width="0dp" android:layout_height="@dimen/reply_thumbnail_height" + android:maxWidth="@dimen/reply_thumbnail_max_width" android:contentDescription="@string/a11y_image" android:layout_marginTop="8dp" android:layout_gravity="start" android:scaleType="fitStart" - tools:layout_width="200dp" + android:adjustViewBounds="true" app:layout_goneMarginTop="0dp" + tools:layout_width="200dp" tools:src="@tools:sample/backgrounds/scenic" />