Merge branch 'master' into 6.5.3
This commit is contained in:
@@ -30,7 +30,6 @@ public class SystemMessageActivity extends AbsActivity {
|
||||
public static String type;//-1=单聊消息,1=系统消息,2=互动消息,3=猜你喜欢,-2=web页面打开
|
||||
public static String type2 = "0";//判断是否注册监听
|
||||
public static String nowUid, nowTitle, mowHeadImg;
|
||||
// public static int mowMsgId;
|
||||
|
||||
public static void forward(Context context, String type, String uid, String title, String headImg) {
|
||||
context.startActivity(new Intent(context, SystemMessageActivity.class)
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.ZhuangBanActivity;
|
||||
import com.yunbao.live.bean.SystemMessageBean;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/11/24.
|
||||
*/
|
||||
|
||||
public class SystemMessageNewAdapter extends RefreshAdapter<SystemMessageBean> {
|
||||
|
||||
public SystemMessageNewAdapter(Context context) {
|
||||
super(context);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new Vh(mInflater.inflate(R.layout.item_sys_msg_new, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh, int position) {
|
||||
((Vh) vh).setData(mList.get(position));
|
||||
}
|
||||
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
TextView messageContext, messageTime;
|
||||
LinearLayout layoutMore;
|
||||
|
||||
public Vh(View itemView) {
|
||||
super(itemView);
|
||||
messageContext = itemView.findViewById(R.id.message_context);
|
||||
layoutMore = itemView.findViewById(R.id.layout_more);
|
||||
messageTime = itemView.findViewById(R.id.message_time);
|
||||
}
|
||||
|
||||
void setData(SystemMessageBean bean) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("MM-dd HH:mm");
|
||||
Date currenTimeZone = new Date(Long.parseLong(bean.getAddtime() + "000"));
|
||||
messageTime.setText(sdf.format(currenTimeZone));
|
||||
messageContext.setText(bean.getContent());
|
||||
layoutMore.setVisibility(TextUtils.isEmpty(bean.getLink()) ? View.GONE : View.VISIBLE);
|
||||
layoutMore.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (bean.getLink() != null && !bean.getLink().equals("")) {
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
StringBuffer urlBuffer = new StringBuffer();
|
||||
urlBuffer.append(bean.getLink())
|
||||
.append("&uid=")
|
||||
.append(userInfo.getId())
|
||||
.append("&token=")
|
||||
.append(userInfo.getToken());
|
||||
mContext.startActivity(
|
||||
new Intent(mContext, ZhuangBanActivity.class)
|
||||
.putExtra("url", urlBuffer.toString()));
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.yunbao.live.views;
|
||||
|
||||
import static io.rong.imlib.RongIMClient.BlacklistStatus.NOT_IN_BLACK_LIST;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
@@ -59,6 +61,7 @@ import com.yunbao.live.activity.EditNameRemarksActivity;
|
||||
import com.yunbao.live.activity.SystemMessageActivity;
|
||||
import com.yunbao.live.adapter.InteractionMessageAdapter;
|
||||
import com.yunbao.live.adapter.SystemMessageAdapter;
|
||||
import com.yunbao.live.adapter.SystemMessageNewAdapter;
|
||||
import com.yunbao.live.adapter.YouLikeMessageAdapter;
|
||||
import com.yunbao.live.bean.SearchUserBean;
|
||||
import com.yunbao.live.bean.SystemMessageBean;
|
||||
@@ -89,8 +92,6 @@ import io.rong.message.RecallNotificationMessage;
|
||||
import io.rong.message.SightMessage;
|
||||
import io.rong.message.TextMessage;
|
||||
|
||||
import static io.rong.imlib.RongIMClient.BlacklistStatus.NOT_IN_BLACK_LIST;
|
||||
|
||||
/**
|
||||
* Created by Chen Haoxuan on 2022/4/10.修改
|
||||
*/
|
||||
@@ -339,67 +340,11 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
||||
}
|
||||
});
|
||||
|
||||
// RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, SystemMessageActivity.nowUid, dateTime, 20,
|
||||
// new RongIMClient.ResultCallback<List<Message>>() {
|
||||
// /**
|
||||
// * 成功时回调
|
||||
// * @param messages 获取的消息列表
|
||||
// */
|
||||
// @Override
|
||||
// public void onSuccess(List<Message> messages) {
|
||||
// if (messages.size() > 0) {
|
||||
// if (messages.size() < 10) {
|
||||
// moretext = false;
|
||||
// } else {
|
||||
// moretext = true;
|
||||
// }
|
||||
// dateTime = messages.get(messages.size() - 1).getSentTime();
|
||||
// oldestMessageId = messages.get(messages.size() - 1).getMessageId();
|
||||
// if (messagesList.size() == 0) {
|
||||
// Message messageNo = new Message();
|
||||
// messageNo.setSenderUserId("-1");
|
||||
// messagesList.add(messageNo);
|
||||
//
|
||||
// messagesList.addAll(messages);
|
||||
// } else {
|
||||
// if (moretext) {
|
||||
// messagesList.get(0).setSenderUserId("-1");
|
||||
// } else {
|
||||
// messagesList.get(0).setSenderUserId("-2");
|
||||
// }
|
||||
// messagesList.addAll(1, messages);
|
||||
// }
|
||||
// setData(messagesList.size());
|
||||
// } else {
|
||||
// moretext = false;
|
||||
// if (messagesList.size() == 0) {
|
||||
// Message messageNo = new Message();
|
||||
// messageNo.setSenderUserId("-1");
|
||||
// messagesList.add(messageNo);
|
||||
//
|
||||
// messagesList.addAll(messages);
|
||||
// } else {
|
||||
// messagesList.addAll(1, messages);
|
||||
// }
|
||||
// messagesList.get(0).setSenderUserId("-2");
|
||||
// setData(messagesList.size());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 错误时回调。
|
||||
// * @param e 错误码
|
||||
// */
|
||||
// @Override
|
||||
// public void onError(RongIMClient.ErrorCode e) {
|
||||
// ToastUtil.show("消息获取失败");
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
//非单聊列表适配
|
||||
private void setSysApt() {
|
||||
if (SystemMessageActivity.type.equals("1")) {
|
||||
if (SystemMessageActivity.type.equals("1") || SystemMessageActivity.type.equals("4")) {
|
||||
mRefreshView.setEmptyLayoutId(R.layout.view_no_data_sys);
|
||||
} else if (SystemMessageActivity.type.equals("2")) {
|
||||
mRefreshView.setEmptyLayoutId(R.layout.view_no_data_mess);
|
||||
@@ -407,14 +352,16 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
||||
mRefreshView.setEmptyLayoutId(R.layout.view_no_data_sys_msg);
|
||||
}
|
||||
mRefreshView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||
if (SystemMessageActivity.type.equals("1") || SystemMessageActivity.type.equals("2")) {
|
||||
if (SystemMessageActivity.type.equals("1") || SystemMessageActivity.type.equals("2") || SystemMessageActivity.type.equals("4")) {
|
||||
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<SystemMessageBean>() {
|
||||
@Override
|
||||
public RefreshAdapter<SystemMessageBean> getAdapter() {
|
||||
if (mAdapter == null && SystemMessageActivity.type.equals("1")) {
|
||||
if (mAdapter == null && (SystemMessageActivity.type.equals("1"))) {
|
||||
mAdapter = new SystemMessageAdapter(mContext);
|
||||
} else if (mAdapter == null && SystemMessageActivity.type.equals("2")) {
|
||||
mAdapter = new InteractionMessageAdapter(mContext, SystemMessageViewHolder.this);
|
||||
} else if (mAdapter == null && SystemMessageActivity.type.equals("4")) {
|
||||
mAdapter = new SystemMessageNewAdapter(mContext);
|
||||
}
|
||||
return mAdapter;
|
||||
}
|
||||
|
||||
95
live/src/main/res/layout/item_sys_msg_new.xml
Normal file
95
live/src/main/res/layout/item_sys_msg_new.xml
Normal file
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message_time"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="28dp"
|
||||
android:layout_marginBottom="18dp"
|
||||
android:gravity="center"
|
||||
android:text="6月18日 13:25"
|
||||
android:textColor="#7F7F7F"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<!--通知小喇叭-->
|
||||
<ImageView
|
||||
android:layout_width="37dp"
|
||||
android:layout_height="37dp"
|
||||
android:layout_marginStart="11dp"
|
||||
android:src="@mipmap/icon_notification_speaker" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="42dp"
|
||||
app:cardBackgroundColor="#fff"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message_context"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="11dp"
|
||||
android:text="親愛的用戶昵稱,恭喜你獲得23年7月1日-23年7月31日的xx禮物冠名權,冠名生效期間您可使用專屬禮物冠名皮膚。小PD已給您佩戴了專屬送禮特效,也可在個性裝扮中取消佩戴。"
|
||||
android:textColor="#040404"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_more"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1.2dp"
|
||||
android:layout_marginStart="11dp"
|
||||
android:layout_marginEnd="11dp"
|
||||
android:background="#F6F6F6" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="11dp"
|
||||
android:text="@string/live_user_mailbox_more_text"
|
||||
android:textColor="#838383"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginEnd="11dp"
|
||||
android:src="@mipmap/icon_arrow_right" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
BIN
live/src/main/res/mipmap-xxxhdpi/icon_notification_speaker.png
Normal file
BIN
live/src/main/res/mipmap-xxxhdpi/icon_notification_speaker.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.4 KiB |
Reference in New Issue
Block a user