update 修正聊天页在线离线状态
update 聊天页长按删除功能
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user