mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-05 19:41:57 +02:00
Don't cut the document icon in quotes
I also deleted an unnecessary LinearLayout, so you should look at the diff with --ignore-all-space Firstly, I lifted quote_attachment_container out of the FrameLayout with the thumbnail so that quote_attachment_container can be wrap_content (and enlarge the quote if necessary) while the thumbnail still always matches the size of the quote. Then I made the document view itself a little smaller so it does not enlarge the quote all the times.
This commit is contained in:
parent
90af180ce4
commit
778718c7b2
2 changed files with 101 additions and 117 deletions
|
@ -10,138 +10,118 @@
|
||||||
tools:visibility="visible">
|
tools:visibility="visible">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/quote_main"
|
||||||
|
android:padding="6dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="6dp"
|
android:orientation="horizontal">
|
||||||
android:orientation="vertical">
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/quote_bar"
|
||||||
|
android:layout_width="@dimen/quote_corner_radius_bottom"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/purple_400"
|
||||||
|
tools:tint="@color/purple_400" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/quote_main"
|
android:layout_width="0dp"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||||
|
android:id="@+id/quote_author"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Signal.Text.Caption"
|
||||||
|
android:textColor="@color/core_black"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
tools:visibility="gone"
|
||||||
|
tools:text="Peter Parker" />
|
||||||
|
|
||||||
|
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||||
|
android:id="@+id/quote_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Signal.Text.Quote"
|
||||||
|
android:ellipsize="end"
|
||||||
|
tools:text="With great power comes great responsibility."
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/quote_attachment_container"
|
||||||
|
android:layout_width="35dp"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
<org.thoughtcrime.securesms.components.CircleColorImageView
|
||||||
|
android:id="@+id/quote_attachment_icon"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
android:contentDescription="@string/file"
|
||||||
|
android:scaleType="center"
|
||||||
|
android:src="@drawable/ic_insert_drive_file_white_24dp"
|
||||||
|
android:scaleY="0.875"
|
||||||
|
android:scaleX="0.875"
|
||||||
|
app:circleColor="@color/document_icon" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/quote_bar"
|
android:id="@+id/quote_thumbnail"
|
||||||
android:layout_width="@dimen/quote_corner_radius_bottom"
|
android:layout_width="@dimen/quote_thumb_size"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/purple_400"
|
android:scaleType="centerCrop"
|
||||||
tools:tint="@color/purple_400" />
|
android:visibility="gone"
|
||||||
|
tools:visibility="gone" />
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_weight="1">
|
|
||||||
|
|
||||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
|
||||||
android:id="@+id/quote_author"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/Signal.Text.Caption"
|
|
||||||
android:textColor="@color/core_black"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:ellipsize="end"
|
|
||||||
tools:visibility="gone"
|
|
||||||
tools:text="Peter Parker" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/media_type"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
style="@style/Signal.Text.Caption"
|
|
||||||
android:textColor="@color/gray95"
|
|
||||||
android:textStyle="italic"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:text="Photo"
|
|
||||||
tools:visibility="visible"
|
|
||||||
android:layout_marginRight="8dp" />
|
|
||||||
|
|
||||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
|
||||||
android:id="@+id/quote_text"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/Signal.Text.Quote"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="3"
|
|
||||||
tools:text="With great power comes great responsibility."
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/quote_video_overlay"
|
||||||
android:layout_height="match_parent">
|
android:layout_width="32dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
<LinearLayout
|
android:background="@drawable/circle_universal_overlay"
|
||||||
android:id="@+id/quote_attachment_container"
|
android:layout_gravity="center"
|
||||||
android:layout_width="wrap_content"
|
android:longClickable="false"
|
||||||
android:layout_height="match_parent"
|
android:visibility="gone"
|
||||||
android:orientation="horizontal"
|
tools:visibility="gone">
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:visibility="visible">
|
|
||||||
|
|
||||||
<org.thoughtcrime.securesms.components.CircleColorImageView
|
|
||||||
android:id="@+id/quote_attachment_icon"
|
|
||||||
android:layout_width="40dp"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
android:contentDescription="@string/file"
|
|
||||||
android:padding="4dp"
|
|
||||||
android:scaleType="center"
|
|
||||||
android:src="@drawable/ic_insert_drive_file_white_24dp"
|
|
||||||
app:circleColor="@color/document_icon" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/quote_thumbnail"
|
android:layout_width="13dp"
|
||||||
android:layout_width="@dimen/quote_thumb_size"
|
android:layout_height="16dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_marginStart="11dp"
|
||||||
android:scaleType="centerCrop"
|
android:layout_marginTop="8dp"
|
||||||
android:visibility="gone"
|
android:scaleType="fitXY"
|
||||||
tools:visibility="gone" />
|
app:srcCompat="@drawable/triangle_right"
|
||||||
|
android:layout_marginLeft="11dp" />
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/quote_video_overlay"
|
|
||||||
android:layout_width="32dp"
|
|
||||||
android:layout_height="32dp"
|
|
||||||
android:background="@drawable/circle_universal_overlay"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:longClickable="false"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:visibility="gone">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="13dp"
|
|
||||||
android:layout_height="16dp"
|
|
||||||
android:layout_marginStart="11dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:scaleType="fitXY"
|
|
||||||
app:srcCompat="@drawable/triangle_right"
|
|
||||||
android:layout_marginLeft="11dp" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<ImageView
|
</FrameLayout>
|
||||||
android:id="@+id/quote_dismiss"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginLeft="6dp"
|
|
||||||
android:layout_marginRight="6dp"
|
|
||||||
android:layout_gravity="center|end"
|
|
||||||
android:background="@drawable/dismiss_background"
|
|
||||||
android:src="@drawable/ic_close_white_18dp"
|
|
||||||
android:tint="?quote_dismiss_button_tint" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/quote_dismiss"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginLeft="6dp"
|
||||||
|
android:layout_marginRight="6dp"
|
||||||
|
android:layout_gravity="center|end"
|
||||||
|
android:background="@drawable/dismiss_background"
|
||||||
|
android:src="@drawable/ic_close_white_18dp"
|
||||||
|
android:tint="?quote_dismiss_button_tint" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</merge>
|
</merge>
|
|
@ -3,7 +3,6 @@ package org.thoughtcrime.securesms.components;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.graphics.Canvas;
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
@ -111,6 +110,11 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
|
||||||
typedArray.recycle();
|
typedArray.recycle();
|
||||||
|
|
||||||
dismissView.setVisibility(messageType == MESSAGE_TYPE_PREVIEW ? VISIBLE : GONE);
|
dismissView.setVisibility(messageType == MESSAGE_TYPE_PREVIEW ? VISIBLE : GONE);
|
||||||
|
if (messageType == MESSAGE_TYPE_PREVIEW) {
|
||||||
|
bodyView.setSingleLine();
|
||||||
|
} else {
|
||||||
|
bodyView.setMaxLines(3);
|
||||||
|
}
|
||||||
|
|
||||||
// if (messageType == MESSAGE_TYPE_PREVIEW) {
|
// if (messageType == MESSAGE_TYPE_PREVIEW) {
|
||||||
// int radius = getResources().getDimensionPixelOffset(R.dimen.quote_corner_radius_preview);
|
// int radius = getResources().getDimensionPixelOffset(R.dimen.quote_corner_radius_preview);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue