推送管理

This commit is contained in:
hch
2024-01-09 14:52:27 +08:00
parent dcf3f5c308
commit 661c2fd334
29 changed files with 608 additions and 118 deletions

View File

@@ -67,6 +67,13 @@ public abstract class RefreshAdapter<T> extends RecyclerView.Adapter {
}
}
public void refreshDel(){
if (mRecyclerView != null) {
notifyDataSetChanged();
}
}
public void refreshData(List<T> list) {
if (mRecyclerView != null && list != null) {
mList.clear();

View File

@@ -1,5 +1,7 @@
package com.yunbao.common.utils;
import com.yunbao.common.http.Data;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -13,10 +15,13 @@ public class DateFormatUtil {
private static SimpleDateFormat sFormat2;
private static SimpleDateFormat sFormat3;
private static SimpleDateFormat sFormat4;
static {
sFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS");
sFormat2 = new SimpleDateFormat("yyyyMMdd_HHmmss_SSS");
sFormat3 = new SimpleDateFormat("MM.dd-HH:mm:ss");
sFormat4 = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
}
@@ -24,6 +29,14 @@ public class DateFormatUtil {
return sFormat.format(new Date());
}
public static String getTimeString(long time) {
Date date = new Date(time); // 创建Date对象并传入时间戳参数
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 设置日期格式
String formattedDate = sdf.format(date); // 格式化日期字符串
return formattedDate;
}
public static String getVideoCurTimeString() {
return sFormat2.format(new Date());
}

View File

@@ -1,5 +1,6 @@
package com.yunbao.common.utils;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
@@ -46,7 +47,7 @@ public class RouteUtil {
public static final String PATH_RED_PACKET_LIST = "/main/RedPacketListActivity";
public static final String PATH_RED_PACKET_INFO = "/main/RedPacketInfoActivity";
public static final String PATH_RED_PACKET_USER = "/main/RedPacketUsersActivity";
public static final String PATH_SELECT_AVATAR="/main/UserAvatarSelectActivity";
public static final String PATH_SELECT_AVATAR = "/main/UserAvatarSelectActivity";
public static void forwardFansActivity(String uid) {
ARouter.getInstance().build(PATH_FANSACTIVITY)
@@ -152,10 +153,15 @@ public class RouteUtil {
/**
* 跳转到
*/
public static void forwardLiveCompensateActivity(String url, boolean isFull) {
public static void forwardLiveCompensateActivity(Context context, String msgid, String banner, String title, String content, String time, String link, boolean receive) {
ARouter.getInstance().build(PATH_COMPENSATE_ACTIVITY)
.withString("url", url)
.withBoolean("isFull", isFull)
.withString("msgid", msgid)
.withString("banner", banner)
.withString("title", title)
.withString("content", content)
.withString("time", time)
.withString("link", link)
.withBoolean("receive", receive)
.navigation();
}
@@ -195,7 +201,7 @@ public class RouteUtil {
* 跳转到充值页面
*/
public static void forwardMyCoin(Context context) {
String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=zhifu&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=zhifu&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
ARouter.getInstance().build(PATH_COIN).withString("url", url).navigation();
}
@@ -246,14 +252,14 @@ public class RouteUtil {
postcard.navigation();
}
public static void forwardGiftWallActivity(String mStream, String mAnchorName, String mLiveUid, String mAvatarUrl, int isAttention,boolean isLive) {
public static void forwardGiftWallActivity(String mStream, String mAnchorName, String mLiveUid, String mAvatarUrl, int isAttention, boolean isLive) {
ARouter.getInstance().build(PATH_GIFT_WALL)
.withString(Constants.LIVE_UID, mLiveUid)
.withString(Constants.STREAM, mStream)
.withString("mAnchorName", mAnchorName)
.withString("mAvatarUrl", mAvatarUrl)
.withInt("isAttention", isAttention)
.withBoolean("isLive",isLive)
.withBoolean("isLive", isLive)
.navigation();
}
@@ -323,7 +329,7 @@ public class RouteUtil {
/**
* 系统头像选择
*/
public static void forwardUserAvatarSelect(){
public static void forwardUserAvatarSelect() {
ARouter.getInstance().build(PATH_SELECT_AVATAR)
.navigation();
}

View File

@@ -33,10 +33,12 @@ public class SpUtil {
public static final String BEAUTY_SDK_TYPE = "beautySdkType";
public static final String TURNTABLE_ENABLE = "turntableEnable";
public static final String BEAUTY_360_TIEZHI_URL = "beauty360TiezhiUrl";
public static final String BEAUTY_360_TIEZHI_EXIST = "beauty360TiezhiExist";
public static final String ANCHOR_PK_TIME = "anchorPkTime";
public static final String BEAUTY_360_TIEZHI_EXIST = "beauty360TiezhiExist";
public static final String ANCHOR_PK_TIME = "anchorPkTime";
//播放短视频上下滑动引导页
public static final String READ_VIDEO_GUIDE = "readVideoGuide";
public static final String READ_VIDEO_GUIDE = "readVideoGuide";
public static final String MESSAGE_SYS_DEL = "FIRST_DEL";
public SpUtil() {
@@ -73,8 +75,8 @@ public class SpUtil {
/**
* 判断一个值是否存在
*/
public boolean isExists(String key){
return mSharedPreferences.contains(key);
public boolean isExists(String key) {
return mSharedPreferences.contains(key);
}
/**

View File

@@ -0,0 +1,42 @@
package com.yunbao.common.views;
import android.content.Context;
import androidx.annotation.NonNull;
import com.lxj.xpopup.core.AttachPopupView;
import com.yunbao.common.R;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
public class MsgSysDelPopupView extends AttachPopupView {
ItemDelListener itemDelListener;
public MsgSysDelPopupView(@NonNull Context context, ItemDelListener itemDelListener) {
super(context);
this.itemDelListener = itemDelListener;
}
@Override
protected int getImplLayoutId() {
return R.layout.view_msg_sys_del;
}
@Override
protected void onCreate() {
//特效设置
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.del), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
itemDelListener.onItemDel();
}
});
}
public interface ItemDelListener {
void onItemDel();
}
}

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="50dp"
android:layout_height="25dp"
app:cardBackgroundColor="#0F0B14"
app:cardCornerRadius="4dp"
app:cardElevation="16dp">
<TextView
android:id="@+id/del"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/delete"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</androidx.cardview.widget.CardView>

View File

@@ -1400,4 +1400,14 @@ Limited ride And limited avatar frame</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="receive_success">Successfully claimed</string>
<string name="receive1">Receive</string>
<string name="receive2">Received</string>
<string name="del_suc">Delete successful</string>
<string name="sys_msg_year">-</string>
<string name="sys_msg_month">-</string>
<string name="sys_msg_day"></string>
</resources>

View File

@@ -1398,4 +1398,15 @@
<string name="pay_cancel">支付取消</string>
<string name="pay_suc">支付成功</string>
<string name="pay_fail">支付失敗</string>
<string name="receive_success">領取成功</string>
<string name="receive1">領取</string>
<string name="receive2">已領取</string>
<string name="del_suc">刪除成功</string>
<string name="sys_msg_year"></string>
<string name="sys_msg_month"></string>
<string name="sys_msg_day"></string>
</resources>

View File

@@ -1397,4 +1397,15 @@
<string name="pay_cancel">支付取消</string>
<string name="pay_suc">支付成功</string>
<string name="pay_fail">支付失敗</string>
<string name="receive_success">領取成功</string>
<string name="receive1">領取</string>
<string name="receive2">已領取</string>
<string name="del_suc">刪除成功</string>
<string name="sys_msg_year"></string>
<string name="sys_msg_month"></string>
<string name="sys_msg_day"></string>
</resources>

View File

@@ -1396,4 +1396,14 @@
<string name="msg_del_sys01">內含物品還未領取,是否確定刪除消息?</string>
<string name="msg_del_sys02">是否確定刪除消息?</string>
<string name="receive_success">領取成功</string>
<string name="receive1">领取</string>
<string name="receive2">已領取</string>
<string name="del_suc">刪除成功</string>
<string name="sys_msg_year"></string>
<string name="sys_msg_month"></string>
<string name="sys_msg_day"></string>
</resources>

View File

@@ -82,4 +82,6 @@
<color name="gray_f6f7fb">#F6F7FB</color>
<color name="gray_f6f6f6f6">#FFF6F6F6</color>
<color name="gray_F4F4F4">#F4F4F4</color>
</resources>

View File

@@ -1404,4 +1404,15 @@ 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="receive_success">Successfully claimed</string>
<string name="receive1">Receive</string>
<string name="receive2">Received</string>
<string name="del_suc">Delete successful</string>
<string name="sys_msg_year">-</string>
<string name="sys_msg_month">-</string>
<string name="sys_msg_day"></string>
</resources>