推送管理

This commit is contained in:
hch 2024-01-03 18:28:49 +08:00
parent f697e650a8
commit dcf3f5c308
27 changed files with 693 additions and 142 deletions

View File

@ -209,6 +209,8 @@ dependencies {
// ()
api 'tech.sud.mgp:SudASR:1.3.3.1158'
//
api 'com.yanzhenjie.recyclerview:x:1.3.2'
//
//api project(':lib_huawei')

View File

@ -69,6 +69,7 @@ public class DialogUitl {
}
return dialog;
}
public static void showToast(Context context, String content, long delayMillis) {
Dialog dialog = new Dialog(context, R.style.dialog);
dialog.setContentView(R.layout.dialog_toast);
@ -121,6 +122,38 @@ public class DialogUitl {
dialog.show();
}
public static void showDelSysMsg(Context context, String content, SimpleCallback simpleCallback) {
if (context instanceof Activity) {
if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) {
return;
}
}
final Dialog dialog = new Dialog(context, R.style.dialog2);
dialog.setContentView(R.layout.dialog_del_sys_msg);
dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(true);
if (!TextUtils.isEmpty(content)) {
TextView contentTextView = (TextView) dialog.findViewById(R.id.content);
contentTextView.setText(content);
}
dialog.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.findViewById(R.id.btn_confirm).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
simpleCallback.onConfirmClick(dialog, "");
dialog.dismiss();
}
});
dialog.show();
}
public static void showSimpleDialog(Context context, String content, SimpleCallback callback) {
showSimpleDialog(context, content, false, callback);
}
@ -135,13 +168,7 @@ public class DialogUitl {
return;
}
}
new Builder(context)
.setTitle(title)
.setContent(content)
.setCancelable(cancelable)
.setClickCallback(callback)
.build()
.show();
new Builder(context).setTitle(title).setContent(content).setCancelable(cancelable).setClickCallback(callback).build().show();
}
public static void showSimpleDialog(Context context, String title, String content, boolean cancelable, SimpleCallback3 callback) {
@ -150,13 +177,7 @@ public class DialogUitl {
return;
}
}
new Builder(context)
.setTitle(title)
.setContent(content)
.setCancelable(cancelable)
.setClickCallback3(callback)
.build()
.show();
new Builder(context).setTitle(title).setContent(content).setCancelable(cancelable).setClickCallback3(callback).build().show();
}
public static void showSimpleInputDialog(Context context, String title, String hint, int inputType, int length, SimpleCallback callback) {
@ -165,15 +186,7 @@ public class DialogUitl {
return;
}
}
new Builder(context).setTitle(title)
.setCancelable(true)
.setInput(true)
.setHint(hint)
.setInputType(inputType)
.setLength(length)
.setClickCallback(callback)
.build()
.show();
new Builder(context).setTitle(title).setCancelable(true).setInput(true).setHint(hint).setInputType(inputType).setLength(length).setClickCallback(callback).build().show();
}
@ -563,8 +576,7 @@ public class DialogUitl {
/**
* 城市选择
*/
public static void showCityChooseDialog(Activity activity, ArrayList<Province> list,
String province, String city, String district, AddressPicker.OnAddressPickListener listener) {
public static void showCityChooseDialog(Activity activity, ArrayList<Province> list, String province, String city, String district, AddressPicker.OnAddressPickListener listener) {
AddressPicker picker = new AddressPicker(activity, list);
picker.setTextColor(0xff323232);
picker.setDividerColor(0xffdcdcdc);

View File

@ -31,6 +31,8 @@ public class RouteUtil {
public static final String PATH_MYWEBVIEWACTIVTITY = "/main/MyWebViewActivity";
public static final String PATH_ZHUANGBANACTIVITY = "/main/ZhuangBanActivity";
public static final String PATH_LiveZHUANGBANACTIVITY = "/live/ZhuangBanActivity";
public static final String PATH_COMPENSATE_ACTIVITY = "/live/CompensateActivity";
public static final String PATH_FACEBOOKACTIVITY = "/baidu/FacebookLoginActivity";
public static final String PATH_MAIN = "/main/MainActivity";
public static final String PATH_ENTRY = "/main/EntryActivity";
@ -147,6 +149,16 @@ public class RouteUtil {
.navigation();
}
/**
* 跳转到
*/
public static void forwardLiveCompensateActivity(String url, boolean isFull) {
ARouter.getInstance().build(PATH_COMPENSATE_ACTIVITY)
.withString("url", url)
.withBoolean("isFull", isFull)
.navigation();
}
/**
* 跳转到装扮
*/

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="280dp"
android:layout_height="wrap_content"
android:background="@drawable/bg_dialog"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:layout_marginBottom="50dp"
android:gravity="center_horizontal"
android:padding="20dp"
android:text="@string/dialog_tip"
android:textColor="@color/textColor"
android:textSize="15sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="30dp"
android:gravity="center_horizontal"
android:orientation="horizontal">
<TextView
android:id="@+id/btn_confirm"
android:layout_width="100dp"
android:layout_height="35dp"
android:background="@mipmap/icon_del_sys_confirm"
android:gravity="center"
android:paddingBottom="2dp"
android:text="@string/confirm"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="@+id/btn_cancel"
android:layout_width="100dp"
android:layout_height="35dp"
android:layout_marginLeft="30dp"
android:background="@mipmap/icon_del_sys_cancel"
android:gravity="center"
android:paddingBottom="2dp"
android:text="@string/cancel"
android:textColor="@color/yellow_ff6c00"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -1397,4 +1397,7 @@ Limited ride And limited avatar frame</string>
<string name="pay_cancel">Payment cancellation</string>
<string name="pay_suc">Payment successful</string>
<string name="pay_fail">Payment failed</string>
<string name="msg_del_sys01">The items inside have not been claimed yet.Are you sure to delete the message</string>
<string name="msg_del_sys02">Are you sure to delete the message</string>
</resources>

View File

@ -1391,6 +1391,10 @@
<string name="conversion_quantity_need_of_use2">二、1張觀影券可觀看一集短劇兌換成功後即可返回觀影頁面使用觀影券繼續觀看影片</string>
<string name="conversion_quantity_need_of_use3">三、觀影券禁止線下交易、收購等不正當行為PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string>
<string name="msg_del_sys01">內含物品還未領取,是否確定刪除消息?</string>
<string name="msg_del_sys02">是否確定刪除消息?</string>
<string name="pay_cancel">支付取消</string>
<string name="pay_suc">支付成功</string>
<string name="pay_fail">支付失敗</string>

View File

@ -1390,6 +1390,10 @@
<string name="conversion_quantity_need_of_use2">二、1張觀影券可觀看一集短劇兌換成功後即可返回觀影頁面使用觀影券繼續觀看影片</string>
<string name="conversion_quantity_need_of_use3">三、觀影券禁止線下交易、收購等不正當行為PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string>
<string name="msg_del_sys01">內含物品還未領取,是否確定刪除消息?</string>
<string name="msg_del_sys02">是否確定刪除消息?</string>
<string name="pay_cancel">支付取消</string>
<string name="pay_suc">支付成功</string>
<string name="pay_fail">支付失敗</string>

View File

@ -1393,4 +1393,7 @@
<string name="pay_suc">支付成功</string>
<string name="pay_fail">支付失敗</string>
<string name="msg_del_sys01">內含物品還未領取,是否確定刪除消息?</string>
<string name="msg_del_sys02">是否確定刪除消息?</string>
</resources>

View File

@ -1397,6 +1397,10 @@ Limited ride And limited avatar frame</string>
<string name="conversion_quantity_need_of_use2">2.One ticket can be used to watch one episode of a short drama. After successful redemption, you can return to the viewing page and use the ticket to continue watching the movie;</string>
<string name="conversion_quantity_need_of_use3">3.Ticket prohibit illegal activities such as offline trading and acquisitions, and PDLIVE will crack down severely on various profit-making trading activities.</string>
<string name="msg_del_sys01">The items inside have not been claimed yet.Are you sure to delete the message</string>
<string name="msg_del_sys02">Are you sure to delete the message</string>
<string name="pay_cancel">Payment cancellation</string>
<string name="pay_suc">Payment successful</string>
<string name="pay_fail">Payment failed</string>

View File

@ -117,6 +117,10 @@
<activity
android:name=".views.OlineListActivity"
android:screenOrientation="portrait" />
<activity
android:name=".activity.CompensateActivity"
android:screenOrientation="portrait" />
</application>
</manifest>

View File

@ -0,0 +1,120 @@
package com.yunbao.live.activity;
import android.graphics.Outline;
import android.view.View;
import android.view.ViewOutlineProvider;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.fastjson.JSON;
import com.google.gson.Gson;
import com.ms.banner.Banner;
import com.ms.banner.BannerConfig;
import com.ms.banner.listener.OnBannerClickListener;
import com.umeng.analytics.MobclickAgent;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.LiveGiftBean;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import com.yunbao.live.adapter.MsgSysGiftAdapter;
import com.yunbao.live.bean.MsgSysGiftInfoBean;
import com.yunbao.live.bean.SlideBean;
import com.yunbao.live.custom.TopGradual;
import com.yunbao.live.http.ImHttpUtil;
import com.yunbao.live.views.CustomMyViewHolder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Route(path = RouteUtil.PATH_COMPENSATE_ACTIVITY)
public class CompensateActivity extends AbsActivity {
Banner banner_me;
TextView content;
RecyclerView recyclerView;
MsgSysGiftAdapter msgSysGiftAdapter;
int msgId;
@Override
protected int getLayoutId() {
return R.layout.activity_compensate;
}
@Override
protected void main() {
recyclerView = findViewById(R.id.hor_recycler);
recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
recyclerView.addItemDecoration(new TopGradual());
msgSysGiftAdapter = new MsgSysGiftAdapter(mContext);
recyclerView.setAdapter(msgSysGiftAdapter);
msgId = getIntent().getIntExtra("msgid", -1);
banner_me = (Banner) findViewById(R.id.banner_me);
banner_me.setOutlineProvider(new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 10);
}
});
getMessageGiftInfo();
}
private void getMessageGiftInfo() {
ImHttpUtil.getMessageGiftInfo(msgId, new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
List<MsgSysGiftInfoBean> list = new ArrayList<>();
if (info != null) {
list = JSON.parseArray(info[0], MsgSysGiftInfoBean.class);
}
msgSysGiftAdapter.setList(list);
List<SlideBean> mBannerList = new ArrayList<>();
SlideBean slideBean = new SlideBean();
slideBean.setSlide_pic("https://downs.yaoulive.com/20231111/55ddbc06ffdd02e480f3513fdb31caf6.png");
mBannerList.add(slideBean);
mBannerList.add(slideBean);
showBanner(mBannerList);
}
});
}
private void showBanner(List<SlideBean> mBannerList) {
banner_me.setAutoPlay(true).setPages(mBannerList, new CustomMyViewHolder()).setDelayTime(3000).setBannerStyle(BannerConfig.NOT_INDICATOR).setOnBannerClickListener(new OnBannerClickListener() {
@Override
public void onBannerClick(List datas, int p) {
if (mBannerList != null) {
if (p >= 0 && p < mBannerList.size()) {
SlideBean bean = mBannerList.get(p);
if (!bean.getSlide_url().equals("")) {
Constants.isTitle = true;
String url = bean.getSlide_url() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
RouteUtil.forwardCustomerService(url);
Map<String, String> map_ekv = new HashMap<String, String>();
map_ekv.put("link", url);
MobclickAgent.onEvent(mContext, "my_banner", map_ekv);
}
}
}
}
}).start();
}
}

View File

@ -0,0 +1,101 @@
package com.yunbao.live.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.live.R;
import com.yunbao.live.bean.MsgSysGiftInfoBean;
import java.util.ArrayList;
import java.util.List;
public class MsgSysGiftAdapter extends RecyclerView.Adapter {
private Context mContext;
private RecyclerView mRecyclerView;
private List<MsgSysGiftInfoBean> mList;
private LayoutInflater mInflater;
public MsgSysGiftAdapter(Context context) {
mContext = context;
mList = new ArrayList<>();
mList.add(new MsgSysGiftInfoBean());
mInflater = LayoutInflater.from(context);
}
public void setList(List<MsgSysGiftInfoBean> list) {
if (list != null && list.size() > 0) {
mList.clear();
mList.addAll(list);
notifyDataSetChanged();
}
}
@Override
public int getItemViewType(int position) {
return position;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new Vh(mInflater.inflate(R.layout.item_msg_sys_gift, parent, false));
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh, int position, @NonNull List payloads) {
Object payload = payloads.size() > 0 ? payloads.get(0) : null;
((Vh) vh).setData(mList.get(position), position, payload);
}
@Override
public int getItemCount() {
return mList.size();
}
class Vh extends RecyclerView.ViewHolder {
ImageView mAvatar;
TextView mName, name_remarks;
public Vh(View itemView) {
super(itemView);
mAvatar = (ImageView) itemView.findViewById(R.id.avatar);
mName = (TextView) itemView.findViewById(R.id.name);
name_remarks = (TextView) itemView.findViewById(R.id.name_remarks);
}
void setData(MsgSysGiftInfoBean bean, int position, Object payload) {
itemView.setTag(position);
ImgLoader.display(mContext, bean.getItem_image(), mAvatar);
mName.setText(bean.getItem_name());
name_remarks.setText(bean.getRestrict_time());
}
}
@Override
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
super.onAttachedToRecyclerView(recyclerView);
mRecyclerView = recyclerView;
}
public interface ActionListener {
void onItemClick(MsgSysGiftInfoBean bean);
}
}

View File

@ -14,6 +14,7 @@ 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.common.utils.RouteUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.ZhuangBanActivity;
@ -28,12 +29,13 @@ import java.util.Date;
public class SystemMessageNewAdapter extends RefreshAdapter<SystemMessageBean> {
public SystemMessageNewAdapter(Context context) {
ItemLongListener itemLongListener;
public SystemMessageNewAdapter(Context context, ItemLongListener itemLongListener) {
super(context);
this.itemLongListener = itemLongListener;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
@ -47,12 +49,13 @@ public class SystemMessageNewAdapter extends RefreshAdapter<SystemMessageBean> {
class Vh extends RecyclerView.ViewHolder {
TextView messageContext, messageTime;
LinearLayout layoutMore;
LinearLayout layoutMore, itemLayout;
public Vh(View itemView) {
super(itemView);
messageContext = itemView.findViewById(R.id.message_context);
layoutMore = itemView.findViewById(R.id.layout_more);
itemLayout = itemView.findViewById(R.id.itemLayout);
messageTime = itemView.findViewById(R.id.message_time);
}
@ -61,27 +64,38 @@ public class SystemMessageNewAdapter extends RefreshAdapter<SystemMessageBean> {
Date currenTimeZone = new Date(Long.parseLong(bean.getAddtime() + "000"));
messageTime.setText(sdf.format(currenTimeZone));
messageContext.setText(bean.getContent());
if (bean.getSystem_message_type() == 1) {
layoutMore.setVisibility(View.VISIBLE);
} else {
layoutMore.setVisibility(TextUtils.isEmpty(bean.getLink()) ? View.GONE : View.VISIBLE);
}
itemLayout.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
itemLongListener.onItemLong(bean);
return false;
}
});
layoutMore.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (bean.getSystem_message_type() == 2) {//普通消息
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()) .append("&isZh=")
.append(WordUtil.isNewZh() ? "1" : 0);
mContext.startActivity(
new Intent(mContext, ZhuangBanActivity.class)
.putExtra("url", urlBuffer.toString()));
urlBuffer.append(bean.getLink()).append("&uid=").append(userInfo.getId()).append("&token=").append(userInfo.getToken()).append("&isZh=").append(WordUtil.isNewZh() ? "1" : 0);
mContext.startActivity(new Intent(mContext, ZhuangBanActivity.class).putExtra("url", urlBuffer.toString()));
}
} else if (bean.getSystem_message_type() == 1) {//礼包消息
RouteUtil.forwardLiveCompensateActivity("", false);
}
}
});
}
}
public interface ItemLongListener {
void onItemLong(SystemMessageBean bean);
}
}

View File

@ -0,0 +1,40 @@
package com.yunbao.live.bean;
public class MsgSysGiftInfoBean {
int id;
String item_name;
String restrict_time;
String item_image;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getItem_name() {
return item_name;
}
public void setItem_name(String item_name) {
this.item_name = item_name;
}
public String getRestrict_time() {
return restrict_time;
}
public void setRestrict_time(String restrict_time) {
this.restrict_time = restrict_time;
}
public String getItem_image() {
return item_image;
}
public void setItem_image(String item_image) {
this.item_image = item_image;
}
}

View File

@ -19,6 +19,27 @@ public class SystemMessageBean {
private String showImg;
private String imgBanner;
private int system_message_type; //1 普通消息 2 礼包消息
private int get_status; // 1 已领取 2 未领取
public int getSystem_message_type() {
return system_message_type;
}
public void setSystem_message_type(int system_message_type) {
this.system_message_type = system_message_type;
}
public int getGet_status() {
return get_status;
}
public void setGet_status(int get_status) {
this.get_status = get_status;
}
@JSONField(name = "banner")
public String getImgBanner() {
return imgBanner;

View File

@ -11,4 +11,6 @@ public class ImHttpConsts {
public static final String CHECK_BLACK = "checkBlack";
public static final String SEND_DYNAMICCOMMENT = "sendDynamicComment";
public static final String SET_BLACK = "setBlack";
public static final String GET_MESSAGEGIFTINFO = "getMessageGiftInfo";
}

View File

@ -73,4 +73,14 @@ public class ImHttpUtil {
.params("touid", touid)
.execute(callback);
}
/**
* 获取补偿消息详情
*/
public static void getMessageGiftInfo(int msgid, HttpCallback callback) {
HttpClient.getInstance().get("Message.getMessageGiftInfo", ImHttpConsts.GET_MESSAGEGIFTINFO)
.params("message_id", msgid)
.execute(callback);
}
}

View File

@ -7,7 +7,6 @@ import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.ms.banner.holder.BannerViewHolder;
import com.yunbao.common.bean.BannerBean;
import com.yunbao.live.bean.SlideBean;
public class CustomMyViewHolder implements BannerViewHolder<SlideBean> {

View File

@ -5,6 +5,7 @@ import static io.rong.imlib.RongIMClient.BlacklistStatus.NOT_IN_BLACK_LIST;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
@ -54,6 +55,8 @@ import com.yunbao.common.bean.ImageEntity;
import com.yunbao.common.custom.CommonRefreshView;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.interfaces.OnItemLongClickListener;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.AbsViewHolder;
@ -190,8 +193,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
}
InputMethodManager methodManager = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
if (methodManager != null) {
methodManager.hideSoftInputFromWindow(feedback_edittext.getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
methodManager.hideSoftInputFromWindow(feedback_edittext.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
feedback_edittext.clearFocus();
}
@ -259,8 +261,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
if (lt_controls.getVisibility() == View.GONE) {
InputMethodManager methodManager = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
if (methodManager != null) {
methodManager.hideSoftInputFromWindow(feedback_edittext.getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
methodManager.hideSoftInputFromWindow(feedback_edittext.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
Thread thread = new Thread(new Runnable() {
@ -285,8 +286,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
oldestMessageId = -1;
}
Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE;
RongIMClient.getInstance().getHistoryMessages(conversationType, SystemMessageActivity.nowUid, oldestMessageId, 20,
new RongIMClient.ResultCallback<List<Message>>() {
RongIMClient.getInstance().getHistoryMessages(conversationType, SystemMessageActivity.nowUid, oldestMessageId, 20, new RongIMClient.ResultCallback<List<Message>>() {
/**
* 成功时回调
* @param messages 获取的消息列表
@ -357,12 +357,22 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
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);
} else if (mAdapter == null && SystemMessageActivity.type.equals("4")) {//系统消息
mAdapter = new SystemMessageNewAdapter(mContext, new SystemMessageNewAdapter.ItemLongListener() {
@Override
public void onItemLong(SystemMessageBean bean) {
DialogUitl.showDelSysMsg(mContext, mContext.getString(com.yunbao.common.R.string.msg_del_sys01), new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
}
});
}
});
}
return mAdapter;
}
@ -582,8 +592,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
try {
MediaMetadataRetriever mmr = new MediaMetadataRetriever();
mmr.setDataSource(url);
duration = Integer.parseInt(mmr.extractMetadata
(MediaMetadataRetriever.METADATA_KEY_DURATION)) / 1000;//除以 1000 返回是秒
duration = Integer.parseInt(mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION)) / 1000;//除以 1000 返回是秒
//时长(毫秒)
// String duration = mmr.extractMetadata(android.media.MediaMetadataRetriever.METADATA_KEY_DURATION);
// //
@ -695,8 +704,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
startActivity(intoIndex);
} else {
//申请权限
ActivityCompat.requestPermissions(nowActivity, new String[]{permission1,
permission2}, PERMISSION_REQUEST_CODE);
ActivityCompat.requestPermissions(nowActivity, new String[]{permission1, permission2}, PERMISSION_REQUEST_CODE);
}
}
@ -1050,8 +1058,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
*/
@Override
public ImMessageAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
View view = mInflater.inflate(R.layout.item_chat_one,
viewGroup, false);
View view = mInflater.inflate(R.layout.item_chat_one, viewGroup, false);
ImMessageAdapter.ViewHolder viewHolder = new ImMessageAdapter.ViewHolder(view);
return viewHolder;
@ -1207,9 +1214,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
viewHolder.cv_chatcontent_img1.setVisibility(View.VISIBLE);
viewHolder.rt_video_left.setVisibility(View.GONE);
Glide.with(mContext)
.load(imageMessage.getThumUri())
.into(viewHolder.chatcontent_img1);
Glide.with(mContext).load(imageMessage.getThumUri()).into(viewHolder.chatcontent_img1);
viewHolder.chatcontent_img1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -1225,9 +1230,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
viewHolder.cv_chatcontent_img.setVisibility(View.VISIBLE);
viewHolder.rt_video_right.setVisibility(View.GONE);
if (mDatas.get(position).getReceivedTime() == 0) {
Glide.with(mContext)
.load(imageMessage.getThumUri())
.into(viewHolder.chatcontent_img);
Glide.with(mContext).load(imageMessage.getThumUri()).into(viewHolder.chatcontent_img);
viewHolder.view_feed_suc.setVisibility(View.VISIBLE);
viewHolder.view_feed_suc.setOnClickListener(new View.OnClickListener() {
@Override
@ -1238,14 +1241,10 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
});
} else if (mDatas.get(position).getReceivedTime() < 100) {
viewHolder.view_feed_suc.setVisibility(View.GONE);
Glide.with(mContext)
.load(imageMessage.getThumUri())
.into(viewHolder.chatcontent_img);
Glide.with(mContext).load(imageMessage.getThumUri()).into(viewHolder.chatcontent_img);
} else {
viewHolder.view_feed_suc.setVisibility(View.GONE);
Glide.with(mContext)
.load(imageMessage.getThumUri())
.into(viewHolder.chatcontent_img);
Glide.with(mContext).load(imageMessage.getThumUri()).into(viewHolder.chatcontent_img);
viewHolder.chatcontent_img.setOnClickListener(new View.OnClickListener() {
@Override
@ -1412,16 +1411,9 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
*/
public static void loadCover(ImageView imageView, Uri uri, Context context) {
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
Glide.with(context)
.setDefaultRequestOptions(
new RequestOptions()
.frame(1000000)
.centerCrop()
.error(R.drawable.anim_loading)//可以忽略
Glide.with(context).setDefaultRequestOptions(new RequestOptions().frame(1000000).centerCrop().error(R.drawable.anim_loading)//可以忽略
.placeholder(R.drawable.anim_loading)//可以忽略
)
.load(uri)
.into(imageView);
).load(uri).into(imageView);
}
//互动消息回复

View File

@ -0,0 +1,111 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
<FrameLayout
android:id="@+id/ft_title"
android:layout_width="match_parent"
android:layout_height="65dp"
android:background="@color/white"
android:paddingTop="19dp"
android:visibility="visible">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/titleView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center"
android:textColor="@color/textColor"
android:textSize="18sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/btn_back"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:onClick="backClick"
android:padding="9dp"
android:src="@mipmap/icon_back"
app:tint="@color/textColor" />
</RelativeLayout>
</FrameLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/lt_advertisement"
android:layout_width="match_parent"
android:layout_height="102dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="12dp"
android:layout_marginRight="15dp">
<androidx.cardview.widget.CardView
android:id="@+id/cv_chatcontent_img1"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardBackgroundColor="@color/transparent"
app:cardCornerRadius="10dp"
app:cardElevation="0dp">
<com.ms.banner.Banner
android:id="@+id/banner_me"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:delay_time="5000"
app:indicator_height="8dp"
app:indicator_width="8dp" />
</androidx.cardview.widget.CardView>
</LinearLayout>
<TextView
android:id="@+id/msg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/hor_recycler"
android:layout_width="wrap_content"
android:layout_height="120dp"
android:scrollbars="none" />
<Button
android:id="@+id/submit"
android:layout_width="170dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
android:layout_marginBottom="30dp"
android:background="@mipmap/icon_sys_receive"
android:paddingBottom="3dp"
android:text="領取"
android:textColor="@color/yellow_ff6c00"
android:textSize="18dp"
android:textStyle="bold" />
</LinearLayout>
</ScrollView>
</LinearLayout>

View File

@ -0,0 +1,37 @@
<?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="130dp"
android:gravity="center"
android:orientation="vertical">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
android:layout_width="75dp"
android:layout_height="75dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:ellipsize="end"
android:singleLine="true"
android:text="道具名称"
android:textColor="@color/textColor"
android:textSize="14sp" />
<TextView
android:id="@+id/name_remarks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:text="使用期限"
android:textColor="@color/gray1"
android:textSize="14sp" />
</LinearLayout>

View File

@ -17,6 +17,7 @@
android:textSize="11sp" />
<LinearLayout
android:id="@+id/itemLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB