Merge branch 'refs/heads/master' into v681小游戏

# Conflicts:
#	common/src/main/java/com/yunbao/common/http/PDLiveApi.java
#	common/src/main/res/values-zh/strings.xml
#	common/src/main/res/values/strings.xml
This commit is contained in:
zlzw 2024-08-14 15:59:11 +08:00
commit 451a875526
22 changed files with 452 additions and 19 deletions

View File

@ -0,0 +1,9 @@
package com.yunbao.common.bean;
//处罚消息的对象
public class PunishBean {
public String id;
public String title, content;
}

View File

@ -1349,6 +1349,11 @@ public interface PDLiveApi {
@Query("gift_id")String giftId,
@Query("live_uid")String liveUid
);
//处罚通知红点
@GET("/api/public/?service=Message.penalizeStatus")
Observable<ResponseModel> getPenalizeStatus();
@GET("/api/public/?service=Sudgameserver.ballClearanceTableStatus")
Observable<ResponseModel<BaseModel>> ballClearanceTableStatus(
@Query("room_id")String roomId

View File

@ -95,6 +95,8 @@ import com.yunbao.common.http.base.CheckLiveCallBack;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.utils.WordUtil;
import org.json.JSONObject;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
@ -3716,6 +3718,42 @@ public class LiveNetManager {
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
}
public void getPenalizeStatus(HttpCallback<ResponseModel> callback) {
API.get().pdLiveApi(mContext)
.getPenalizeStatus()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel>() {
@Override
public void accept(ResponseModel responseModel) throws Exception {
if (callback != null) {
if (responseModel.getData().getCode() == 0) {
String s = responseModel.getData().getInfo().toString();
try {
JSONObject ob = new JSONObject(s);
if (ob.getInt("unread_num") > 0) {
callback.onSuccess(responseModel);
} else {
callback.onError("");
}
} catch (Exception e) {
callback.onError("");
}
} else {
callback.onError("");
}
}
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
/**
* 直播间取消网络请求
*/

View File

@ -1,6 +1,5 @@
package com.yunbao.common.utils;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
@ -57,6 +56,7 @@ public class RouteUtil {
public static final String PATH_FEEDBACK_SUCCESS_ACTIVITY = "/main/FeedbackSuccessActivity";
public static final String PATH_FEEDBACK_ACTIVITY = "/main/FeedbackActivity";
public static final String PATH_FEEDBACK_EDIT_ACTIVITY = "/main/FeedbackEditActivity";
public static final String PATH_LIVE_PUNISHACTIVITY = "/live/PunishActivity";
public static void forwardCommunityActivity() {
@ -381,4 +381,11 @@ public class RouteUtil {
ARouter.getInstance().build(path)
.navigation();
}
/**
* 处罚通知界面
*/
public static void forwardPunishActivity() {
ARouter.getInstance().build(PATH_LIVE_PUNISHACTIVITY)
.navigation();
}
}

View File

@ -1545,6 +1545,8 @@
<string name="live_end_view_ban_reason">違規原因:</string>
<string name="live_end_view_ban_content">處罰內容:</string>
<string name="live_end_view_ban_timer">處罰時間:</string>
<string name="live_end_view_ban_punish_title">處罰通知</string>
<string name="game_create_coid_ticket">門票</string>
<string name="game_list_activity_title">挑戰一桿清台,瓜分高額獎金</string>
<string name="game_dialog_loading_tips_text">結算超時,請前往活動頁面查看本局結果</string>

View File

@ -85,4 +85,6 @@
<color name="gray_f6f6f6f6">#FFF6F6F6</color>
<color name="gray_F4F4F4">#F4F4F4</color>
<color name="color_555555">#555555</color>
<color name="color_525252">#525252</color>
</resources>

View File

@ -1554,6 +1554,7 @@
<string name="live_end_view_ban_reason">Violation reasons:</string>
<string name="live_end_view_ban_content">Penalty content:</string>
<string name="live_end_view_ban_timer">Penalty time:</string>
<string name="live_end_view_ban_punish_title">Punishment Notice</string>
<string name="game_create_coid_ticket">Ticket</string>
<string name="game_list_activity_title">Challenge One-shot clearance Share high bonuses</string>
<string name="game_dialog_loading_tips_text"> Settlement timed out. Please check the result on the event page</string>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
>
xmlns:tools="http://schemas.android.com/tools">
<!--com.kugou.fanxing.allinone.watch.liveroominone.media.FALiveRoomInOneActivity"-->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
@ -132,6 +131,10 @@
<activity
android:name=".activity.CompensateActivity"
android:screenOrientation="portrait" />
<activity
android:name=".activity.PunishActivity"
android:label="处罚通知列表"
android:screenOrientation="portrait" />
</application>
</manifest>

View File

@ -0,0 +1,81 @@
package com.yunbao.live.activity;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.fastjson.JSON;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.common.custom.CommonRefreshView;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.live.R;
import com.yunbao.live.adapter.PunishAdapter;
import com.yunbao.common.bean.PunishBean;
import com.yunbao.live.http.ImHttpUtil;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
//处罚通知单
@Route(path = RouteUtil.PATH_LIVE_PUNISHACTIVITY)
public class PunishActivity extends AbsActivity {
private CommonRefreshView mRefreshView;
private PunishAdapter adapter;
private List<PunishBean> mData = new ArrayList<>();
@Override
protected int getLayoutId() {
return R.layout.activity_punish;
}
@Override
protected void main() {
super.main();
findViewById(R.id.btn_back).setOnClickListener(v -> finish());
mRefreshView = findViewById(R.id.refreshView);
mRefreshView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
adapter = new PunishAdapter(this, mData);
mRefreshView.setEmptyLayoutId(R.layout.activity_punish_no_data);
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<PunishBean>() {
@Override
public RefreshAdapter<PunishBean> getAdapter() {
return adapter;
}
@Override
public void loadData(int p, HttpCallback callback) {
ImHttpUtil.getPenalizeList(p, callback);
}
@Override
public List<PunishBean> processData(String[] info) {
return JSON.parseArray(Arrays.toString(info), PunishBean.class);
}
@Override
public void onRefreshSuccess(List<PunishBean> list, int listCount) {
}
@Override
public void onRefreshFailure() {
}
@Override
public void onLoadMoreSuccess(List<PunishBean> loadItemList, int loadItemCount) {
}
@Override
public void onLoadMoreFailure() {
}
});
mRefreshView.initData();
}
}

View File

@ -5,20 +5,18 @@ import android.content.Intent;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.yunbao.common.Constants;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.activity.SelectImageActivity;
import com.yunbao.common.bean.ImageEntity;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.http.ResponseModel;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.live.R;
import com.yunbao.live.bean.SystemMessageBean;
import com.yunbao.live.views.SystemMessageViewHolder;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.Date;
@ -36,6 +34,7 @@ public class SystemMessageActivity extends AbsActivity {
public static String type;//-1=单聊消息,1=系统消息,2=互动消息,3=猜你喜欢,-2=web页面打开
public static String type2 = "0";//判断是否注册监听
public static String nowUid, nowTitle, mowHeadImg;
private TextView punish, punishNotice;//处罚通知
public static void forward(Context context, String type, String uid, String title, String headImg) {
context.startActivity(new Intent(context, SystemMessageActivity.class).putExtra("type", type).putExtra("uid", uid).putExtra("title", title).putExtra("headImg", headImg));
@ -72,6 +71,13 @@ public class SystemMessageActivity extends AbsActivity {
// mSystemMessageViewHolder.loadData();
// }
init();
punish = findViewById(R.id.tv_sys_msg_punish);
punish.setVisibility(View.VISIBLE);
punishNotice = findViewById(R.id.tv_sys_msg_punish_notice);
punish.setOnClickListener(v -> {
RouteUtil.forwardPunishActivity();
punishNotice.setVisibility(View.GONE);
});
mSystemMessageViewHolder.btn_back.setOnClickListener(new View.OnClickListener() {
@Override
@ -79,6 +85,17 @@ public class SystemMessageActivity extends AbsActivity {
finish();
}
});
LiveNetManager.get(mContext).getPenalizeStatus(new com.yunbao.common.http.base.HttpCallback<ResponseModel>() {
@Override
public void onSuccess(ResponseModel responseModel) {
punishNotice.setVisibility(View.VISIBLE);
}
@Override
public void onError(String error) {
punishNotice.setVisibility(View.GONE);
}
});
}
//更新新消息

View File

@ -0,0 +1,56 @@
package com.yunbao.live.adapter;
import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.live.R;
import com.yunbao.common.bean.PunishBean;
import java.util.List;
public class PunishAdapter extends RefreshAdapter<PunishBean> {
public PunishAdapter(Context context, List<PunishBean> list) {
super(context, list);
}
@NonNull
@Override
public PunishHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new PunishHolder(mInflater.inflate(R.layout.activity_punish_item, parent, false));
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder h, int position) {
PunishHolder holder = (PunishHolder) h;
PunishBean item = mList.get(position);
holder.title.setText(item.title);
if (TextUtils.isEmpty(item.content)) {
holder.line.setVisibility(View.GONE);
} else {
holder.line.setVisibility(View.VISIBLE);
}
holder.value.setText(item.content);
}
class PunishHolder extends RecyclerView.ViewHolder {
public TextView title, value;
public View line;
public PunishHolder(@NonNull View itemView) {
super(itemView);
title = itemView.findViewById(R.id.tv_punish_title);
value = itemView.findViewById(R.id.tv_punish_value);
line = itemView.findViewById(R.id.view_punish_line);
}
}
}

View File

@ -1,6 +1,5 @@
package com.yunbao.live.adapter;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
@ -20,7 +19,6 @@ import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
@ -77,9 +75,13 @@ public class SystemMessageNewAdapter extends RefreshAdapter<SystemMessageBean> {
}
void setData(SystemMessageBean bean, int position) {
SimpleDateFormat sdf = new SimpleDateFormat("MM-dd HH:mm");
Date currenTimeZone = new Date(Long.parseLong(bean.getAddtime() + "000"));
messageTime.setText(sdf.format(currenTimeZone));
if (!TextUtils.isEmpty(bean.getAddtime())) {
SimpleDateFormat sdf = new SimpleDateFormat("MM-dd HH:mm");
Date currenTimeZone = new Date(Long.parseLong(bean.getAddtime() + "000"));
messageTime.setText(sdf.format(currenTimeZone));
} else {
messageTime.setText("");
}
messageContext.setText(bean.getContent());
title.setText(String.valueOf(bean.getTitle()));

View File

@ -1,6 +1,5 @@
package com.yunbao.live.http;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
@ -110,4 +109,22 @@ public class ImHttpUtil {
.params("message_id", msgid)
.execute(callback);
}
/**
* 处罚通知是否有未读消息
*/
public static void getPenalizeStatus(HttpCallback callback) {
HttpClient.getInstance().get("Message.penalizeStatus", "Message.penalizeStatus")
.execute(callback);
}
/**
* 处罚通知列表
*/
public static void getPenalizeList(int p, HttpCallback callback) {
HttpClient.getInstance().get("Message.penalizeList", "Message.penalizeList")
.params("p", p)
.execute(callback);
}
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:bottomLeftRadius="8dp"
android:bottomRightRadius="8dp"
android:topLeftRadius="2dp"
android:topRightRadius="8dp" />
<stroke
android:width="1px"
android:color="#555555" />
<solid android:color="@color/colorWhite" />
</shape>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="6dp" />
<solid android:color="#FFAE04" />
</shape>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="10dp"/>
<solid android:color="#FE4C4B"/>
</shape>

View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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">
<FrameLayout
android:id="@+id/rl_layout"
android:layout_width="match_parent"
android:layout_height="70dp"
android:background="@color/white"
android:paddingTop="24dp"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/titleView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/live_end_view_ban_punish_title"
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_gravity="center_vertical"
android:padding="9dp"
android:src="@mipmap/icon_back"
android:tint="@color/textColor"
tools:ignore="UseAppTint" />
</FrameLayout>
<com.yunbao.common.custom.CommonRefreshView
android:id="@+id/refreshView"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/rl_layout" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="10dp">
<ImageView
android:id="@+id/iv_punish_icon"
android:layout_width="36dp"
android:layout_height="40dp"
android:layout_marginLeft="18dp"
android:src="@mipmap/cftz"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="234dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginTop="18dp"
android:layout_marginEnd="25dp"
android:background="@drawable/bg_bk_ffffff_555555_8dp"
android:orientation="vertical"
app:layout_constraintLeft_toRightOf="@id/iv_punish_icon"
app:layout_constraintTop_toTopOf="@id/iv_punish_icon">
<TextView
android:id="@+id/tv_punish_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="9dp"
android:layout_marginTop="6dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="5dp"
android:text="标题"
android:textColor="@color/color_555555"
android:textSize="14sp"
android:textStyle="bold" />
<View
android:id="@+id/view_punish_line"
android:layout_width="match_parent"
android:layout_height="0.4dp"
android:background="@color/color_525252" />
<TextView
android:id="@+id/tv_punish_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="9dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:text="内容"
android:textColor="@color/color_555555"
android:textSize="13sp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/img_nodata_pic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/cftz_no_data" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="暫無處罰通知"
android:textColor="#333333"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="No penalty notice yet."
android:textColor="@color/color_555555"
android:textSize="12sp" />
</LinearLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/lt_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -28,7 +29,8 @@
android:layout_centerVertical="true"
android:padding="9dp"
android:src="@mipmap/icon_back"
android:tint="@color/textColor" />
android:tint="@color/textColor"
tools:ignore="UseAppTint" />
<ImageView
android:id="@+id/img_more"
@ -39,7 +41,34 @@
android:padding="6dp"
android:src="@mipmap/btn_more_black"
android:tint="@color/textColor"
android:visibility="gone"
tools:ignore="UseAppTint" />
<TextView
android:id="@+id/tv_sys_msg_punish"
android:layout_width="60dp"
android:layout_height="25dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginEnd="16dp"
android:background="@drawable/bg_ffae04_6dp"
android:gravity="center"
android:text="@string/live_end_view_ban_punish_title"
android:textColor="@color/colorWhite"
android:textSize="12sp"
android:visibility="visible" />
<TextView
android:id="@+id/tv_sys_msg_punish_notice"
android:layout_width="6dp"
android:layout_height="6dp"
android:background="@drawable/bg_red_yuan"
android:layout_alignTop="@+id/tv_sys_msg_punish"
android:layout_alignEnd="@id/tv_sys_msg_punish"
android:layout_marginTop="-1.5dp"
android:layout_marginEnd="-1.5dp"
android:visibility="gone" />
</RelativeLayout>
<com.yunbao.common.custom.CommonRefreshView
@ -129,8 +158,8 @@
android:id="@+id/lt_controls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="9dp"
android:layout_marginLeft="9dp"
android:layout_marginTop="9dp"
android:layout_marginRight="9dp"
android:layout_marginBottom="18dp"
android:gravity="center"
@ -141,8 +170,8 @@
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="9dp"
android:visibility="gone"
android:background="@color/gray_ededed" />
android:background="@color/gray_ededed"
android:visibility="gone" />
<LinearLayout
android:layout_width="match_parent"

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB