kopia lustrzana https://github.com/ryukoposting/Signal-Android
rodzic
b21bd5a01e
commit
66b6420f21
|
@ -523,14 +523,13 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
|||
int availableWidth = getAvailableMessageBubbleWidth(footer);
|
||||
|
||||
if (activeFooter.getVisibility() != GONE && activeFooter.getMeasuredWidth() != availableWidth) {
|
||||
activeFooter.getLayoutParams().width = availableWidth - ViewUtil.getLeftMargin(activeFooter) - ViewUtil.getRightMargin(activeFooter);
|
||||
activeFooter.getLayoutParams().width = availableWidth;
|
||||
needsMeasure = true;
|
||||
updatingFooter = true;
|
||||
}
|
||||
|
||||
if (bodyBubble.getMeasuredWidth() != availableWidth) {
|
||||
bodyBubble.getLayoutParams().width = availableWidth;
|
||||
audioViewStub.get().getLayoutParams().width = availableWidth - ViewUtil.getLeftMargin(audioViewStub.get()) - ViewUtil.getRightMargin(audioViewStub.get());
|
||||
int desiredWidth = audioViewStub.get().getMeasuredWidth() + ViewUtil.getLeftMargin(audioViewStub.get()) + ViewUtil.getRightMargin(audioViewStub.get());
|
||||
if (bodyBubble.getMeasuredWidth() != desiredWidth) {
|
||||
bodyBubble.getLayoutParams().width = desiredWidth;
|
||||
needsMeasure = true;
|
||||
}
|
||||
}
|
||||
|
@ -575,7 +574,7 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
|||
private int getAvailableMessageBubbleWidth(@NonNull View forView) {
|
||||
int availableWidth;
|
||||
if (hasAudio(messageRecord)) {
|
||||
availableWidth = Math.min(getMaxBubbleWidth(), readDimen(R.dimen.message_audio_width));
|
||||
availableWidth = audioViewStub.get().getMeasuredWidth() + ViewUtil.getLeftMargin(audioViewStub.get()) + ViewUtil.getRightMargin(audioViewStub.get());
|
||||
} else if (!isViewOnceMessage(messageRecord) && (hasThumbnail(messageRecord) || hasBigImageLinkPreview(messageRecord))) {
|
||||
availableWidth = mediaThumbnailStub.require().getMeasuredWidth();
|
||||
} else {
|
||||
|
@ -1520,7 +1519,7 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
|||
}
|
||||
|
||||
private void setFooter(@NonNull MessageRecord current, @NonNull Optional<MessageRecord> next, @NonNull Locale locale, boolean isGroupThread, boolean hasWallpaper) {
|
||||
ViewUtil.updateLayoutParams(footer, hasAudio(current) ? LayoutParams.MATCH_PARENT : LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
|
||||
ViewUtil.updateLayoutParams(footer, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
|
||||
ViewUtil.setTopMargin(footer, readDimen(R.dimen.message_bubble_default_footer_bottom_margin));
|
||||
|
||||
footer.setVisibility(GONE);
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
style="@style/Signal.Text.Caption.MessageSent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="56dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/audio_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="@dimen/message_audio_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxWidth="@dimen/message_audio_width"
|
||||
android:visibility="gone"
|
||||
app:backgroundTintColor="@color/white"
|
||||
app:foregroundTintColor="@color/grey_500"
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/audio_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="@dimen/message_audio_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxWidth="@dimen/message_audio_width"
|
||||
android:visibility="gone"
|
||||
app:backgroundTintColor="@color/blue_500"
|
||||
app:foregroundTintColor="@color/white"
|
||||
|
|
Ładowanie…
Reference in New Issue