update 修正聊天页在线离线状态
update 聊天页长按删除功能
This commit is contained in:
parent
c3ca76df07
commit
d39facbcc7
@ -257,6 +257,8 @@ public class IMLoginModel extends BaseModel {
|
||||
private String guardType = "";
|
||||
@SerializedName("isAttention")
|
||||
private int attention;
|
||||
@SerializedName("type")
|
||||
private String type;
|
||||
|
||||
public int getAttention() {
|
||||
return attention;
|
||||
@ -270,6 +272,14 @@ public class IMLoginModel extends BaseModel {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public IMLoginModel setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
return this;
|
||||
|
@ -108,7 +108,7 @@ public class MessageUserInfoBean extends BaseModel{
|
||||
@SerializedName("open_off")
|
||||
private int openOff;//接单设置 1开启 2关闭
|
||||
@SerializedName("rong_online")
|
||||
private int rongOnline;
|
||||
private int rongOnline;//0 在线 非0 其他
|
||||
|
||||
public void setOpenOff(int openOff) {
|
||||
this.openOff = openOff;
|
||||
|
@ -52,14 +52,14 @@ public class MessageLongClickPopuwindow implements View.OnClickListener {
|
||||
Log.e("MessageLongClick ", "currentTimeMillis:" + System.currentTimeMillis());
|
||||
Log.e("MessageLongClick ", "秒:" + ((System.currentTimeMillis() - sentTime) / 1000));
|
||||
//超过俩分钟无法撤回
|
||||
if (((System.currentTimeMillis() - sentTime) / 1000) > 120) {
|
||||
/* if (((System.currentTimeMillis() - sentTime) / 1000) > 120) {
|
||||
withdrawLinear.setVisibility(View.GONE);
|
||||
}
|
||||
//只可以撤回自己的消息
|
||||
IMLoginModel model = IMLoginManager.get(mContext).getUserInfo();
|
||||
if (!message.getSenderUserId().equals(String.valueOf(model.getId()))) {
|
||||
withdrawLinear.setVisibility(View.GONE);
|
||||
}
|
||||
}*/
|
||||
//非文字信息无法复制
|
||||
if (!message.getObjectName().equals("RC:TxtMsg")) {
|
||||
copyLinear.setVisibility(View.GONE);
|
||||
@ -106,7 +106,8 @@ public class MessageLongClickPopuwindow implements View.OnClickListener {
|
||||
copyMethod();
|
||||
popupWindow.dismiss();
|
||||
} else if (id == R.id.withdraw_linear) {//撤回
|
||||
withdrawMethod();
|
||||
// withdrawMethod();
|
||||
delete();
|
||||
popupWindow.dismiss();
|
||||
} else if (id == R.id.quote_linear) {//引用
|
||||
List<MessageItemLongClickAction> messageItemLongClickActionList = MessageItemLongClickActionManager.getInstance().getMessageItemLongClickActions();
|
||||
@ -115,6 +116,20 @@ public class MessageLongClickPopuwindow implements View.OnClickListener {
|
||||
|
||||
}
|
||||
|
||||
private void delete() {
|
||||
IMCenter.getInstance().deleteMessages(message.getConversationType(), message.getTargetId(), new int[]{message.getMessageId()}, new RongIMClient.ResultCallback<Boolean>() {
|
||||
@Override
|
||||
public void onSuccess(Boolean aBoolean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void copyMethod() {
|
||||
//文字消息支持复制
|
||||
if (message.getContent() instanceof TextMessage) {
|
||||
|
@ -10,24 +10,25 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
|
||||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/copy_linear"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@mipmap/icon_message_copy"
|
||||
|
||||
android:drawablePadding="5dp"
|
||||
android:text="@string/copy"
|
||||
android:textColor="@color/white"
|
||||
@ -38,18 +39,17 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/withdraw_linear"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@mipmap/icon_message_withdraw"
|
||||
android:drawablePadding="5dp"
|
||||
android:text="@string/withdraw"
|
||||
android:text="@string/delete"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
@ -58,12 +58,12 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/quote_linear"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="5dp">
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -270,13 +270,18 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
|
||||
ImgLoader.display(mContext, data.getUser().getAvatar(), ViewUtils.findViewById(card, R.id.rc_conversation_portrait, ImageView.class));
|
||||
ViewUtils.findViewById(card, R.id.userName, TextView.class).setText(data.getUser().getUserNicename());
|
||||
ViewUtils.findViewById(card, R.id.sign, TextView.class).setText(data.getUser().getSignature());
|
||||
if (data.getInfo().getRongOnline() == 1) {
|
||||
if (data.getInfo().getRongOnline() == 0) {
|
||||
ViewUtils.findViewById(card, R.id.user_status, TextView.class).setText(R.string.activity_msg_chat_top_status_online);
|
||||
ViewUtils.findViewById(card, R.id.userStatusIcon, ImageView.class).setImageResource(R.mipmap.icon_green);
|
||||
} else {
|
||||
ViewUtils.findViewById(card, R.id.user_status, TextView.class).setText(R.string.activity_msg_chat_top_status_offline);
|
||||
ViewUtils.findViewById(card, R.id.userStatusIcon, ImageView.class).setImageResource(R.mipmap.icon_gray);
|
||||
}
|
||||
if("C".equals(data.getUser().getType())){
|
||||
ViewUtils.findViewById(card,R.id.user_auth_status).setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
ViewUtils.findViewById(card,R.id.user_auth_status).setVisibility(View.GONE);
|
||||
}
|
||||
showBanner();
|
||||
showTag();
|
||||
if (data.getUser().getAttention() == 0) {
|
||||
|
@ -94,6 +94,16 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<pl.droidsonroids.gif.GifImageView
|
||||
android:id="@+id/liveStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginTop="-10dp"
|
||||
android:src="@mipmap/icon_liveing_cn"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rc_conversation_portrait" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
@ -132,6 +142,14 @@
|
||||
android:layout_gravity="top"
|
||||
android:layout_marginStart="5dp"
|
||||
android:src="@mipmap/icon_green" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/user_auth_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@mipmap/ic_chat_auth"
|
||||
tools:layout_editor_absoluteX="124dp"
|
||||
tools:layout_editor_absoluteY="17dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
@ -182,7 +200,6 @@
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="13sp"
|
||||
app:autoSizeMaxTextSize="13sp"
|
||||
|
||||
app:autoSizeMinTextSize="3sp"
|
||||
app:autoSizeStepGranularity="1sp"
|
||||
app:autoSizeTextType="uniform"
|
||||
@ -217,6 +234,8 @@
|
||||
app:layout_constraintStart_toStartOf="@+id/avatar_list"
|
||||
tools:itemCount="9"
|
||||
tools:listitem="@layout/view_msg_chat_top_tag" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
BIN
main/src/main/res/mipmap-b+en+us/ic_chat_auth.png
Normal file
BIN
main/src/main/res/mipmap-b+en+us/ic_chat_auth.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/ic_chat_auth.png
Normal file
BIN
main/src/main/res/mipmap-xxhdpi/ic_chat_auth.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Loading…
Reference in New Issue
Block a user