kopia lustrzana https://github.com/ryukoposting/Signal-Android
Update message details fragment with material3 spec.
rodzic
9c7c94b2d4
commit
af32e156c2
|
@ -141,19 +141,19 @@ final class MessageHeaderViewHolder extends RecyclerView.ViewHolder implements G
|
||||||
receivedDate.setOnLongClickListener(null);
|
receivedDate.setOnLongClickListener(null);
|
||||||
|
|
||||||
if (messageRecord.isPending() || messageRecord.isFailed()) {
|
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);
|
receivedDate.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
Locale dateLocale = Locale.getDefault();
|
Locale dateLocale = Locale.getDefault();
|
||||||
SimpleDateFormat dateFormatter = DateUtils.getDetailedDateFormatter(itemView.getContext(), dateLocale);
|
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 -> {
|
sentDate.setOnLongClickListener(v -> {
|
||||||
copyToClipboard(String.valueOf(messageRecord.getDateSent()));
|
copyToClipboard(String.valueOf(messageRecord.getDateSent()));
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (messageRecord.getDateReceived() != messageRecord.getDateSent() && !messageRecord.isOutgoing()) {
|
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 -> {
|
receivedDate.setOnLongClickListener(v -> {
|
||||||
copyToClipboard(String.valueOf(messageRecord.getDateReceived()));
|
copyToClipboard(String.valueOf(messageRecord.getDateReceived()));
|
||||||
return true;
|
return true;
|
||||||
|
@ -197,7 +197,7 @@ final class MessageHeaderViewHolder extends RecyclerView.ViewHolder implements G
|
||||||
transportText = itemView.getContext().getString(R.string.ConversationFragment_sms);
|
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) {
|
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);
|
int expirationTime = Math.max((int) (remaining / 1000), 1);
|
||||||
String duration = ExpirationUtil.getExpirationDisplayValue(itemView.getContext(), expirationTime);
|
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) {
|
if (running && expirationTime > 1) {
|
||||||
ThreadUtil.runOnMainDelayed(this, 500);
|
ThreadUtil.runOnMainDelayed(this, 500);
|
||||||
|
|
|
@ -10,14 +10,13 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingTop="24dp"
|
android:paddingTop="24dp">
|
||||||
android:paddingBottom="32dp">
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginEnd="16dp">
|
android:layout_marginEnd="8dp">
|
||||||
|
|
||||||
<ViewStub
|
<ViewStub
|
||||||
android:id="@+id/message_details_header_message_view_update"
|
android:id="@+id/message_details_header_message_view_update"
|
||||||
|
@ -35,8 +34,8 @@
|
||||||
android:id="@+id/message_details_header_message_view_received_multimedia"
|
android:id="@+id/message_details_header_message_view_received_multimedia"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
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>
|
</FrameLayout>
|
||||||
|
|
||||||
|
@ -52,44 +51,46 @@
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
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: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"
|
app:drawableStartCompat="@drawable/ic_info_outline_message_details_24"
|
||||||
android:gravity="center_vertical" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/message_details_header_resend_button"
|
android:id="@+id/message_details_header_resend_button"
|
||||||
|
style="@style/Signal.Widget.Button.Medium.Tonal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/Signal.Widget.Button.Medium.Tonal"
|
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
app:icon="@drawable/ic_refresh_white_18dp"
|
|
||||||
android:text="@string/message_recipients_list_item__resend"
|
android:text="@string/message_recipients_list_item__resend"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
|
app:icon="@drawable/ic_refresh_white_18dp"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/message_details_header_message_metadata"
|
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_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
|
<TextView
|
||||||
android:id="@+id/message_details_header_sent_time"
|
android:id="@+id/message_details_header_sent_time"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="4dp"
|
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_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="@string/message_details_header_sent" />
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -97,37 +98,42 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="4dp"
|
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_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
|
<TextView
|
||||||
android:id="@+id/message_details_header_expires_in"
|
android:id="@+id/message_details_header_expires_in"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="4dp"
|
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_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
|
<TextView
|
||||||
android:id="@+id/message_details_header_transport"
|
android:id="@+id/message_details_header_transport"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="4dp"
|
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_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>
|
</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>
|
</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>
|
</FrameLayout>
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
style="@style/Signal.Text.BodyMedium"
|
style="@style/Signal.Text.BodyMedium"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@color/signal_colorSurfaceVariant"
|
android:textColor="@color/signal_colorOnSurfaceVariant"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/message_details_recipient_conflict_button"
|
app:layout_constraintStart_toEndOf="@+id/message_details_recipient_conflict_button"
|
||||||
|
@ -104,7 +104,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="4dp"
|
android:layout_marginStart="4dp"
|
||||||
android:layout_marginEnd="9dp"
|
android:layout_marginEnd="9dp"
|
||||||
android:tint="@color/signal_text_hint"
|
android:tint="@color/signal_colorOnSurfaceVariant"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/message_details_recipient_conflict_button"
|
app:layout_constraintEnd_toStartOf="@+id/message_details_recipient_conflict_button"
|
||||||
app:layout_constraintStart_toEndOf="@+id/message_details_recipient_name"
|
app:layout_constraintStart_toEndOf="@+id/message_details_recipient_name"
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingStart="@dimen/dsl_settings_gutter"
|
android:paddingStart="@dimen/dsl_settings_gutter"
|
||||||
android:paddingTop="24dp"
|
android:paddingTop="16dp"
|
||||||
android:paddingEnd="@dimen/dsl_settings_gutter"
|
android:paddingEnd="@dimen/dsl_settings_gutter"
|
||||||
android:paddingBottom="12dp">
|
android:paddingBottom="12dp">
|
||||||
|
|
||||||
|
@ -22,8 +22,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:textAppearance="@style/TextAppearance.Signal.Body1.Bold"
|
android:textAppearance="@style/Signal.Text.TitleSmall"
|
||||||
android:textStyle="bold"
|
|
||||||
tools:text="Read by" />
|
tools:text="Read by" />
|
||||||
|
|
||||||
<org.thoughtcrime.securesms.components.DeliveryStatusView
|
<org.thoughtcrime.securesms.components.DeliveryStatusView
|
||||||
|
|
|
@ -2353,10 +2353,10 @@
|
||||||
|
|
||||||
<!-- message_details_header -->
|
<!-- message_details_header -->
|
||||||
<string name="message_details_header__issues_need_your_attention">Some issues need your attention.</string>
|
<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_sent">Sent</string>
|
||||||
<string name="message_details_header__received">Received:</string>
|
<string name="message_details_header_received">Received</string>
|
||||||
<string name="message_details_header__disappears">Disappears:</string>
|
<string name="message_details_header_disappears">Disappears</string>
|
||||||
<string name="message_details_header__via">Via:</string>
|
<string name="message_details_header_via">Via</string>
|
||||||
|
|
||||||
<!-- message_details_recipient_header -->
|
<!-- message_details_recipient_header -->
|
||||||
<string name="message_details_recipient_header__pending_send">Pending</string>
|
<string name="message_details_recipient_header__pending_send">Pending</string>
|
||||||
|
|
Ładowanie…
Reference in New Issue