1:修改小时榜

This commit is contained in:
2025-10-09 09:26:16 +08:00
parent c68ffe6016
commit 329d698550
21 changed files with 315 additions and 62 deletions

View File

@@ -101,7 +101,7 @@ android {
}
buildTypes {
release {
minifyEnabled true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
@@ -123,7 +123,7 @@ android {
debug {
debuggable true
minifyEnabled true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug

View File

@@ -85,10 +85,43 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
}
}
}
// 新增版本检查逻辑
checkAppVersion();
super.onCreate(savedInstanceState);
// EventBus.getDefault().register(this);
// AppLogUtil.reportAppLog(AppLogEvent.A0101);
}
private void checkAppVersion() {
// 获取当前版本号
int currentVersionCode = 0;
try {
currentVersionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
} catch (Exception e) {
e.printStackTrace();
}
// 从SharedPreferences中获取上次运行的版本号
int lastVersionCode = PreferencesUtils.getInt(CommonAppContext.getInstance(), "last_version_code", 0);
// 如果版本号不同,说明应用已更新
if (currentVersionCode != lastVersionCode) {
// 保存当前版本号
PreferencesUtils.putInt(CommonAppContext.getInstance(), "last_version_code", currentVersionCode);
// 如果不是首次安装,则需要清理任务栈
if (lastVersionCode != 0) {
clearTaskAndRestart();
}
}
}
private void clearTaskAndRestart() {
// 清理所有Activity并重启应用
Intent intent = new Intent(this, PasswordLoginActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
finish();
}
@Override
protected void onDestroy() {

View File

@@ -28,8 +28,8 @@ isBuildModule=false
#org.gradle.deamon=false
android.injected.testOnly=false
APP_VERSION_NAME=1.2.1
APP_VERSION_CODE=173
APP_VERSION_NAME=1.2.6
APP_VERSION_CODE=178
org.gradle.jvm.toolchain.useLegacyAdapters=false
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15

View File

@@ -17,6 +17,7 @@ import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.provider.Settings;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
@@ -111,6 +112,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
}
QXGiftDriftView qxGiftDriftView;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -153,6 +155,10 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
EventBus.getDefault().register(this);
}
// 启动定时器
// startTimer();
}
// 在Activity中
@@ -208,6 +214,37 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
// 默认实现,子类可以覆盖
}
//在类中添加以下成员变量
private Handler timerHandler = new Handler();
private Runnable timerRunnable = new Runnable() {
@Override
public void run() {
// 调用你要执行的方法
// executePeriodicTask();
// 每10秒执行一次
timerHandler.postDelayed(this, 10000);
}
};
// 启动定时器的方法
private void startTimer() {
timerHandler.postDelayed(timerRunnable, 10000);
}
// 你需要定期执行的方法
private void executePeriodicTask() {
// 在这里实现你的业务逻辑
LogUtils.d("定时任务执行中...");
List<HourlyBean> hourlyBeans = new ArrayList<>();
HourlyBean hourlyBean = new HourlyBean();
hourlyBean.setText("nihao");
hourlyBean.setRank_number("1");
hourlyBean.setRoom_name("夏末");
hourlyBean.setRoom_id("1");
hourlyBeans.add(hourlyBean);
onMessageReceived(hourlyBeans);
}
protected void loadNetworkBackground() {
// 只有当已经有背景URL时才加载
@@ -546,12 +583,14 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
ivAvatar.setImageResource(R.mipmap.hourl_top3);
break;
default:
tvName.setVisibility(View.GONE);
ivAvatar.setVisibility(View.GONE);
break;
}
}
}
// 设置带颜色的文本
// 设置带颜色的文本
private void setColoredText(TextView textView, String prefix, String roomName, String suffix, int colorRes) {
@@ -706,7 +745,6 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
// QXGiftDriftView.getInstance( this).addGiftModel(mqttBean);
try {
// 清理之前的视图(如果存在)
if (currentMqttView != null && currentMqttView.getParent() != null) {
@@ -797,6 +835,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
}
}
}
private void resetAndStartMqttAnimation(View view, Runnable onAnimationEnd) {
try {
int screenWidth = getScreenWidth();
@@ -813,7 +852,8 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
enterAnim.setDuration(1500);
enterAnim.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {}
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
@@ -828,7 +868,8 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
exitAnim.setDuration(2000);
exitAnim.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {}
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
@@ -850,19 +891,20 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
}
@Override
public void onAnimationRepeat(Animation animation) {}
public void onAnimationRepeat(Animation animation) {
}
});
view.startAnimation(exitAnim);
}, 3000); // 停留1秒
}
@Override
public void onAnimationRepeat(Animation animation) {}
public void onAnimationRepeat(Animation animation) {
}
});
view.startAnimation(enterAnim);
// ObjectAnimator animator1 = ObjectAnimator.ofFloat(view, "translationX", view.getWidth(), 0f);
// animator1.setDuration(1500);
// animator1.setInterpolator(new DecelerateInterpolator(1f));
@@ -895,6 +937,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
onAnimationEnd.run();
}
}
// 添加获取屏幕宽度的方法
private int getScreenWidth() {
DisplayMetrics displayMetrics = new DisplayMetrics();
@@ -904,6 +947,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
}
return getResources().getDisplayMetrics().widthPixels;
}
private void resetAndStartXlhAnimation(View view, Runnable onAnimationEnd) {
try {
view.setTranslationX(view.getWidth());

View File

@@ -20,6 +20,7 @@ import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ScreenUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xscm.moduleutil.R;
import com.xscm.moduleutil.base.CommonAppContext;
import com.xscm.moduleutil.bean.AppUpdateModel;
import com.xscm.moduleutil.databinding.DialogAppUpdateBinding;
import com.xscm.moduleutil.utils.DownloadListener;

View File

@@ -129,6 +129,7 @@ public class RoomManager {
exitRoom(CommonAppContext.getInstance().playId);
CommonAppContext.getInstance().isShow = false;
CommonAppContext.getInstance().isPlaying = false;
CommonAppContext.getInstance().isRoomJoininj=false;
EventBus.getDefault().post(new RoomOutEvent());
} else if (CommonAppContext.getInstance().lable_id.equals("6")) {
upInfo(context, roomId, password, true, null, true);

View File

@@ -1,6 +1,8 @@
package com.xscm.moduleutil.http;
import com.xscm.moduleutil.base.CommonAppContext;
import com.xscm.moduleutil.bean.UserBean;
import com.xscm.moduleutil.utils.Sha1Util;
import com.xscm.moduleutil.utils.SpUtil;
@@ -34,13 +36,59 @@ public class AccessTokenInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
mHeaderMap.put("X-Token", SpUtil.getToken());
mHeaderMap.put("token", SpUtil.getToken());
// 确保所有 put 到 mHeaderMap 的值都不为 null
String xToken = getTokenSafely();
mHeaderMap.put("X-Token", xToken != null ? xToken : "");
String token = getTokenSafely();
mHeaderMap.put("token", token != null ? token : "");
long timestamp = System.currentTimeMillis() / 1000;
mHeaderMap.put("timestamp", String.valueOf(timestamp));
mHeaderMap.put("sign", Sha1Util.shaEncode(timestamp));
Request newRequest = request.newBuilder().headers(Headers.of(mHeaderMap)).build();
Response response = chain.proceed(newRequest);
return response;
Request newRequest = request.newBuilder()
.headers(Headers.of(mHeaderMap))
.build();
return chain.proceed(newRequest);
}
private String getTokenSafely() {
try {
String token = SpUtil.getToken();
if (isNotEmpty(token)) {
return token;
}
CommonAppContext appContext = CommonAppContext.getInstance();
if (appContext != null) {
token = appContext.getToken();
if (isNotEmpty(token)) {
return token;
}
}
UserBean userBean = SpUtil.getUserBean();
if (userBean != null) {
token = userBean.getToken();
if (isNotEmpty(token)) {
return token;
}
}
} catch (Exception e) {
// 添加异常处理,避免因获取 token 异常导致整个应用崩溃
return "";
}
return "";
}
private boolean isNotEmpty(String str) {
return str != null && !str.equals("");
}
}

View File

@@ -571,6 +571,9 @@ public interface ApiServer {
@POST(Constants.DELAY)
Call<BaseModel<String>> delay(@Field("friend_id") String friend_id, @Field("room_id") String room_id, @Field("delay_times") String delay_times);
@POST(Constants.POST_KEEP_XINTIAO)
Call<ResponseBody> keepXintiao();
@FormUrlEncoded
@POST(Constants.DOWN_PIT)
Call<BaseModel<String>> downPit(@Field("room_id") String room_id, @Field("pit_number") String pit_number);

View File

@@ -34,7 +34,7 @@ public class DefaultTransformer<T> implements ObservableTransformer<BaseModel<T>
}else {
// 触发登出事件EventBus
// com.blankj.utilcode.util.ToastUtils.showShort("提示当前账号已在别的地方登陆,如果不是本人操作请修改密码");
CommonAppContext.getInstance().clearLoginInfo();
// CommonAppContext.getInstance().clearLoginInfo();
}
throw new APIException(response.getCode(), response.getMsg());
}

View File

@@ -1387,11 +1387,22 @@ public class RetrofitClient {
public void onResponse(Call<BaseModel<List<BannerModel>>> call, Response<BaseModel<List<BannerModel>>> response) {
if (response.code() == 200) {
BaseModel<List<BannerModel>> listBaseModel = response.body();
if (listBaseModel.getCode()==1) {
if (listBaseModel != null) {
observer.onNext(listBaseModel.getData());
} else {
observer.onNext(null);
}
}else if (listBaseModel.getCode()==0){
observer.onNext(null);
}else if (listBaseModel.getCode()==301){
try {
CommonAppContext.getInstance().clearLoginInfo();
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
ToastUtils.showShort(listBaseModel.getMsg());
}
}
}
@@ -1409,12 +1420,22 @@ public class RetrofitClient {
public void onResponse(Call<BaseModel<List<TopRoom>>> call, Response<BaseModel<List<TopRoom>>> response) {
if (response.code() == 200) {
BaseModel<List<TopRoom>> listBaseModel = response.body();
if (listBaseModel.getCode()==1) {
if (listBaseModel != null) {
observer.onNext(listBaseModel.getData());
} else {
observer.onNext(null);
}
}else if (listBaseModel.getCode()==0){
observer.onNext(null);
}else if (listBaseModel.getCode()==301){
try {
CommonAppContext.getInstance().clearLoginInfo();
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
ToastUtils.showShort(listBaseModel.getMsg());
}
}
}
@@ -1433,6 +1454,15 @@ public class RetrofitClient {
BaseModel<List<RoomTypeModel>> listBaseModel = response.body();
if (listBaseModel.getCode() == 1) {
observer.onNext(listBaseModel.getData());
}else if (listBaseModel.getCode() == 0) {
observer.onNext(null);
}else if (listBaseModel.getCode() == 301) {
try {
CommonAppContext.getInstance().clearLoginInfo();
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
ToastUtils.showShort(listBaseModel.getMsg());
}
}
}
@@ -2686,6 +2716,20 @@ public class RetrofitClient {
});
}
public void keepXintiao(){
sApiServer.keepXintiao().enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
}
@Override
public void onFailure(Call<ResponseBody> call, Throwable t) {
}
});
}
public void setMutePit(String roomId, String user_id, String
isMute, BaseObserver<String> observer) {
sApiServer.setMutePit(roomId, user_id, isMute).enqueue(new Callback<BaseModel<String>>() {
@@ -3139,8 +3183,7 @@ public class RetrofitClient {
});
}
public void getPostData(String new_password, String mobile, String code, String
userId, BaseObserver<String> observer) {
public void getPostData(String new_password, String mobile, String code, String userId, BaseObserver<String> observer) {
sApiServer.getPostData(new_password, mobile, code, userId).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {

View File

@@ -45,6 +45,7 @@ public class MqttConnect {
// 这里是你自己需要订阅的主题
shutdown = "qx_room_topic"; // 关机
update_app = "qx_xunlehui"; // 发送更新APP
// qx_hour_ranking = "qx_hour_ranking";
qx_hour_ranking = "qx_hour_ranking";
ArrayList<String> topicList = new ArrayList<>();

View File

@@ -295,7 +295,7 @@ public class AvatarFrameView extends FrameLayout {
mainHandler.post(() -> {
renderType = RenderType.SVGA;
mType = item.type;
if (mBinding != null) {
if (mBinding != null && mBinding.playView != null) {
mBinding.playView.setVisibility(View.GONE);
}
loadSVGA(item.url);
@@ -831,7 +831,8 @@ public class AvatarFrameView extends FrameLayout {
svgaSurface2.clearAnimation();
svgaSurface.setImageDrawable(null);
}
if (mBinding.playView != null) {
// 增加空值检查
if (mBinding != null && mBinding.playView != null) {
mBinding.playView.stopPlay();
}
}
@@ -1082,7 +1083,7 @@ public class AvatarFrameView extends FrameLayout {
mBinding.playView.setVisibility(View.GONE);
// 停止播放器
if (mBinding.playView != null) {
if (mBinding != null && mBinding.playView != null) {
mBinding.playView.stopPlay();
}
} catch (Exception e) {

View File

@@ -374,6 +374,7 @@ public class Constants {
public static final String GET_THEME_DATA = "/api/Theme/get_theme_data";//主题接口
public static final String START_FRIEND = "/api/Friend/start_friend";//点击开始按钮 交友房
public static final String DELAY = "/api/Friend/delay";//点击延时 交友房
public static final String POST_KEEP_XINTIAO = "/api/Xintiao/keep_xintiao";//心跳
public static final String END_FRIEND = "/api/Friend/end_friend";//点击结束 交友房
public static final String CREATE_RELATION = "/api/Friend/create_relation";//卡关系 (创建关系) 交友房
public static final String GET_BOX_GIFT_LIST = "/api/BlindBoxTurntable/get_gift_list";//获取活动礼物列表

View File

@@ -10,15 +10,14 @@ import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewAnimationUtils;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import com.blankj.utilcode.util.ScreenUtils;
import com.xscm.moduleutil.utils.BarUtils;
import static android.opengl.ETC1.getHeight;
import static androidx.core.view.ViewCompat.setTranslationX;
import static androidx.core.view.ViewCompat.setTranslationY;
import static com.xscm.moduleutil.base.CommonAppContext.post;
import static com.xscm.moduleutil.utils.SystemUtils.getWidth;
/**
* 描述:小时榜的显示视图
*/
public class DropHourlView extends LinearLayout {
private int rightMargin = 0;
@@ -62,8 +61,24 @@ public class DropHourlView extends LinearLayout {
setTranslationY(y);
}
});
}
updateSize();
mStatusBarHeight = BarUtils.getStatusBarHeight();
}
/**
* 更新屏幕尺寸信息
*/
protected void updateSize() {
ViewGroup viewGroup = (ViewGroup) getParent();
if (viewGroup != null) {
mScreenWidth = viewGroup.getWidth();
mScreenHeight = viewGroup.getHeight();
} else {
// 如果父视图为空,使用屏幕的实际宽度和高度
mScreenWidth = getResources().getDisplayMetrics().widthPixels;
mScreenHeight = getResources().getDisplayMetrics().heightPixels;
}
}
boolean starDrap = false;
float X1;
@@ -115,25 +130,76 @@ public class DropHourlView extends LinearLayout {
return false;
}
}
private float mOriginalRawX;
private float mOriginalRawY;
private float mOriginalX;
private float mOriginalY;
protected int mScreenWidth;
private int mScreenHeight;
private int mStatusBarHeight;
private void updateViewPosition(MotionEvent event) {
// 计算新的Y位置
float desY = mOriginalY + event.getRawY() - mOriginalRawY;
// 限制Y位置不超出屏幕边界
if (desY < mStatusBarHeight) {
desY = mStatusBarHeight;
}
if (desY > mScreenHeight - getHeight()) {
desY = mScreenHeight - getHeight();
}
// 计算新的X位置
float desX = mOriginalX + event.getRawX() - mOriginalRawX;
// 限制X位置不超出屏幕边界
if (desX < 0) {
desX = 0;
}
if (desX > mScreenWidth - getWidth()) {
desX = mScreenWidth - getWidth();
}
// 设置视图的新位置
setX(desX);
setY(desY);
}
private void changeOriginalTouchParams(MotionEvent event) {
mOriginalX = getX();//getX()相对于控件X坐标的距离
mOriginalY = getY();
mOriginalRawX = event.getRawX();//getRawX()指控件在屏幕上的X坐标
mOriginalRawY = event.getRawY();
}
@Override
public boolean onTouchEvent(MotionEvent event) {
if (event == null) {
return false;
}
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
changeOriginalTouchParams(event);
updateSize(); // 添加这行确保尺寸是最新的
// ... 其他现有代码 ...
break;
case MotionEvent.ACTION_MOVE:
updateViewPosition(event); // 使用更新后的带边界检查的方法
// setBackgroundResource(R.drawable.bg_home_drop_view);
// 使用屏幕绝对坐标计算新位置
float newX = originalX + (event.getRawX() - X1);
float newY = originalY + (event.getRawY() - Y1);
// 限制X和Y坐标在屏幕范围内
newX = Math.max(0, Math.min(newX, screenWidth - getWidth()));
newY = Math.max(0, Math.min(newY, screenHeight - getHeight()));
setTranslationX(newX);
setTranslationY(newY);
X2 = event.getRawX();
// float newX = originalX + (event.getRawX() - X1);
// float newY = originalY + (event.getRawY() - Y1);
//
// // 限制X和Y坐标在屏幕范围内
// newX = Math.max(0, Math.min(newX, screenWidth - getWidth()));
// newY = Math.max(0, Math.min(newY, screenHeight - getHeight()));
//
// setTranslationX(newX);
// setTranslationY(newY);
// X2 = event.getRawX();
break;
case MotionEvent.ACTION_UP:
starDrap = false;

View File

@@ -163,8 +163,8 @@
<com.xscm.moduleutil.view.QXMeetGiftView
android:id="@+id/gv_sdlw"
android:layout_width="@dimen/dp_94"
android:layout_height="@dimen/dp_108"
android:layout_marginTop="14dp"
android:layout_height="@dimen/dp_90"
android:layout_marginTop="19dp"
app:layout_constraintTop_toTopOf="@+id/gv_xyz"
app:layout_constraintStart_toStartOf="@+id/gv_fzlw"
android:layout_marginStart="-11dp"

View File

@@ -380,6 +380,7 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
mBinding.ll.setVisibility(View.INVISIBLE);
CommonAppContext.getInstance().isShow = false;
CommonAppContext.getInstance().isPlaying = false;
CommonAppContext.getInstance().isRoomJoininj=false;
EventBus.getDefault().post(new RoomOutEvent());
} else if (id == R.id.riv) {
String roomId = CommonAppContext.getInstance().playId;

View File

@@ -2883,6 +2883,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
// 执行退出房间逻辑
CommonAppContext.getInstance().isPlaying = false
CommonAppContext.getInstance().isShow = false
CommonAppContext.getInstance().playId = null
QXGiftPlayerManager.getInstance(this).destroyEffectSvga()
// 停止屏幕捕获和其他资源
// AgoraManager.getInstance(this).stopScreenCapture();
@@ -3733,9 +3734,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
override fun onResume() {
super.onResume()
LogUtils.e("RoomActivity", "onResume")
CommonAppContext.getInstance().isShow = true
CommonAppContext.getInstance().isPlaying = true

View File

@@ -5,6 +5,7 @@ import android.content.Intent
import android.os.IBinder
import android.util.Log
import com.tencent.imsdk.v2.V2TIMManager
import com.xscm.moduleutil.http.RetrofitClient
import java.util.*
//前台服务
@@ -20,8 +21,9 @@ class ForegroundService : Service() {
timer?.schedule(object : TimerTask() {
override fun run() {
Log.d("ForegroundService", "Timer task ${logInt++}")
RetrofitClient.getInstance().keepXintiao();
}
}, 0L, 300L)
}, 0L, 10000L)
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {

View File

@@ -14,6 +14,7 @@ import com.example.modulevoice.contacts.HotListContacts;
import com.example.modulevoice.databinding.FragmentHotListBinding;
import com.example.modulevoice.presenter.HotListPresenter;
import com.xscm.moduleutil.base.BaseMvpFragment;
import com.xscm.moduleutil.base.CommonAppContext;
import com.xscm.moduleutil.base.RoomManager;
import com.xscm.moduleutil.bean.HomeBean;
import com.xscm.moduleutil.bean.TopRoom;
@@ -179,6 +180,7 @@ public class HotListFragment extends BaseMvpFragment<HotListPresenter, FragmentH
public void finishRefreshLoadMore() {
mBinding.smartRefreshLayout.finishRefresh();
mBinding.smartRefreshLayout.finishLoadMore();
CommonAppContext.getInstance().isRoomJoininj=false;
}
@Override

View File

@@ -22,6 +22,7 @@ import android.widget.ImageView;
import android.widget.TextView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.util.ToastUtils;
import com.example.modulevoice.R;
import com.example.modulevoice.adapter.CarouselBannerAdapter;
import com.example.modulevoice.contacts.VoiceCategoryContacts;
@@ -31,6 +32,7 @@ import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;
import com.xscm.moduleutil.activity.WebViewActivity;
import com.xscm.moduleutil.base.BaseMvpFragment;
import com.xscm.moduleutil.base.CommonAppContext;
import com.xscm.moduleutil.base.RoomManager;
import com.xscm.moduleutil.bean.BannerModel;
import com.xscm.moduleutil.bean.RoomTypeModel;
@@ -283,6 +285,12 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
public void setCategories(List<RoomTypeModel> list) {
// // 数据有效性检查
if (list == null || list.isEmpty() || getActivity() == null) {
try {
ToastUtils.showLong("登录已过期,请重新登录");
CommonAppContext.getInstance().clearLoginInfo();
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
return;
}

View File

@@ -260,7 +260,7 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
userInd userInfo = getUserInfo();
if (userInfo != null) {
if (userInfo.getIs_can_chat() == 0) {
if (userInfo.getIs_can_chat() == 0 && userInfo.getCan_chat_money() > 0) {
Toast.makeText(getContext(), "充值不足"+userInfo.getCan_chat_money()+"元,您无法发送消息", Toast.LENGTH_LONG).show();
ARouter.getInstance().build("/modulevocal/RechargeActivity").navigation();
return false;