Update message details fragment with material3 spec.
This commit is contained in:
parent
9c7c94b2d4
commit
af32e156c2
5 changed files with 54 additions and 49 deletions
|
@ -141,19 +141,19 @@ final class MessageHeaderViewHolder extends RecyclerView.ViewHolder implements G
|
|||
receivedDate.setOnLongClickListener(null);
|
||||
|
||||
if (messageRecord.isPending() || messageRecord.isFailed()) {
|
||||
sentDate.setText(formatBoldString(R.string.message_details_header__sent, "-"));
|
||||
sentDate.setText(formatBoldString(R.string.message_details_header_sent, "-"));
|
||||
receivedDate.setVisibility(View.GONE);
|
||||
} else {
|
||||
Locale dateLocale = Locale.getDefault();
|
||||
SimpleDateFormat dateFormatter = DateUtils.getDetailedDateFormatter(itemView.getContext(), dateLocale);
|
||||
sentDate.setText(formatBoldString(R.string.message_details_header__sent, dateFormatter.format(new Date(messageRecord.getDateSent()))));
|
||||
sentDate.setText(formatBoldString(R.string.message_details_header_sent, dateFormatter.format(new Date(messageRecord.getDateSent()))));
|
||||
sentDate.setOnLongClickListener(v -> {
|
||||
copyToClipboard(String.valueOf(messageRecord.getDateSent()));
|
||||
return true;
|
||||
});
|
||||
|
||||
if (messageRecord.getDateReceived() != messageRecord.getDateSent() && !messageRecord.isOutgoing()) {
|
||||
receivedDate.setText(formatBoldString(R.string.message_details_header__received, dateFormatter.format(new Date(messageRecord.getDateReceived()))));
|
||||
receivedDate.setText(formatBoldString(R.string.message_details_header_received, dateFormatter.format(new Date(messageRecord.getDateReceived()))));
|
||||
receivedDate.setOnLongClickListener(v -> {
|
||||
copyToClipboard(String.valueOf(messageRecord.getDateReceived()));
|
||||
return true;
|
||||
|
@ -197,7 +197,7 @@ final class MessageHeaderViewHolder extends RecyclerView.ViewHolder implements G
|
|||
transportText = itemView.getContext().getString(R.string.ConversationFragment_sms);
|
||||
}
|
||||
|
||||
transport.setText(formatBoldString(R.string.message_details_header__via, transportText));
|
||||
transport.setText(formatBoldString(R.string.message_details_header_via, transportText));
|
||||
}
|
||||
|
||||
private CharSequence formatBoldString(int boldTextRes, CharSequence otherText) {
|
||||
|
@ -274,7 +274,7 @@ final class MessageHeaderViewHolder extends RecyclerView.ViewHolder implements G
|
|||
int expirationTime = Math.max((int) (remaining / 1000), 1);
|
||||
String duration = ExpirationUtil.getExpirationDisplayValue(itemView.getContext(), expirationTime);
|
||||
|
||||
expiresIn.setText(formatBoldString(R.string.message_details_header__disappears, duration));
|
||||
expiresIn.setText(formatBoldString(R.string.message_details_header_disappears, duration));
|
||||
|
||||
if (running && expirationTime > 1) {
|
||||
ThreadUtil.runOnMainDelayed(this, 500);
|
||||
|
|
|
@ -10,33 +10,32 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingBottom="32dp">
|
||||
android:paddingTop="24dp">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp">
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp">
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/message_details_header_message_view_update"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout="@layout/conversation_item_update"/>
|
||||
android:layout="@layout/conversation_item_update" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/message_details_header_message_view_sent_multimedia"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout="@layout/conversation_item_sent_multimedia"/>
|
||||
android:layout="@layout/conversation_item_sent_multimedia" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/message_details_header_message_view_received_multimedia"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:visibility="visible"
|
||||
android:layout="@layout/conversation_item_received_multimedia"/>
|
||||
android:layout="@layout/conversation_item_received_multimedia"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
@ -52,44 +51,46 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone"
|
||||
android:textSize="16sp"
|
||||
android:padding="5dp"
|
||||
tools:visibility="visible"
|
||||
android:text="@string/message_details_header__issues_need_your_attention"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="5dp"
|
||||
android:text="@string/message_details_header__issues_need_your_attention"
|
||||
android:textAppearance="@style/Signal.Text.BodyLarge"
|
||||
android:visibility="gone"
|
||||
app:drawableStartCompat="@drawable/ic_info_outline_message_details_24"
|
||||
android:gravity="center_vertical" />
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/message_details_header_resend_button"
|
||||
style="@style/Signal.Widget.Button.Medium.Tonal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Signal.Widget.Button.Medium.Tonal"
|
||||
android:layout_gravity="center_vertical"
|
||||
app:icon="@drawable/ic_refresh_white_18dp"
|
||||
android:text="@string/message_recipients_list_item__resend"
|
||||
android:visibility="gone"
|
||||
app:icon="@drawable/ic_refresh_white_18dp"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/message_details_header_message_metadata"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginStart="@dimen/dsl_settings_gutter"
|
||||
android:layout_marginEnd="@dimen/dsl_settings_gutter"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dsl_settings_gutter"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="@dimen/dsl_settings_gutter">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message_details_header_sent_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
tools:text="@string/message_details_header__sent"
|
||||
android:textAppearance="@style/Signal.Text.BodyMedium"
|
||||
android:textColor="@color/signal_colorOnSurfaceVariant"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="@string/message_details_header_sent" />
|
||||
|
||||
|
||||
<TextView
|
||||
|
@ -97,37 +98,42 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
tools:text="@string/message_details_header__received"
|
||||
android:textAppearance="@style/Signal.Text.BodyMedium"
|
||||
android:textColor="@color/signal_colorOnSurfaceVariant"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/message_details_header_sent_time" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/message_details_header_sent_time"
|
||||
tools:text="@string/message_details_header_received" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message_details_header_expires_in"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
tools:text="@string/message_details_header__disappears"
|
||||
android:textAppearance="@style/Signal.Text.BodyMedium"
|
||||
android:textColor="@color/signal_colorOnSurfaceVariant"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/message_details_header_received_time" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/message_details_header_received_time"
|
||||
tools:text="@string/message_details_header_disappears" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message_details_header_transport"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
tools:text="@string/message_details_header__via"
|
||||
android:textAppearance="@style/Signal.Text.BodyMedium"
|
||||
android:textColor="@color/signal_colorOnSurfaceVariant"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/message_details_header_expires_in" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/message_details_header_expires_in"
|
||||
tools:text="@string/message_details_header_via" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<include
|
||||
layout="@layout/dsl_divider_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginTop="24dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@color/signal_inverse_transparent_05" />
|
||||
|
||||
</FrameLayout>
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
style="@style/Signal.Text.BodyMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/signal_colorSurfaceVariant"
|
||||
android:textColor="@color/signal_colorOnSurfaceVariant"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/message_details_recipient_conflict_button"
|
||||
|
@ -104,7 +104,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="9dp"
|
||||
android:tint="@color/signal_text_hint"
|
||||
android:tint="@color/signal_colorOnSurfaceVariant"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/message_details_recipient_conflict_button"
|
||||
app:layout_constraintStart_toEndOf="@+id/message_details_recipient_name"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/dsl_settings_gutter"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="@dimen/dsl_settings_gutter"
|
||||
android:paddingBottom="12dp">
|
||||
|
||||
|
@ -22,8 +22,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body1.Bold"
|
||||
android:textStyle="bold"
|
||||
android:textAppearance="@style/Signal.Text.TitleSmall"
|
||||
tools:text="Read by" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.DeliveryStatusView
|
||||
|
|
|
@ -2353,10 +2353,10 @@
|
|||
|
||||
<!-- message_details_header -->
|
||||
<string name="message_details_header__issues_need_your_attention">Some issues need your attention.</string>
|
||||
<string name="message_details_header__sent">Sent:</string>
|
||||
<string name="message_details_header__received">Received:</string>
|
||||
<string name="message_details_header__disappears">Disappears:</string>
|
||||
<string name="message_details_header__via">Via:</string>
|
||||
<string name="message_details_header_sent">Sent</string>
|
||||
<string name="message_details_header_received">Received</string>
|
||||
<string name="message_details_header_disappears">Disappears</string>
|
||||
<string name="message_details_header_via">Via</string>
|
||||
|
||||
<!-- message_details_recipient_header -->
|
||||
<string name="message_details_recipient_header__pending_send">Pending</string>
|
||||
|
|
Loading…
Add table
Reference in a new issue