会话列表与结构微调
这个提交包含在:
父节点
3497b02341
当前提交
ef3e5bb0bc
@ -268,7 +268,7 @@ public class ImManager implements IMInterface {
|
|||||||
szyxMessage.setDescribe(describe);
|
szyxMessage.setDescribe(describe);
|
||||||
szyxMessage.setGroup(isGroup);
|
szyxMessage.setGroup(isGroup);
|
||||||
szyxMessage.setStatus(1);
|
szyxMessage.setStatus(1);
|
||||||
szyxMessage.setFromClient(UserManager.getInstance().getUserInfoForMsg());
|
szyxMessage.setFromClientId(Constant.getUserId());
|
||||||
if (isGroup)
|
if (isGroup)
|
||||||
szyxMessage.setGroupID(toUserId);
|
szyxMessage.setGroupID(toUserId);
|
||||||
else
|
else
|
||||||
|
|||||||
@ -18,8 +18,7 @@ public class ConversationMessage extends PacketMessage {
|
|||||||
private SZYXMessage message;
|
private SZYXMessage message;
|
||||||
|
|
||||||
private GroupInfo groupEntity;
|
private GroupInfo groupEntity;
|
||||||
private UserInfo userInfo;
|
private String userId;
|
||||||
private UserInfo self;
|
|
||||||
|
|
||||||
public ConversationMessage(PacketType packetType) {
|
public ConversationMessage(PacketType packetType) {
|
||||||
super(packetType);
|
super(packetType);
|
||||||
@ -57,20 +56,12 @@ public class ConversationMessage extends PacketMessage {
|
|||||||
this.groupEntity = groupEntity;
|
this.groupEntity = groupEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserInfo getUserInfo() {
|
public String getUserId() {
|
||||||
return userInfo;
|
return userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserInfo(UserInfo userInfo) {
|
public void setUserId(String userId) {
|
||||||
this.userInfo = userInfo;
|
this.userId = userId;
|
||||||
}
|
|
||||||
|
|
||||||
public UserInfo getSelf() {
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSelf(UserInfo self) {
|
|
||||||
this.self = self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -80,8 +71,7 @@ public class ConversationMessage extends PacketMessage {
|
|||||||
", isGroup=" + isGroup +
|
", isGroup=" + isGroup +
|
||||||
", message=" + message +
|
", message=" + message +
|
||||||
", groupEntity=" + groupEntity +
|
", groupEntity=" + groupEntity +
|
||||||
", userInfo=" + userInfo +
|
", userId=" + userId +
|
||||||
", self=" + self +
|
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ public class SZYXMessage extends PacketMessage {
|
|||||||
/**
|
/**
|
||||||
* 发送者信息
|
* 发送者信息
|
||||||
*/
|
*/
|
||||||
private UserInfo fromClient;
|
private String fromClientId;
|
||||||
/**
|
/**
|
||||||
* 接收者信息
|
* 接收者信息
|
||||||
*/
|
*/
|
||||||
@ -48,12 +48,12 @@ public class SZYXMessage extends PacketMessage {
|
|||||||
private MsgType msgType;
|
private MsgType msgType;
|
||||||
private SZYXTextMessage textMessage;
|
private SZYXTextMessage textMessage;
|
||||||
|
|
||||||
public UserInfo getFromClient() {
|
public String getFromClientId() {
|
||||||
return fromClient;
|
return fromClientId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFromClient(UserInfo fromClient) {
|
public void setFromClientId(String fromClientId) {
|
||||||
this.fromClient = fromClient;
|
this.fromClientId = fromClientId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getToClientId() {
|
public String getToClientId() {
|
||||||
@ -124,7 +124,7 @@ public class SZYXMessage extends PacketMessage {
|
|||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "SZYXMessage{" +
|
return "SZYXMessage{" +
|
||||||
"fromClient=" + fromClient +
|
"fromClient=" + fromClientId +
|
||||||
", toClientId='" + toClientId + '\'' +
|
", toClientId='" + toClientId + '\'' +
|
||||||
", groupID='" + groupID + '\'' +
|
", groupID='" + groupID + '\'' +
|
||||||
", describe='" + describe + '\'' +
|
", describe='" + describe + '\'' +
|
||||||
|
|||||||
@ -34,8 +34,8 @@ public class ChatAdapter extends BaseNormalAdapter<SZYXMessage> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void convert(ViewHolder holder, SZYXMessage item, int position) {
|
public void convert(ViewHolder holder, SZYXMessage item, int position) {
|
||||||
holder.setImage(R.id.avatar, item.getFromClient().getFaceUrl());
|
holder.setImage(R.id.avatar, SZYXImSdk.getInstance().getUser(item.getFromClientId()).getFaceUrl());
|
||||||
holder.setText(R.id.name, item.getFromClient().getNickName());
|
holder.setText(R.id.name, SZYXImSdk.getInstance().getUser(item.getFromClientId()).getNickName());
|
||||||
ChatAdapter.this.convert(holder, item, position);
|
ChatAdapter.this.convert(holder, item, position);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -26,7 +26,6 @@
|
|||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/baseRecyclerView"
|
android:id="@+id/baseRecyclerView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:paddingHorizontal="20dp"
|
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:overScrollMode="never" />
|
android:overScrollMode="never" />
|
||||||
|
|
||||||
|
|||||||
@ -23,34 +23,19 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/time" />
|
app:layout_constraintTop_toBottomOf="@+id/time" />
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/name"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
android:text="小明"
|
|
||||||
android:textColor="#767581"
|
|
||||||
android:textSize="10sp"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/avatar"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/avatar" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/content"
|
android:id="@+id/content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="20dp"
|
android:layout_marginStart="20dp"
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="5dp"
|
android:layout_marginEnd="5dp"
|
||||||
android:background="#FFFFFF"
|
android:background="#FFFFFF"
|
||||||
android:gravity="right"
|
android:gravity="right"
|
||||||
android:minWidth="70dp"
|
|
||||||
android:minHeight="40dp"
|
android:minHeight="40dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/avatar"
|
app:layout_constraintEnd_toStartOf="@+id/avatar"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/name"
|
app:layout_constraintTop_toTopOf="@+id/avatar"
|
||||||
app:layout_constraintWidth_max="240dp">
|
app:layout_constraintWidth_max="240dp">
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户