mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-07 23:42:16 +00:00
Fix quote alignment (#837)
* refactor: use constraints in quote view * refactor: layouts for quotes fixed * fix: use the current text, which may be the type of attachment instead of the quote body
This commit is contained in:
@@ -16,17 +16,17 @@
|
||||
|
||||
<org.thoughtcrime.securesms.conversation.v2.ConversationRecyclerView
|
||||
android:id="@+id/conversationRecyclerView"
|
||||
android:layout_above="@+id/typingIndicatorViewContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="@dimen/input_bar_height" />
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<org.thoughtcrime.securesms.conversation.v2.components.TypingIndicatorViewContainer
|
||||
android:id="@+id/typingIndicatorViewContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginBottom="@dimen/input_bar_height"
|
||||
android:visibility="gone"
|
||||
android:layout_alignParentBottom="true" />
|
||||
android:layout_above="@+id/inputBar"
|
||||
/>
|
||||
|
||||
<org.thoughtcrime.securesms.conversation.v2.input_bar.InputBar
|
||||
android:id="@+id/inputBar"
|
||||
@@ -92,23 +92,23 @@
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_above="@+id/inputBar"
|
||||
android:layout_marginRight="12dp"
|
||||
android:layout_marginBottom="72dp">
|
||||
android:layout_marginBottom="32dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/view_scroll_to_bottom_button_background">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_chevron_up"
|
||||
android:layout_centerInParent="true"
|
||||
android:rotation="180"
|
||||
android:src="@drawable/ic_chevron_up"
|
||||
app:tint="@color/text" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/inputBarLinearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/input_bar_height"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/input_bar_background">
|
||||
|
||||
|
||||
@@ -1,29 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout android:id="@+id/mainQuoteViewContainer"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/mainQuoteViewContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/input_bar_background"
|
||||
android:paddingHorizontal="@dimen/medium_spacing"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
android:paddingVertical="@dimen/small_spacing">
|
||||
|
||||
<View
|
||||
android:id="@+id/quoteViewAccentLine"
|
||||
android:layout_width="@dimen/accent_line_thickness"
|
||||
android:layout_height="0dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="@color/text" />
|
||||
android:layout_marginVertical="4dp"
|
||||
android:background="@color/text"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintEnd_toStartOf="@id/quoteStartBarrier"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<RelativeLayout
|
||||
tools:visibility="gone"
|
||||
android:id="@+id/quoteViewAttachmentPreviewContainer"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginVertical="@dimen/small_spacing"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="@drawable/view_quote_attachment_preview_background">
|
||||
android:layout_marginVertical="@dimen/small_spacing"
|
||||
android:background="@drawable/view_quote_attachment_preview_background"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintEnd_toStartOf="@id/quoteStartBarrier"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/quoteViewAttachmentPreviewImageView"
|
||||
@@ -42,50 +53,62 @@
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/quoteStartBarrier"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
app:barrierDirection="end"
|
||||
app:constraint_referenced_ids="quoteViewAttachmentPreviewContainer,quoteViewAccentLine" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/quoteViewMainContentContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginVertical="@dimen/small_spacing"
|
||||
android:id="@+id/quoteTextParent"
|
||||
android:layout_marginStart="@dimen/medium_spacing"
|
||||
android:layout_marginEnd="@dimen/medium_spacing"
|
||||
android:layout_toEndOf="@+id/quoteViewAttachmentPreviewContainer"
|
||||
android:layout_toStartOf="@+id/quoteViewCancelButton"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toEndOf="@+id/quoteStartBarrier"
|
||||
app:layout_constraintEnd_toStartOf="@id/quoteViewCancelButton"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
tools:visibility="gone"
|
||||
android:id="@+id/quoteViewAuthorTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
tools:text="Spiderman"
|
||||
android:textColor="@color/text"
|
||||
android:textSize="@dimen/small_font_size"
|
||||
android:textStyle="bold" />
|
||||
android:textStyle="bold"
|
||||
tools:text="Spiderman" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/quoteViewBodyTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="3"
|
||||
tools:text="Yo, I need your help here!"
|
||||
android:textColor="@color/text"
|
||||
android:textSize="@dimen/small_font_size" />
|
||||
|
||||
android:textSize="@dimen/small_font_size"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
tools:visibility="gone"
|
||||
android:id="@+id/quoteViewCancelButton"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="@dimen/small_spacing"
|
||||
android:layout_marginEnd="@dimen/small_spacing"
|
||||
android:padding="6dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@drawable/ic_close_white_48dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:tint="@color/text" />
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -14,48 +14,35 @@
|
||||
android:textStyle="bold"
|
||||
android:gravity="center" />
|
||||
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
android:id="@+id/mainContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="bottom">
|
||||
|
||||
<LinearLayout
|
||||
<FrameLayout
|
||||
android:layout_alignBottom="@+id/messageContentContainer"
|
||||
android:id="@+id/profilePictureContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<View
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="0dp" />
|
||||
<org.thoughtcrime.securesms.components.ProfilePictureView
|
||||
android:id="@+id/profilePictureView"
|
||||
android:layout_width="@dimen/very_small_profile_picture_size"
|
||||
android:layout_height="@dimen/very_small_profile_picture_size"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="32dp" >
|
||||
<ImageView
|
||||
android:id="@+id/moderatorIconImageView"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginEnd="@dimen/small_spacing"
|
||||
android:src="@drawable/ic_crown"
|
||||
android:layout_gravity="bottom|end" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.ProfilePictureView
|
||||
android:id="@+id/profilePictureView"
|
||||
android:layout_width="@dimen/very_small_profile_picture_size"
|
||||
android:layout_height="@dimen/very_small_profile_picture_size"
|
||||
android:layout_marginTop="3dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/moderatorIconImageView"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_crown"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentBottom="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/messageContentContainer"
|
||||
@@ -122,6 +109,6 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -59,11 +59,10 @@
|
||||
<org.thoughtcrime.securesms.conversation.v2.messages.QuoteView
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/albumThumbnailView"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
tools:visibility="visible"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/quoteView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<org.thoughtcrime.securesms.conversation.v2.messages.LinkPreviewView
|
||||
app:layout_constraintTop_toBottomOf="@+id/quoteView"
|
||||
@@ -73,6 +72,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
app:barrierAllowsGoneWidgets="true"
|
||||
android:id="@+id/bodyBarrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -125,5 +125,6 @@
|
||||
<dimen name="drawable_padding">24dp</dimen>
|
||||
<dimen name="normal_padding">16dp</dimen>
|
||||
<dimen name="action_item_height">56dp</dimen>
|
||||
<dimen name="conversation_item_quote_width">120dp</dimen>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user