11111
This commit is contained in:
@@ -31,16 +31,18 @@ public class PDLiveMessageListAdapter extends MessageListAdapter {
|
||||
Message.MessageDirection messageDirection = mDataList.get(position).getMessage().getMessageDirection();
|
||||
Message.SentStatus sentStatus = mDataList.get(position).getMessage().getSentStatus();
|
||||
ImageView readReceipt = holder.getConvertView().findViewById(R.id.rc_read_receipt);
|
||||
readReceipt.setVisibility(View.GONE);
|
||||
ImageView readReceiptNew = holder.getConvertView().findViewById(R.id.rc_read_receipt_new);
|
||||
if (readReceipt != null && readReceiptNew != null) {
|
||||
if (readReceipt.getVisibility() == View.VISIBLE) {
|
||||
readReceipt.setVisibility(View.GONE);
|
||||
if (!mDataList.get(position).getMessage().getSenderUserId().equals(mDataList.get(position).getTargetId())) {
|
||||
if (sentStatus.equals(Message.SentStatus.READ)) {
|
||||
readReceiptNew.setBackgroundResource(R.mipmap.icon_message_read);
|
||||
} else {
|
||||
if (messageDirection.equals(Message.MessageDirection.SEND) && sentStatus.equals(Message.SentStatus.SENT))
|
||||
readReceiptNew.setBackgroundResource(R.mipmap.icon_message_unread);
|
||||
readReceiptNew.setBackgroundResource(R.mipmap.icon_message_unread);
|
||||
}
|
||||
} else {
|
||||
readReceipt.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
holder.getConvertView().setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
@@ -50,4 +52,5 @@ public class PDLiveMessageListAdapter extends MessageListAdapter {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,30 +26,6 @@
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rc_conversation_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_conversation_unread_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
app:srcCompat="@drawable/rc_unread_count_bg_normal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_unread_count"
|
||||
style="@style/TextStyle.Alignment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="15"
|
||||
android:textColor="@color/rc_white_color"
|
||||
android:textSize="@dimen/rc_font_auxiliary_size" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
@@ -72,9 +48,9 @@
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintStart_toEndOf="@+id/rc_conversation_portrait_rl"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rc_conversation_title">
|
||||
|
||||
@@ -86,18 +62,51 @@
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="4dp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/rc_margin"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="1dp"
|
||||
android:visibility="gone"
|
||||
android:layout_marginStart="15dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_content"
|
||||
style="@style/TextStyle.Alignment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="60dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:text="你好,朋友!"
|
||||
android:textColor="@color/rc_secondary_color"
|
||||
android:textSize="@dimen/rc_font_text_third_size" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rc_conversation_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_conversation_unread_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
app:srcCompat="@drawable/rc_unread_count_bg_normal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_unread_count"
|
||||
style="@style/TextStyle.Alignment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="15"
|
||||
android:textColor="@color/rc_white_color"
|
||||
android:textSize="@dimen/rc_font_auxiliary_size" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user