推送管理
This commit is contained in:
parent
f697e650a8
commit
dcf3f5c308
@ -209,6 +209,8 @@ dependencies {
|
|||||||
|
|
||||||
// 多语言语音识别扩展库(可选)
|
// 多语言语音识别扩展库(可选)
|
||||||
api 'tech.sud.mgp:SudASR:1.3.3.1158'
|
api 'tech.sud.mgp:SudASR:1.3.3.1158'
|
||||||
|
//侧滑删除
|
||||||
|
api 'com.yanzhenjie.recyclerview:x:1.3.2'
|
||||||
|
|
||||||
//华为支付插件包
|
//华为支付插件包
|
||||||
//api project(':lib_huawei')
|
//api project(':lib_huawei')
|
||||||
|
@ -69,7 +69,8 @@ public class DialogUitl {
|
|||||||
}
|
}
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
public static void showToast(Context context,String content,long delayMillis){
|
|
||||||
|
public static void showToast(Context context, String content, long delayMillis) {
|
||||||
Dialog dialog = new Dialog(context, R.style.dialog);
|
Dialog dialog = new Dialog(context, R.style.dialog);
|
||||||
dialog.setContentView(R.layout.dialog_toast);
|
dialog.setContentView(R.layout.dialog_toast);
|
||||||
dialog.setCancelable(false);
|
dialog.setCancelable(false);
|
||||||
@ -82,7 +83,7 @@ public class DialogUitl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dialog.show();
|
dialog.show();
|
||||||
new Handler(Looper.getMainLooper()).postDelayed(dialog::dismiss,delayMillis);
|
new Handler(Looper.getMainLooper()).postDelayed(dialog::dismiss, delayMillis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -121,6 +122,38 @@ public class DialogUitl {
|
|||||||
dialog.show();
|
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) {
|
public static void showSimpleDialog(Context context, String content, SimpleCallback callback) {
|
||||||
showSimpleDialog(context, content, false, callback);
|
showSimpleDialog(context, content, false, callback);
|
||||||
}
|
}
|
||||||
@ -135,13 +168,7 @@ public class DialogUitl {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
new Builder(context)
|
new Builder(context).setTitle(title).setContent(content).setCancelable(cancelable).setClickCallback(callback).build().show();
|
||||||
.setTitle(title)
|
|
||||||
.setContent(content)
|
|
||||||
.setCancelable(cancelable)
|
|
||||||
.setClickCallback(callback)
|
|
||||||
.build()
|
|
||||||
.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showSimpleDialog(Context context, String title, String content, boolean cancelable, SimpleCallback3 callback) {
|
public static void showSimpleDialog(Context context, String title, String content, boolean cancelable, SimpleCallback3 callback) {
|
||||||
@ -150,13 +177,7 @@ public class DialogUitl {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
new Builder(context)
|
new Builder(context).setTitle(title).setContent(content).setCancelable(cancelable).setClickCallback3(callback).build().show();
|
||||||
.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) {
|
public static void showSimpleInputDialog(Context context, String title, String hint, int inputType, int length, SimpleCallback callback) {
|
||||||
@ -165,15 +186,7 @@ public class DialogUitl {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
new Builder(context).setTitle(title)
|
new Builder(context).setTitle(title).setCancelable(true).setInput(true).setHint(hint).setInputType(inputType).setLength(length).setClickCallback(callback).build().show();
|
||||||
.setCancelable(true)
|
|
||||||
.setInput(true)
|
|
||||||
.setHint(hint)
|
|
||||||
.setInputType(inputType)
|
|
||||||
.setLength(length)
|
|
||||||
.setClickCallback(callback)
|
|
||||||
.build()
|
|
||||||
.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -483,8 +496,8 @@ public class DialogUitl {
|
|||||||
mClickCallback3.onConfirmClick(dialog);
|
mClickCallback3.onConfirmClick(dialog);
|
||||||
}
|
}
|
||||||
if (mSimpleCallbackView != null) {
|
if (mSimpleCallbackView != null) {
|
||||||
mSimpleCallbackView.onConfirmClick(dialog,titleView, content, btnConfirm, btnCancel);
|
mSimpleCallbackView.onConfirmClick(dialog, titleView, content, btnConfirm, btnCancel);
|
||||||
}else{
|
} else {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -501,8 +514,8 @@ public class DialogUitl {
|
|||||||
((SimpleCallback2) mClickCallback).onCancelClick();
|
((SimpleCallback2) mClickCallback).onCancelClick();
|
||||||
}
|
}
|
||||||
if (mSimpleCallbackView != null) {
|
if (mSimpleCallbackView != null) {
|
||||||
mSimpleCallbackView.onCancel(dialog,titleView, content, btnConfirm, btnCancel);
|
mSimpleCallbackView.onCancel(dialog, titleView, content, btnConfirm, btnCancel);
|
||||||
}else{
|
} else {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -510,17 +523,17 @@ public class DialogUitl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if(btnConfirm!=null) {
|
if (btnConfirm != null) {
|
||||||
btnConfirm.setOnClickListener(listener);
|
btnConfirm.setOnClickListener(listener);
|
||||||
}
|
}
|
||||||
if(btnCancel!=null) {
|
if (btnCancel != null) {
|
||||||
btnCancel.setOnClickListener(listener);
|
btnCancel.setOnClickListener(listener);
|
||||||
}
|
}
|
||||||
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onShow(DialogInterface dialogInterface) {
|
public void onShow(DialogInterface dialogInterface) {
|
||||||
if (mSimpleCallbackView != null) {
|
if (mSimpleCallbackView != null) {
|
||||||
mSimpleCallbackView.onShow(dialog,titleView, content, btnConfirm, btnCancel);
|
mSimpleCallbackView.onShow(dialog, titleView, content, btnConfirm, btnCancel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -563,8 +576,7 @@ public class DialogUitl {
|
|||||||
/**
|
/**
|
||||||
* 城市选择
|
* 城市选择
|
||||||
*/
|
*/
|
||||||
public static void showCityChooseDialog(Activity activity, ArrayList<Province> list,
|
public static void showCityChooseDialog(Activity activity, ArrayList<Province> list, String province, String city, String district, AddressPicker.OnAddressPickListener listener) {
|
||||||
String province, String city, String district, AddressPicker.OnAddressPickListener listener) {
|
|
||||||
AddressPicker picker = new AddressPicker(activity, list);
|
AddressPicker picker = new AddressPicker(activity, list);
|
||||||
picker.setTextColor(0xff323232);
|
picker.setTextColor(0xff323232);
|
||||||
picker.setDividerColor(0xffdcdcdc);
|
picker.setDividerColor(0xffdcdcdc);
|
||||||
|
@ -31,6 +31,8 @@ public class RouteUtil {
|
|||||||
public static final String PATH_MYWEBVIEWACTIVTITY = "/main/MyWebViewActivity";
|
public static final String PATH_MYWEBVIEWACTIVTITY = "/main/MyWebViewActivity";
|
||||||
public static final String PATH_ZHUANGBANACTIVITY = "/main/ZhuangBanActivity";
|
public static final String PATH_ZHUANGBANACTIVITY = "/main/ZhuangBanActivity";
|
||||||
public static final String PATH_LiveZHUANGBANACTIVITY = "/live/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_FACEBOOKACTIVITY = "/baidu/FacebookLoginActivity";
|
||||||
public static final String PATH_MAIN = "/main/MainActivity";
|
public static final String PATH_MAIN = "/main/MainActivity";
|
||||||
public static final String PATH_ENTRY = "/main/EntryActivity";
|
public static final String PATH_ENTRY = "/main/EntryActivity";
|
||||||
@ -147,6 +149,16 @@ public class RouteUtil {
|
|||||||
.navigation();
|
.navigation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跳转到
|
||||||
|
*/
|
||||||
|
public static void forwardLiveCompensateActivity(String url, boolean isFull) {
|
||||||
|
ARouter.getInstance().build(PATH_COMPENSATE_ACTIVITY)
|
||||||
|
.withString("url", url)
|
||||||
|
.withBoolean("isFull", isFull)
|
||||||
|
.navigation();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 跳转到装扮
|
* 跳转到装扮
|
||||||
*/
|
*/
|
||||||
|
55
common/src/main/res/layout/dialog_del_sys_msg.xml
Normal file
55
common/src/main/res/layout/dialog_del_sys_msg.xml
Normal 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>
|
BIN
common/src/main/res/mipmap-mdpi/icon_del_sys_cancel.png
Normal file
BIN
common/src/main/res/mipmap-mdpi/icon_del_sys_cancel.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
BIN
common/src/main/res/mipmap-mdpi/icon_del_sys_confirm.png
Normal file
BIN
common/src/main/res/mipmap-mdpi/icon_del_sys_confirm.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
@ -1397,4 +1397,7 @@ Limited ride And limited avatar frame</string>
|
|||||||
<string name="pay_cancel">Payment cancellation</string>
|
<string name="pay_cancel">Payment cancellation</string>
|
||||||
<string name="pay_suc">Payment successful</string>
|
<string name="pay_suc">Payment successful</string>
|
||||||
<string name="pay_fail">Payment failed</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>
|
</resources>
|
||||||
|
@ -1391,6 +1391,10 @@
|
|||||||
<string name="conversion_quantity_need_of_use2">二、1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
|
<string name="conversion_quantity_need_of_use2">二、1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
|
||||||
<string name="conversion_quantity_need_of_use3">三、觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</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_cancel">支付取消</string>
|
||||||
<string name="pay_suc">支付成功</string>
|
<string name="pay_suc">支付成功</string>
|
||||||
<string name="pay_fail">支付失敗</string>
|
<string name="pay_fail">支付失敗</string>
|
||||||
|
@ -1390,6 +1390,10 @@
|
|||||||
<string name="conversion_quantity_need_of_use2">二、1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
|
<string name="conversion_quantity_need_of_use2">二、1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
|
||||||
<string name="conversion_quantity_need_of_use3">三、觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</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_cancel">支付取消</string>
|
||||||
<string name="pay_suc">支付成功</string>
|
<string name="pay_suc">支付成功</string>
|
||||||
<string name="pay_fail">支付失敗</string>
|
<string name="pay_fail">支付失敗</string>
|
||||||
|
@ -1393,4 +1393,7 @@
|
|||||||
<string name="pay_suc">支付成功</string>
|
<string name="pay_suc">支付成功</string>
|
||||||
<string name="pay_fail">支付失敗</string>
|
<string name="pay_fail">支付失敗</string>
|
||||||
|
|
||||||
|
<string name="msg_del_sys01">內含物品還未領取,是否確定刪除消息?</string>
|
||||||
|
<string name="msg_del_sys02">是否確定刪除消息?</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -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_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="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_cancel">Payment cancellation</string>
|
||||||
<string name="pay_suc">Payment successful</string>
|
<string name="pay_suc">Payment successful</string>
|
||||||
<string name="pay_fail">Payment failed</string>
|
<string name="pay_fail">Payment failed</string>
|
||||||
|
@ -20,7 +20,7 @@ ext {
|
|||||||
|
|
||||||
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
|
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
|
||||||
|
|
||||||
// true表示谷歌支付 false 0 链接包 1 谷歌包 2华为包 3 samsung包
|
// true表示谷歌支付 false 0 链接包 1 谷歌包 2华为包 3 samsung包
|
||||||
isGooglePlay : 3,
|
isGooglePlay : 3,
|
||||||
//是否上报异常日志
|
//是否上报异常日志
|
||||||
isUploadLog : true,
|
isUploadLog : true,
|
||||||
|
@ -117,6 +117,10 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".views.OlineListActivity"
|
android:name=".views.OlineListActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".activity.CompensateActivity"
|
||||||
|
android:screenOrientation="portrait" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -14,6 +14,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
import com.yunbao.common.adapter.RefreshAdapter;
|
import com.yunbao.common.adapter.RefreshAdapter;
|
||||||
import com.yunbao.common.bean.IMLoginModel;
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
import com.yunbao.live.R;
|
import com.yunbao.live.R;
|
||||||
import com.yunbao.live.activity.ZhuangBanActivity;
|
import com.yunbao.live.activity.ZhuangBanActivity;
|
||||||
@ -28,12 +29,13 @@ import java.util.Date;
|
|||||||
|
|
||||||
public class SystemMessageNewAdapter extends RefreshAdapter<SystemMessageBean> {
|
public class SystemMessageNewAdapter extends RefreshAdapter<SystemMessageBean> {
|
||||||
|
|
||||||
public SystemMessageNewAdapter(Context context) {
|
ItemLongListener itemLongListener;
|
||||||
|
|
||||||
|
public SystemMessageNewAdapter(Context context, ItemLongListener itemLongListener) {
|
||||||
super(context);
|
super(context);
|
||||||
|
this.itemLongListener = itemLongListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
@ -47,12 +49,13 @@ public class SystemMessageNewAdapter extends RefreshAdapter<SystemMessageBean> {
|
|||||||
|
|
||||||
class Vh extends RecyclerView.ViewHolder {
|
class Vh extends RecyclerView.ViewHolder {
|
||||||
TextView messageContext, messageTime;
|
TextView messageContext, messageTime;
|
||||||
LinearLayout layoutMore;
|
LinearLayout layoutMore, itemLayout;
|
||||||
|
|
||||||
public Vh(View itemView) {
|
public Vh(View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
messageContext = itemView.findViewById(R.id.message_context);
|
messageContext = itemView.findViewById(R.id.message_context);
|
||||||
layoutMore = itemView.findViewById(R.id.layout_more);
|
layoutMore = itemView.findViewById(R.id.layout_more);
|
||||||
|
itemLayout = itemView.findViewById(R.id.itemLayout);
|
||||||
messageTime = itemView.findViewById(R.id.message_time);
|
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"));
|
Date currenTimeZone = new Date(Long.parseLong(bean.getAddtime() + "000"));
|
||||||
messageTime.setText(sdf.format(currenTimeZone));
|
messageTime.setText(sdf.format(currenTimeZone));
|
||||||
messageContext.setText(bean.getContent());
|
messageContext.setText(bean.getContent());
|
||||||
layoutMore.setVisibility(TextUtils.isEmpty(bean.getLink()) ? View.GONE : View.VISIBLE);
|
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() {
|
layoutMore.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (bean.getLink() != null && !bean.getLink().equals("")) {
|
if (bean.getSystem_message_type() == 2) {//普通消息
|
||||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
if (bean.getLink() != null && !bean.getLink().equals("")) {
|
||||||
StringBuffer urlBuffer = new StringBuffer();
|
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||||
urlBuffer.append(bean.getLink())
|
StringBuffer urlBuffer = new StringBuffer();
|
||||||
.append("&uid=")
|
urlBuffer.append(bean.getLink()).append("&uid=").append(userInfo.getId()).append("&token=").append(userInfo.getToken()).append("&isZh=").append(WordUtil.isNewZh() ? "1" : 0);
|
||||||
.append(userInfo.getId())
|
mContext.startActivity(new Intent(mContext, ZhuangBanActivity.class).putExtra("url", urlBuffer.toString()));
|
||||||
.append("&token=")
|
}
|
||||||
.append(userInfo.getToken()) .append("&isZh=")
|
} else if (bean.getSystem_message_type() == 1) {//礼包消息
|
||||||
.append(WordUtil.isNewZh() ? "1" : 0);
|
RouteUtil.forwardLiveCompensateActivity("", false);
|
||||||
mContext.startActivity(
|
|
||||||
new Intent(mContext, ZhuangBanActivity.class)
|
|
||||||
.putExtra("url", urlBuffer.toString()));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface ItemLongListener {
|
||||||
|
void onItemLong(SystemMessageBean bean);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
@ -19,6 +19,27 @@ public class SystemMessageBean {
|
|||||||
private String showImg;
|
private String showImg;
|
||||||
private String imgBanner;
|
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")
|
@JSONField(name = "banner")
|
||||||
public String getImgBanner() {
|
public String getImgBanner() {
|
||||||
return imgBanner;
|
return imgBanner;
|
||||||
|
@ -11,4 +11,6 @@ public class ImHttpConsts {
|
|||||||
public static final String CHECK_BLACK = "checkBlack";
|
public static final String CHECK_BLACK = "checkBlack";
|
||||||
public static final String SEND_DYNAMICCOMMENT = "sendDynamicComment";
|
public static final String SEND_DYNAMICCOMMENT = "sendDynamicComment";
|
||||||
public static final String SET_BLACK = "setBlack";
|
public static final String SET_BLACK = "setBlack";
|
||||||
|
|
||||||
|
public static final String GET_MESSAGEGIFTINFO = "getMessageGiftInfo";
|
||||||
}
|
}
|
||||||
|
@ -73,4 +73,14 @@ public class ImHttpUtil {
|
|||||||
.params("touid", touid)
|
.params("touid", touid)
|
||||||
.execute(callback);
|
.execute(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取补偿消息详情
|
||||||
|
*/
|
||||||
|
public static void getMessageGiftInfo(int msgid, HttpCallback callback) {
|
||||||
|
HttpClient.getInstance().get("Message.getMessageGiftInfo", ImHttpConsts.GET_MESSAGEGIFTINFO)
|
||||||
|
.params("message_id", msgid)
|
||||||
|
.execute(callback);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import android.widget.ImageView;
|
|||||||
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.ms.banner.holder.BannerViewHolder;
|
import com.ms.banner.holder.BannerViewHolder;
|
||||||
import com.yunbao.common.bean.BannerBean;
|
|
||||||
import com.yunbao.live.bean.SlideBean;
|
import com.yunbao.live.bean.SlideBean;
|
||||||
|
|
||||||
public class CustomMyViewHolder implements BannerViewHolder<SlideBean> {
|
public class CustomMyViewHolder implements BannerViewHolder<SlideBean> {
|
||||||
|
@ -5,6 +5,7 @@ import static io.rong.imlib.RongIMClient.BlacklistStatus.NOT_IN_BLACK_LIST;
|
|||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
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.custom.CommonRefreshView;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
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.RouteUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.views.AbsViewHolder;
|
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);
|
InputMethodManager methodManager = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
if (methodManager != null) {
|
if (methodManager != null) {
|
||||||
methodManager.hideSoftInputFromWindow(feedback_edittext.getWindowToken(),
|
methodManager.hideSoftInputFromWindow(feedback_edittext.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
|
||||||
InputMethodManager.HIDE_NOT_ALWAYS);
|
|
||||||
}
|
}
|
||||||
feedback_edittext.clearFocus();
|
feedback_edittext.clearFocus();
|
||||||
}
|
}
|
||||||
@ -259,8 +261,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
if (lt_controls.getVisibility() == View.GONE) {
|
if (lt_controls.getVisibility() == View.GONE) {
|
||||||
InputMethodManager methodManager = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
|
InputMethodManager methodManager = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
if (methodManager != null) {
|
if (methodManager != null) {
|
||||||
methodManager.hideSoftInputFromWindow(feedback_edittext.getWindowToken(),
|
methodManager.hideSoftInputFromWindow(feedback_edittext.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
|
||||||
InputMethodManager.HIDE_NOT_ALWAYS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Thread thread = new Thread(new Runnable() {
|
Thread thread = new Thread(new Runnable() {
|
||||||
@ -285,61 +286,60 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
oldestMessageId = -1;
|
oldestMessageId = -1;
|
||||||
}
|
}
|
||||||
Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE;
|
Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE;
|
||||||
RongIMClient.getInstance().getHistoryMessages(conversationType, SystemMessageActivity.nowUid, oldestMessageId, 20,
|
RongIMClient.getInstance().getHistoryMessages(conversationType, SystemMessageActivity.nowUid, oldestMessageId, 20, new RongIMClient.ResultCallback<List<Message>>() {
|
||||||
new RongIMClient.ResultCallback<List<Message>>() {
|
/**
|
||||||
/**
|
* 成功时回调
|
||||||
* 成功时回调
|
* @param messages 获取的消息列表
|
||||||
* @param messages 获取的消息列表
|
*/
|
||||||
*/
|
@Override
|
||||||
@Override
|
public void onSuccess(List<Message> messages) {
|
||||||
public void onSuccess(List<Message> messages) {
|
Collections.reverse(messages);
|
||||||
Collections.reverse(messages);
|
EventBus.getDefault().post(messages);
|
||||||
EventBus.getDefault().post(messages);
|
if (messages.size() > 0) {
|
||||||
if (messages.size() > 0) {
|
if (messages.size() < 20) {
|
||||||
if (messages.size() < 20) {
|
moretext = false;
|
||||||
moretext = false;
|
} else {
|
||||||
} else {
|
moretext = true;
|
||||||
moretext = true;
|
}
|
||||||
}
|
oldestMessageId = messages.get(0).getMessageId();
|
||||||
oldestMessageId = messages.get(0).getMessageId();
|
Log.i("chatlist", "oldestMessageId = " + oldestMessageId);
|
||||||
Log.i("chatlist", "oldestMessageId = " + oldestMessageId);
|
if (messagesList.size() == 0) {
|
||||||
if (messagesList.size() == 0) {
|
Message messageNo = new Message();
|
||||||
Message messageNo = new Message();
|
messageNo.setSenderUserId("-1");
|
||||||
messageNo.setSenderUserId("-1");
|
messagesList.add(messageNo);
|
||||||
messagesList.add(messageNo);
|
|
||||||
|
|
||||||
messagesList.addAll(messages);
|
messagesList.addAll(messages);
|
||||||
} else {
|
} else {
|
||||||
if (moretext) {
|
if (moretext) {
|
||||||
messagesList.get(0).setSenderUserId("-1");
|
messagesList.get(0).setSenderUserId("-1");
|
||||||
} else {
|
|
||||||
messagesList.get(0).setSenderUserId("-2");
|
|
||||||
}
|
|
||||||
messagesList.addAll(1, messages);
|
|
||||||
}
|
|
||||||
mHandler.sendEmptyMessageAtTime(1, 0);
|
|
||||||
} else {
|
} else {
|
||||||
moretext = false;
|
|
||||||
if (messagesList.size() == 0) {
|
|
||||||
Message messageNo = new Message();
|
|
||||||
messageNo.setSenderUserId("-1");
|
|
||||||
messagesList.add(messageNo);
|
|
||||||
messagesList.addAll(messages);
|
|
||||||
}
|
|
||||||
messagesList.get(0).setSenderUserId("-2");
|
messagesList.get(0).setSenderUserId("-2");
|
||||||
mHandler.sendEmptyMessageAtTime(1, 0);
|
|
||||||
}
|
}
|
||||||
|
messagesList.addAll(1, messages);
|
||||||
}
|
}
|
||||||
|
mHandler.sendEmptyMessageAtTime(1, 0);
|
||||||
|
} else {
|
||||||
|
moretext = false;
|
||||||
|
if (messagesList.size() == 0) {
|
||||||
|
Message messageNo = new Message();
|
||||||
|
messageNo.setSenderUserId("-1");
|
||||||
|
messagesList.add(messageNo);
|
||||||
|
messagesList.addAll(messages);
|
||||||
|
}
|
||||||
|
messagesList.get(0).setSenderUserId("-2");
|
||||||
|
mHandler.sendEmptyMessageAtTime(1, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 错误时回调。
|
* 错误时回调。
|
||||||
* @param e 错误码
|
* @param e 错误码
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onError(RongIMClient.ErrorCode e) {
|
public void onError(RongIMClient.ErrorCode e) {
|
||||||
ToastUtil.show("消息获取失败");
|
ToastUtil.show("消息获取失败");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,12 +357,22 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<SystemMessageBean>() {
|
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<SystemMessageBean>() {
|
||||||
@Override
|
@Override
|
||||||
public RefreshAdapter<SystemMessageBean> getAdapter() {
|
public RefreshAdapter<SystemMessageBean> getAdapter() {
|
||||||
if (mAdapter == null && (SystemMessageActivity.type.equals("1"))) {
|
if (mAdapter == null && (SystemMessageActivity.type.equals("1"))) {//官方通知
|
||||||
mAdapter = new SystemMessageAdapter(mContext);
|
mAdapter = new SystemMessageAdapter(mContext);
|
||||||
} else if (mAdapter == null && SystemMessageActivity.type.equals("2")) {
|
} else if (mAdapter == null && SystemMessageActivity.type.equals("2")) {
|
||||||
mAdapter = new InteractionMessageAdapter(mContext, SystemMessageViewHolder.this);
|
mAdapter = new InteractionMessageAdapter(mContext, SystemMessageViewHolder.this);
|
||||||
} else if (mAdapter == null && SystemMessageActivity.type.equals("4")) {
|
} else if (mAdapter == null && SystemMessageActivity.type.equals("4")) {//系统消息
|
||||||
mAdapter = new SystemMessageNewAdapter(mContext);
|
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;
|
return mAdapter;
|
||||||
}
|
}
|
||||||
@ -582,8 +592,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
try {
|
try {
|
||||||
MediaMetadataRetriever mmr = new MediaMetadataRetriever();
|
MediaMetadataRetriever mmr = new MediaMetadataRetriever();
|
||||||
mmr.setDataSource(url);
|
mmr.setDataSource(url);
|
||||||
duration = Integer.parseInt(mmr.extractMetadata
|
duration = Integer.parseInt(mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION)) / 1000;//除以 1000 返回是秒
|
||||||
(MediaMetadataRetriever.METADATA_KEY_DURATION)) / 1000;//除以 1000 返回是秒
|
|
||||||
//时长(毫秒)
|
//时长(毫秒)
|
||||||
// String duration = mmr.extractMetadata(android.media.MediaMetadataRetriever.METADATA_KEY_DURATION);
|
// String duration = mmr.extractMetadata(android.media.MediaMetadataRetriever.METADATA_KEY_DURATION);
|
||||||
// //宽
|
// //宽
|
||||||
@ -683,11 +692,11 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
//intoIndex 1=调用相机,2=照片选取,3=视频选取
|
//intoIndex 1=调用相机,2=照片选取,3=视频选取
|
||||||
public void choosePic(int intoIndex) {
|
public void choosePic(int intoIndex) {
|
||||||
//选择图片
|
//选择图片
|
||||||
String permission1=Manifest.permission.READ_EXTERNAL_STORAGE;
|
String permission1 = Manifest.permission.READ_EXTERNAL_STORAGE;
|
||||||
String permission2= Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
String permission2 = Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
permission1=Manifest.permission.READ_MEDIA_IMAGES;
|
permission1 = Manifest.permission.READ_MEDIA_IMAGES;
|
||||||
permission2=Manifest.permission.READ_MEDIA_VIDEO;
|
permission2 = Manifest.permission.READ_MEDIA_VIDEO;
|
||||||
}
|
}
|
||||||
int isPermission1 = ContextCompat.checkSelfPermission(mContext, permission1);
|
int isPermission1 = ContextCompat.checkSelfPermission(mContext, permission1);
|
||||||
int isPermission2 = ContextCompat.checkSelfPermission(mContext, permission2);
|
int isPermission2 = ContextCompat.checkSelfPermission(mContext, permission2);
|
||||||
@ -695,8 +704,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
startActivity(intoIndex);
|
startActivity(intoIndex);
|
||||||
} else {
|
} else {
|
||||||
//申请权限
|
//申请权限
|
||||||
ActivityCompat.requestPermissions(nowActivity, new String[]{permission1,
|
ActivityCompat.requestPermissions(nowActivity, new String[]{permission1, permission2}, PERMISSION_REQUEST_CODE);
|
||||||
permission2}, PERMISSION_REQUEST_CODE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1050,8 +1058,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ImMessageAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
|
public ImMessageAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
|
||||||
View view = mInflater.inflate(R.layout.item_chat_one,
|
View view = mInflater.inflate(R.layout.item_chat_one, viewGroup, false);
|
||||||
viewGroup, false);
|
|
||||||
|
|
||||||
ImMessageAdapter.ViewHolder viewHolder = new ImMessageAdapter.ViewHolder(view);
|
ImMessageAdapter.ViewHolder viewHolder = new ImMessageAdapter.ViewHolder(view);
|
||||||
return viewHolder;
|
return viewHolder;
|
||||||
@ -1207,9 +1214,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
viewHolder.cv_chatcontent_img1.setVisibility(View.VISIBLE);
|
viewHolder.cv_chatcontent_img1.setVisibility(View.VISIBLE);
|
||||||
viewHolder.rt_video_left.setVisibility(View.GONE);
|
viewHolder.rt_video_left.setVisibility(View.GONE);
|
||||||
|
|
||||||
Glide.with(mContext)
|
Glide.with(mContext).load(imageMessage.getThumUri()).into(viewHolder.chatcontent_img1);
|
||||||
.load(imageMessage.getThumUri())
|
|
||||||
.into(viewHolder.chatcontent_img1);
|
|
||||||
viewHolder.chatcontent_img1.setOnClickListener(new View.OnClickListener() {
|
viewHolder.chatcontent_img1.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
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.cv_chatcontent_img.setVisibility(View.VISIBLE);
|
||||||
viewHolder.rt_video_right.setVisibility(View.GONE);
|
viewHolder.rt_video_right.setVisibility(View.GONE);
|
||||||
if (mDatas.get(position).getReceivedTime() == 0) {
|
if (mDatas.get(position).getReceivedTime() == 0) {
|
||||||
Glide.with(mContext)
|
Glide.with(mContext).load(imageMessage.getThumUri()).into(viewHolder.chatcontent_img);
|
||||||
.load(imageMessage.getThumUri())
|
|
||||||
.into(viewHolder.chatcontent_img);
|
|
||||||
viewHolder.view_feed_suc.setVisibility(View.VISIBLE);
|
viewHolder.view_feed_suc.setVisibility(View.VISIBLE);
|
||||||
viewHolder.view_feed_suc.setOnClickListener(new View.OnClickListener() {
|
viewHolder.view_feed_suc.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -1238,14 +1241,10 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
});
|
});
|
||||||
} else if (mDatas.get(position).getReceivedTime() < 100) {
|
} else if (mDatas.get(position).getReceivedTime() < 100) {
|
||||||
viewHolder.view_feed_suc.setVisibility(View.GONE);
|
viewHolder.view_feed_suc.setVisibility(View.GONE);
|
||||||
Glide.with(mContext)
|
Glide.with(mContext).load(imageMessage.getThumUri()).into(viewHolder.chatcontent_img);
|
||||||
.load(imageMessage.getThumUri())
|
|
||||||
.into(viewHolder.chatcontent_img);
|
|
||||||
} else {
|
} else {
|
||||||
viewHolder.view_feed_suc.setVisibility(View.GONE);
|
viewHolder.view_feed_suc.setVisibility(View.GONE);
|
||||||
Glide.with(mContext)
|
Glide.with(mContext).load(imageMessage.getThumUri()).into(viewHolder.chatcontent_img);
|
||||||
.load(imageMessage.getThumUri())
|
|
||||||
.into(viewHolder.chatcontent_img);
|
|
||||||
|
|
||||||
viewHolder.chatcontent_img.setOnClickListener(new View.OnClickListener() {
|
viewHolder.chatcontent_img.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -1412,16 +1411,9 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
|||||||
*/
|
*/
|
||||||
public static void loadCover(ImageView imageView, Uri uri, Context context) {
|
public static void loadCover(ImageView imageView, Uri uri, Context context) {
|
||||||
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||||
Glide.with(context)
|
Glide.with(context).setDefaultRequestOptions(new RequestOptions().frame(1000000).centerCrop().error(R.drawable.anim_loading)//可以忽略
|
||||||
.setDefaultRequestOptions(
|
.placeholder(R.drawable.anim_loading)//可以忽略
|
||||||
new RequestOptions()
|
).load(uri).into(imageView);
|
||||||
.frame(1000000)
|
|
||||||
.centerCrop()
|
|
||||||
.error(R.drawable.anim_loading)//可以忽略
|
|
||||||
.placeholder(R.drawable.anim_loading)//可以忽略
|
|
||||||
)
|
|
||||||
.load(uri)
|
|
||||||
.into(imageView);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//互动消息回复
|
//互动消息回复
|
||||||
|
111
live/src/main/res/layout/activity_compensate.xml
Normal file
111
live/src/main/res/layout/activity_compensate.xml
Normal 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>
|
37
live/src/main/res/layout/item_msg_sys_gift.xml
Normal file
37
live/src/main/res/layout/item_msg_sys_gift.xml
Normal 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>
|
@ -17,6 +17,7 @@
|
|||||||
android:textSize="11sp" />
|
android:textSize="11sp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/itemLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
BIN
live/src/main/res/mipmap-mdpi/icon_sys_receive.png
Normal file
BIN
live/src/main/res/mipmap-mdpi/icon_sys_receive.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
BIN
live/src/main/res/mipmap-mdpi/icon_sys_received.png
Normal file
BIN
live/src/main/res/mipmap-mdpi/icon_sys_received.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
Loading…
Reference in New Issue
Block a user