Revert grouping body+footer

This commit is contained in:
Lucio Maciel 2021-08-03 11:52:22 -03:00 committed by GitHub
parent 9d3a9fc675
commit e58b617689
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 116 additions and 157 deletions

View file

@ -25,7 +25,6 @@ import com.airbnb.lottie.LottieProperty;
import com.airbnb.lottie.model.KeyPath; import com.airbnb.lottie.model.KeyPath;
import org.signal.core.util.concurrent.SignalExecutors; import org.signal.core.util.concurrent.SignalExecutors;
import org.signal.core.util.logging.Log;
import org.thoughtcrime.securesms.R; import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.animation.AnimationCompleteListener; import org.thoughtcrime.securesms.animation.AnimationCompleteListener;
import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.DatabaseFactory;

View file

@ -88,7 +88,6 @@ import org.thoughtcrime.securesms.conversation.colors.Colorizer;
import org.thoughtcrime.securesms.database.AttachmentDatabase; import org.thoughtcrime.securesms.database.AttachmentDatabase;
import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.DatabaseFactory;
import org.thoughtcrime.securesms.database.MessageDatabase; import org.thoughtcrime.securesms.database.MessageDatabase;
import org.thoughtcrime.securesms.database.documents.IdentityKeyMismatch;
import org.thoughtcrime.securesms.database.model.MediaMmsMessageRecord; import org.thoughtcrime.securesms.database.model.MediaMmsMessageRecord;
import org.thoughtcrime.securesms.database.model.MessageRecord; import org.thoughtcrime.securesms.database.model.MessageRecord;
import org.thoughtcrime.securesms.database.model.MmsMessageRecord; import org.thoughtcrime.securesms.database.model.MmsMessageRecord;
@ -177,7 +176,6 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
protected View replyIcon; protected View replyIcon;
@Nullable protected ViewGroup contactPhotoHolder; @Nullable protected ViewGroup contactPhotoHolder;
@Nullable private QuoteView quoteView; @Nullable private QuoteView quoteView;
private ViewGroup bodyFooterContainer;
private EmojiTextView bodyText; private EmojiTextView bodyText;
private ConversationItemFooter footer; private ConversationItemFooter footer;
private ConversationItemFooter stickerFooter; private ConversationItemFooter stickerFooter;
@ -246,7 +244,6 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
this.backgroundDrawable = new ClipProjectionDrawable(Objects.requireNonNull(ContextCompat.getDrawable(getContext(), this.backgroundDrawable = new ClipProjectionDrawable(Objects.requireNonNull(ContextCompat.getDrawable(getContext(),
R.drawable.conversation_item_background))); R.drawable.conversation_item_background)));
this.bodyFooterContainer = findViewById(R.id.conversation_item_body_footer_container);
this.bodyText = findViewById(R.id.conversation_item_body); this.bodyText = findViewById(R.id.conversation_item_body);
this.footer = findViewById(R.id.conversation_item_footer); this.footer = findViewById(R.id.conversation_item_footer);
this.stickerFooter = findViewById(R.id.conversation_item_sticker_footer); this.stickerFooter = findViewById(R.id.conversation_item_sticker_footer);
@ -787,7 +784,7 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
setSharedContactCorners(messageRecord, previousRecord, nextRecord, isGroupThread); setSharedContactCorners(messageRecord, previousRecord, nextRecord, isGroupThread);
ViewUtil.updateLayoutParams(bodyFooterContainer, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewUtil.updateLayoutParams(bodyText, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ViewUtil.updateLayoutParamsIfNonNull(groupSenderHolder, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewUtil.updateLayoutParamsIfNonNull(groupSenderHolder, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
footer.setVisibility(GONE); footer.setVisibility(GONE);
} else if (hasLinkPreview(messageRecord) && messageRequestAccepted) { } else if (hasLinkPreview(messageRecord) && messageRequestAccepted) {
@ -815,14 +812,14 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
setThumbnailCorners(messageRecord, previousRecord, nextRecord, isGroupThread); setThumbnailCorners(messageRecord, previousRecord, nextRecord, isGroupThread);
setLinkPreviewCorners(messageRecord, previousRecord, nextRecord, isGroupThread, true); setLinkPreviewCorners(messageRecord, previousRecord, nextRecord, isGroupThread, true);
ViewUtil.updateLayoutParams(bodyFooterContainer, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewUtil.updateLayoutParams(bodyText, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ViewUtil.updateLayoutParamsIfNonNull(groupSenderHolder, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewUtil.updateLayoutParamsIfNonNull(groupSenderHolder, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ViewUtil.setTopMargin(linkPreviewStub.get(), 0); ViewUtil.setTopMargin(linkPreviewStub.get(), 0);
} else { } else {
linkPreviewStub.get().setLinkPreview(glideRequests, linkPreview, true); linkPreviewStub.get().setLinkPreview(glideRequests, linkPreview, true);
linkPreviewStub.get().setDownloadClickedListener(downloadClickListener); linkPreviewStub.get().setDownloadClickedListener(downloadClickListener);
setLinkPreviewCorners(messageRecord, previousRecord, nextRecord, isGroupThread, false); setLinkPreviewCorners(messageRecord, previousRecord, nextRecord, isGroupThread, false);
ViewUtil.updateLayoutParams(bodyFooterContainer, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewUtil.updateLayoutParams(bodyText, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ViewUtil.updateLayoutParamsIfNonNull(groupSenderHolder, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewUtil.updateLayoutParamsIfNonNull(groupSenderHolder, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
//noinspection ConstantConditions //noinspection ConstantConditions
@ -854,7 +851,7 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
Log.w(TAG, "setMediaAttributes: could not register listener for audio slide " + audioViewStub.get().getAudioSlideUri()); Log.w(TAG, "setMediaAttributes: could not register listener for audio slide " + audioViewStub.get().getAudioSlideUri());
} }
ViewUtil.updateLayoutParams(bodyFooterContainer, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewUtil.updateLayoutParams(bodyText, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ViewUtil.updateLayoutParamsIfNonNull(groupSenderHolder, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewUtil.updateLayoutParamsIfNonNull(groupSenderHolder, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
footer.setPlaybackSpeedListener(new AudioPlaybackSpeedToggleListener()); footer.setPlaybackSpeedListener(new AudioPlaybackSpeedToggleListener());
@ -874,7 +871,7 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
documentViewStub.get().setDownloadClickListener(singleDownloadClickListener); documentViewStub.get().setDownloadClickListener(singleDownloadClickListener);
documentViewStub.get().setOnLongClickListener(passthroughClickListener); documentViewStub.get().setOnLongClickListener(passthroughClickListener);
ViewUtil.updateLayoutParams(bodyFooterContainer, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewUtil.updateLayoutParams(bodyText, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ViewUtil.updateLayoutParamsIfNonNull(groupSenderHolder, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewUtil.updateLayoutParamsIfNonNull(groupSenderHolder, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ViewUtil.setTopMargin(bodyText, 0); ViewUtil.setTopMargin(bodyText, 0);
@ -904,7 +901,7 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
stickerStub.get().setOnLongClickListener(passthroughClickListener); stickerStub.get().setOnLongClickListener(passthroughClickListener);
stickerStub.get().setOnClickListener(passthroughClickListener); stickerStub.get().setOnClickListener(passthroughClickListener);
ViewUtil.updateLayoutParams(bodyFooterContainer, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewUtil.updateLayoutParams(bodyText, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ViewUtil.updateLayoutParamsIfNonNull(groupSenderHolder, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewUtil.updateLayoutParamsIfNonNull(groupSenderHolder, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
footer.setVisibility(VISIBLE); footer.setVisibility(VISIBLE);
@ -940,7 +937,7 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
setThumbnailCorners(messageRecord, previousRecord, nextRecord, isGroupThread); setThumbnailCorners(messageRecord, previousRecord, nextRecord, isGroupThread);
ViewUtil.updateLayoutParams(bodyFooterContainer, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewUtil.updateLayoutParams(bodyText, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ViewUtil.updateLayoutParamsIfNonNull(groupSenderHolder, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewUtil.updateLayoutParamsIfNonNull(groupSenderHolder, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
footer.setVisibility(VISIBLE); footer.setVisibility(VISIBLE);
@ -969,7 +966,7 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
if (stickerStub.resolved()) stickerStub.get().setVisibility(View.GONE); if (stickerStub.resolved()) stickerStub.get().setVisibility(View.GONE);
if (revealableStub.resolved()) revealableStub.get().setVisibility(View.GONE); if (revealableStub.resolved()) revealableStub.get().setVisibility(View.GONE);
ViewUtil.updateLayoutParams(bodyFooterContainer, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewUtil.updateLayoutParams(bodyText, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ViewUtil.updateLayoutParamsIfNonNull(groupSenderHolder, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); ViewUtil.updateLayoutParamsIfNonNull(groupSenderHolder, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
footer.setVisibility(VISIBLE); footer.setVisibility(VISIBLE);

View file

@ -163,14 +163,6 @@
android:layout_marginBottom="@dimen/message_bubble_bottom_padding" android:layout_marginBottom="@dimen/message_bubble_bottom_padding"
android:layout="@layout/conversation_item_received_revealable" /> android:layout="@layout/conversation_item_received_revealable" />
<LinearLayout
android:id="@+id/conversation_item_body_footer_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical">
<org.thoughtcrime.securesms.components.emoji.EmojiTextView <org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/conversation_item_body" android:id="@+id/conversation_item_body"
style="@style/Signal.Text.Body" style="@style/Signal.Text.Body"
@ -195,6 +187,7 @@
android:layout_marginTop="-4dp" android:layout_marginTop="-4dp"
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" android:layout_marginEnd="@dimen/message_bubble_horizontal_padding"
android:layout_marginBottom="@dimen/message_bubble_bottom_padding" android:layout_marginBottom="@dimen/message_bubble_bottom_padding"
android:layout_gravity="end"
android:alpha="0.7" android:alpha="0.7"
android:clipChildren="false" android:clipChildren="false"
android:clipToPadding="false" android:clipToPadding="false"
@ -202,7 +195,6 @@
app:footer_mode="incoming" app:footer_mode="incoming"
app:footer_reveal_dot_color="@color/conversation_item_sent_text_secondary_color" app:footer_reveal_dot_color="@color/conversation_item_sent_text_secondary_color"
app:footer_text_color="@color/conversation_item_sent_text_secondary_color" /> app:footer_text_color="@color/conversation_item_sent_text_secondary_color" />
</LinearLayout>
<org.thoughtcrime.securesms.components.ConversationItemFooter <org.thoughtcrime.securesms.components.ConversationItemFooter
android:id="@+id/conversation_item_sticker_footer" android:id="@+id/conversation_item_sticker_footer"

View file

@ -93,14 +93,6 @@
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/conversation_item_body_footer_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical">
<org.thoughtcrime.securesms.components.emoji.EmojiTextView <org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/conversation_item_body" android:id="@+id/conversation_item_body"
style="@style/Signal.Text.Body" style="@style/Signal.Text.Body"
@ -133,8 +125,6 @@
app:footer_reveal_dot_color="@color/signal_icon_tint_secondary" app:footer_reveal_dot_color="@color/signal_icon_tint_secondary"
app:footer_text_color="@color/signal_text_secondary" /> app:footer_text_color="@color/signal_text_secondary" />
</LinearLayout>
<org.thoughtcrime.securesms.components.ConversationItemFooter <org.thoughtcrime.securesms.components.ConversationItemFooter
android:id="@+id/conversation_item_sticker_footer" android:id="@+id/conversation_item_sticker_footer"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -115,14 +115,6 @@
android:layout_marginBottom="@dimen/message_bubble_bottom_padding" android:layout_marginBottom="@dimen/message_bubble_bottom_padding"
android:layout="@layout/conversation_item_sent_revealable" /> android:layout="@layout/conversation_item_sent_revealable" />
<LinearLayout
android:id="@+id/conversation_item_body_footer_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical">
<org.thoughtcrime.securesms.components.emoji.EmojiTextView <org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/conversation_item_body" android:id="@+id/conversation_item_body"
style="@style/Signal.Text.Body" style="@style/Signal.Text.Body"
@ -154,8 +146,6 @@
app:footer_reveal_dot_color="@color/signal_icon_tint_secondary" app:footer_reveal_dot_color="@color/signal_icon_tint_secondary"
app:footer_text_color="@color/signal_text_secondary" /> app:footer_text_color="@color/signal_text_secondary" />
</LinearLayout>
<org.thoughtcrime.securesms.components.ConversationItemFooter <org.thoughtcrime.securesms.components.ConversationItemFooter
android:id="@+id/conversation_item_sticker_footer" android:id="@+id/conversation_item_sticker_footer"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -46,14 +46,6 @@
android:orientation="vertical" android:orientation="vertical"
tools:backgroundTint="@color/core_grey_05"> tools:backgroundTint="@color/core_grey_05">
<LinearLayout
android:id="@+id/conversation_item_body_footer_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical">
<org.thoughtcrime.securesms.components.emoji.EmojiTextView <org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/conversation_item_body" android:id="@+id/conversation_item_body"
style="@style/Signal.Text.Body" style="@style/Signal.Text.Body"
@ -78,6 +70,7 @@
android:layout_marginTop="-5dp" android:layout_marginTop="-5dp"
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" android:layout_marginEnd="@dimen/message_bubble_horizontal_padding"
android:layout_marginBottom="@dimen/message_bubble_bottom_padding" android:layout_marginBottom="@dimen/message_bubble_bottom_padding"
android:layout_gravity="end"
android:clipChildren="false" android:clipChildren="false"
android:clipToPadding="false" android:clipToPadding="false"
app:footer_icon_color="@color/conversation_item_sent_text_secondary_color" app:footer_icon_color="@color/conversation_item_sent_text_secondary_color"
@ -85,8 +78,6 @@
app:footer_reveal_dot_color="@color/conversation_item_sent_text_secondary_color" app:footer_reveal_dot_color="@color/conversation_item_sent_text_secondary_color"
app:footer_text_color="@color/conversation_item_sent_text_secondary_color" /> app:footer_text_color="@color/conversation_item_sent_text_secondary_color" />
</LinearLayout>
<org.thoughtcrime.securesms.components.ConversationItemFooter <org.thoughtcrime.securesms.components.ConversationItemFooter
android:id="@+id/conversation_item_sticker_footer" android:id="@+id/conversation_item_sticker_footer"
android:layout_width="wrap_content" android:layout_width="wrap_content"