1:修改小时榜
This commit is contained in:
@@ -101,7 +101,7 @@ android {
|
|||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled true
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ android {
|
|||||||
|
|
||||||
debug {
|
debug {
|
||||||
debuggable true
|
debuggable true
|
||||||
minifyEnabled true
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.debug
|
||||||
|
|
||||||
|
|||||||
@@ -85,10 +85,43 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 新增版本检查逻辑
|
||||||
|
checkAppVersion();
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
// EventBus.getDefault().register(this);
|
// EventBus.getDefault().register(this);
|
||||||
// AppLogUtil.reportAppLog(AppLogEvent.A0101);
|
// 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
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ isBuildModule=false
|
|||||||
#org.gradle.deamon=false
|
#org.gradle.deamon=false
|
||||||
android.injected.testOnly=false
|
android.injected.testOnly=false
|
||||||
|
|
||||||
APP_VERSION_NAME=1.2.1
|
APP_VERSION_NAME=1.2.6
|
||||||
APP_VERSION_CODE=173
|
APP_VERSION_CODE=178
|
||||||
|
|
||||||
org.gradle.jvm.toolchain.useLegacyAdapters=false
|
org.gradle.jvm.toolchain.useLegacyAdapters=false
|
||||||
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15
|
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import android.graphics.drawable.Drawable;
|
|||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.text.Spannable;
|
import android.text.Spannable;
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
@@ -111,6 +112,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
|||||||
}
|
}
|
||||||
|
|
||||||
QXGiftDriftView qxGiftDriftView;
|
QXGiftDriftView qxGiftDriftView;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -153,6 +155,10 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
|||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 启动定时器
|
||||||
|
// startTimer();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 在Activity中
|
// 在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() {
|
protected void loadNetworkBackground() {
|
||||||
// 只有当已经有背景URL时才加载
|
// 只有当已经有背景URL时才加载
|
||||||
@@ -434,7 +471,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
|||||||
processHourlyMessages();
|
processHourlyMessages();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
hourlyMessageQueue.clear();
|
hourlyMessageQueue.clear();
|
||||||
clearAllHourlyViews();
|
clearAllHourlyViews();
|
||||||
}
|
}
|
||||||
@@ -546,12 +583,14 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
|||||||
ivAvatar.setImageResource(R.mipmap.hourl_top3);
|
ivAvatar.setImageResource(R.mipmap.hourl_top3);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
tvName.setVisibility(View.GONE);
|
||||||
|
ivAvatar.setVisibility(View.GONE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置带颜色的文本
|
// 设置带颜色的文本
|
||||||
// 设置带颜色的文本
|
// 设置带颜色的文本
|
||||||
private void setColoredText(TextView textView, String prefix, String roomName, String suffix, int colorRes) {
|
private void setColoredText(TextView textView, String prefix, String roomName, String suffix, int colorRes) {
|
||||||
@@ -649,7 +688,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
|||||||
processNextMqttMessage();
|
processNextMqttMessage();
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
mqttMessageQueue.clear();
|
mqttMessageQueue.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -706,7 +745,6 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
|||||||
// QXGiftDriftView.getInstance( this).addGiftModel(mqttBean);
|
// QXGiftDriftView.getInstance( this).addGiftModel(mqttBean);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 清理之前的视图(如果存在)
|
// 清理之前的视图(如果存在)
|
||||||
if (currentMqttView != null && currentMqttView.getParent() != null) {
|
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) {
|
private void resetAndStartMqttAnimation(View view, Runnable onAnimationEnd) {
|
||||||
try {
|
try {
|
||||||
int screenWidth = getScreenWidth();
|
int screenWidth = getScreenWidth();
|
||||||
@@ -813,7 +852,8 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
|||||||
enterAnim.setDuration(1500);
|
enterAnim.setDuration(1500);
|
||||||
enterAnim.setAnimationListener(new Animation.AnimationListener() {
|
enterAnim.setAnimationListener(new Animation.AnimationListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationStart(Animation animation) {}
|
public void onAnimationStart(Animation animation) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animation animation) {
|
public void onAnimationEnd(Animation animation) {
|
||||||
@@ -828,7 +868,8 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
|||||||
exitAnim.setDuration(2000);
|
exitAnim.setDuration(2000);
|
||||||
exitAnim.setAnimationListener(new Animation.AnimationListener() {
|
exitAnim.setAnimationListener(new Animation.AnimationListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationStart(Animation animation) {}
|
public void onAnimationStart(Animation animation) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animation animation) {
|
public void onAnimationEnd(Animation animation) {
|
||||||
@@ -850,19 +891,20 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationRepeat(Animation animation) {}
|
public void onAnimationRepeat(Animation animation) {
|
||||||
|
}
|
||||||
});
|
});
|
||||||
view.startAnimation(exitAnim);
|
view.startAnimation(exitAnim);
|
||||||
}, 3000); // 停留1秒
|
}, 3000); // 停留1秒
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationRepeat(Animation animation) {}
|
public void onAnimationRepeat(Animation animation) {
|
||||||
|
}
|
||||||
});
|
});
|
||||||
view.startAnimation(enterAnim);
|
view.startAnimation(enterAnim);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ObjectAnimator animator1 = ObjectAnimator.ofFloat(view, "translationX", view.getWidth(), 0f);
|
// ObjectAnimator animator1 = ObjectAnimator.ofFloat(view, "translationX", view.getWidth(), 0f);
|
||||||
// animator1.setDuration(1500);
|
// animator1.setDuration(1500);
|
||||||
// animator1.setInterpolator(new DecelerateInterpolator(1f));
|
// animator1.setInterpolator(new DecelerateInterpolator(1f));
|
||||||
@@ -895,7 +937,8 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
|||||||
onAnimationEnd.run();
|
onAnimationEnd.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 添加获取屏幕宽度的方法
|
|
||||||
|
// 添加获取屏幕宽度的方法
|
||||||
private int getScreenWidth() {
|
private int getScreenWidth() {
|
||||||
DisplayMetrics displayMetrics = new DisplayMetrics();
|
DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||||
if (getWindowManager() != null) {
|
if (getWindowManager() != null) {
|
||||||
@@ -904,6 +947,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
|||||||
}
|
}
|
||||||
return getResources().getDisplayMetrics().widthPixels;
|
return getResources().getDisplayMetrics().widthPixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetAndStartXlhAnimation(View view, Runnable onAnimationEnd) {
|
private void resetAndStartXlhAnimation(View view, Runnable onAnimationEnd) {
|
||||||
try {
|
try {
|
||||||
view.setTranslationX(view.getWidth());
|
view.setTranslationX(view.getWidth());
|
||||||
@@ -993,7 +1037,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
|||||||
String id = event.getId().replace("g", "");
|
String id = event.getId().replace("g", "");
|
||||||
Intent intent = new Intent(this, WebViewActivity.class);
|
Intent intent = new Intent(this, WebViewActivity.class);
|
||||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/union/setGroup?id=" + SpUtil.getToken() + "&guildId=" + id);
|
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/union/setGroup?id=" + SpUtil.getToken() + "&guildId=" + id);
|
||||||
startActivity( intent);
|
startActivity(intent);
|
||||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/union/setGroup?id=" + SpUtil.getToken() + "&guildId=" + id).navigation();
|
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/union/setGroup?id=" + SpUtil.getToken() + "&guildId=" + id).navigation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.blankj.utilcode.util.LogUtils;
|
|||||||
import com.blankj.utilcode.util.ScreenUtils;
|
import com.blankj.utilcode.util.ScreenUtils;
|
||||||
import com.blankj.utilcode.util.ToastUtils;
|
import com.blankj.utilcode.util.ToastUtils;
|
||||||
import com.xscm.moduleutil.R;
|
import com.xscm.moduleutil.R;
|
||||||
|
import com.xscm.moduleutil.base.CommonAppContext;
|
||||||
import com.xscm.moduleutil.bean.AppUpdateModel;
|
import com.xscm.moduleutil.bean.AppUpdateModel;
|
||||||
import com.xscm.moduleutil.databinding.DialogAppUpdateBinding;
|
import com.xscm.moduleutil.databinding.DialogAppUpdateBinding;
|
||||||
import com.xscm.moduleutil.utils.DownloadListener;
|
import com.xscm.moduleutil.utils.DownloadListener;
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ public class RoomManager {
|
|||||||
exitRoom(CommonAppContext.getInstance().playId);
|
exitRoom(CommonAppContext.getInstance().playId);
|
||||||
CommonAppContext.getInstance().isShow = false;
|
CommonAppContext.getInstance().isShow = false;
|
||||||
CommonAppContext.getInstance().isPlaying = false;
|
CommonAppContext.getInstance().isPlaying = false;
|
||||||
|
CommonAppContext.getInstance().isRoomJoininj=false;
|
||||||
EventBus.getDefault().post(new RoomOutEvent());
|
EventBus.getDefault().post(new RoomOutEvent());
|
||||||
} else if (CommonAppContext.getInstance().lable_id.equals("6")) {
|
} else if (CommonAppContext.getInstance().lable_id.equals("6")) {
|
||||||
upInfo(context, roomId, password, true, null, true);
|
upInfo(context, roomId, password, true, null, true);
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.xscm.moduleutil.http;
|
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.Sha1Util;
|
||||||
import com.xscm.moduleutil.utils.SpUtil;
|
import com.xscm.moduleutil.utils.SpUtil;
|
||||||
|
|
||||||
@@ -34,13 +36,59 @@ public class AccessTokenInterceptor implements Interceptor {
|
|||||||
@Override
|
@Override
|
||||||
public Response intercept(Chain chain) throws IOException {
|
public Response intercept(Chain chain) throws IOException {
|
||||||
Request request = chain.request();
|
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;
|
long timestamp = System.currentTimeMillis() / 1000;
|
||||||
mHeaderMap.put("timestamp", String.valueOf(timestamp));
|
mHeaderMap.put("timestamp", String.valueOf(timestamp));
|
||||||
mHeaderMap.put("sign", Sha1Util.shaEncode(timestamp));
|
mHeaderMap.put("sign", Sha1Util.shaEncode(timestamp));
|
||||||
Request newRequest = request.newBuilder().headers(Headers.of(mHeaderMap)).build();
|
|
||||||
Response response = chain.proceed(newRequest);
|
Request newRequest = request.newBuilder()
|
||||||
return response;
|
.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("");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -571,6 +571,9 @@ public interface ApiServer {
|
|||||||
@POST(Constants.DELAY)
|
@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);
|
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
|
@FormUrlEncoded
|
||||||
@POST(Constants.DOWN_PIT)
|
@POST(Constants.DOWN_PIT)
|
||||||
Call<BaseModel<String>> downPit(@Field("room_id") String room_id, @Field("pit_number") String pit_number);
|
Call<BaseModel<String>> downPit(@Field("room_id") String room_id, @Field("pit_number") String pit_number);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class DefaultTransformer<T> implements ObservableTransformer<BaseModel<T>
|
|||||||
}else {
|
}else {
|
||||||
// 触发登出事件(EventBus)
|
// 触发登出事件(EventBus)
|
||||||
// com.blankj.utilcode.util.ToastUtils.showShort("提示当前账号已在别的地方登陆,如果不是本人操作请修改密码");
|
// com.blankj.utilcode.util.ToastUtils.showShort("提示当前账号已在别的地方登陆,如果不是本人操作请修改密码");
|
||||||
CommonAppContext.getInstance().clearLoginInfo();
|
// CommonAppContext.getInstance().clearLoginInfo();
|
||||||
}
|
}
|
||||||
throw new APIException(response.getCode(), response.getMsg());
|
throw new APIException(response.getCode(), response.getMsg());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1387,11 +1387,22 @@ public class RetrofitClient {
|
|||||||
public void onResponse(Call<BaseModel<List<BannerModel>>> call, Response<BaseModel<List<BannerModel>>> response) {
|
public void onResponse(Call<BaseModel<List<BannerModel>>> call, Response<BaseModel<List<BannerModel>>> response) {
|
||||||
if (response.code() == 200) {
|
if (response.code() == 200) {
|
||||||
BaseModel<List<BannerModel>> listBaseModel = response.body();
|
BaseModel<List<BannerModel>> listBaseModel = response.body();
|
||||||
|
if (listBaseModel.getCode()==1) {
|
||||||
if (listBaseModel != null) {
|
if (listBaseModel != null) {
|
||||||
observer.onNext(listBaseModel.getData());
|
observer.onNext(listBaseModel.getData());
|
||||||
} else {
|
} else {
|
||||||
observer.onNext(null);
|
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) {
|
public void onResponse(Call<BaseModel<List<TopRoom>>> call, Response<BaseModel<List<TopRoom>>> response) {
|
||||||
if (response.code() == 200) {
|
if (response.code() == 200) {
|
||||||
BaseModel<List<TopRoom>> listBaseModel = response.body();
|
BaseModel<List<TopRoom>> listBaseModel = response.body();
|
||||||
|
if (listBaseModel.getCode()==1) {
|
||||||
if (listBaseModel != null) {
|
if (listBaseModel != null) {
|
||||||
observer.onNext(listBaseModel.getData());
|
observer.onNext(listBaseModel.getData());
|
||||||
} else {
|
} else {
|
||||||
observer.onNext(null);
|
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();
|
BaseModel<List<RoomTypeModel>> listBaseModel = response.body();
|
||||||
if (listBaseModel.getCode() == 1) {
|
if (listBaseModel.getCode() == 1) {
|
||||||
observer.onNext(listBaseModel.getData());
|
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
|
public void setMutePit(String roomId, String user_id, String
|
||||||
isMute, BaseObserver<String> observer) {
|
isMute, BaseObserver<String> observer) {
|
||||||
sApiServer.setMutePit(roomId, user_id, isMute).enqueue(new Callback<BaseModel<String>>() {
|
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
|
public void getPostData(String new_password, String mobile, String code, String userId, BaseObserver<String> observer) {
|
||||||
userId, BaseObserver<String> observer) {
|
|
||||||
sApiServer.getPostData(new_password, mobile, code, userId).enqueue(new Callback<BaseModel<String>>() {
|
sApiServer.getPostData(new_password, mobile, code, userId).enqueue(new Callback<BaseModel<String>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ public class MqttConnect {
|
|||||||
// 这里是你自己需要订阅的主题
|
// 这里是你自己需要订阅的主题
|
||||||
shutdown = "qx_room_topic"; // 关机
|
shutdown = "qx_room_topic"; // 关机
|
||||||
update_app = "qx_xunlehui"; // 发送更新APP
|
update_app = "qx_xunlehui"; // 发送更新APP
|
||||||
|
// qx_hour_ranking = "qx_hour_ranking";
|
||||||
qx_hour_ranking = "qx_hour_ranking";
|
qx_hour_ranking = "qx_hour_ranking";
|
||||||
|
|
||||||
ArrayList<String> topicList = new ArrayList<>();
|
ArrayList<String> topicList = new ArrayList<>();
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ public class AvatarFrameView extends FrameLayout {
|
|||||||
mainHandler.post(() -> {
|
mainHandler.post(() -> {
|
||||||
renderType = RenderType.SVGA;
|
renderType = RenderType.SVGA;
|
||||||
mType = item.type;
|
mType = item.type;
|
||||||
if (mBinding != null) {
|
if (mBinding != null && mBinding.playView != null) {
|
||||||
mBinding.playView.setVisibility(View.GONE);
|
mBinding.playView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
loadSVGA(item.url);
|
loadSVGA(item.url);
|
||||||
@@ -831,7 +831,8 @@ public class AvatarFrameView extends FrameLayout {
|
|||||||
svgaSurface2.clearAnimation();
|
svgaSurface2.clearAnimation();
|
||||||
svgaSurface.setImageDrawable(null);
|
svgaSurface.setImageDrawable(null);
|
||||||
}
|
}
|
||||||
if (mBinding.playView != null) {
|
// 增加空值检查
|
||||||
|
if (mBinding != null && mBinding.playView != null) {
|
||||||
mBinding.playView.stopPlay();
|
mBinding.playView.stopPlay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1082,7 +1083,7 @@ public class AvatarFrameView extends FrameLayout {
|
|||||||
mBinding.playView.setVisibility(View.GONE);
|
mBinding.playView.setVisibility(View.GONE);
|
||||||
|
|
||||||
// 停止播放器
|
// 停止播放器
|
||||||
if (mBinding.playView != null) {
|
if (mBinding != null && mBinding.playView != null) {
|
||||||
mBinding.playView.stopPlay();
|
mBinding.playView.stopPlay();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -374,6 +374,7 @@ public class Constants {
|
|||||||
public static final String GET_THEME_DATA = "/api/Theme/get_theme_data";//主题接口
|
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 START_FRIEND = "/api/Friend/start_friend";//点击开始按钮 交友房
|
||||||
public static final String DELAY = "/api/Friend/delay";//点击延时 交友房
|
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 END_FRIEND = "/api/Friend/end_friend";//点击结束 交友房
|
||||||
public static final String CREATE_RELATION = "/api/Friend/create_relation";//卡关系 (创建关系) 交友房
|
public static final String CREATE_RELATION = "/api/Friend/create_relation";//卡关系 (创建关系) 交友房
|
||||||
public static final String GET_BOX_GIFT_LIST = "/api/BlindBoxTurntable/get_gift_list";//获取活动礼物列表
|
public static final String GET_BOX_GIFT_LIST = "/api/BlindBoxTurntable/get_gift_list";//获取活动礼物列表
|
||||||
|
|||||||
@@ -10,15 +10,14 @@ import android.util.Log;
|
|||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewAnimationUtils;
|
import android.view.ViewAnimationUtils;
|
||||||
|
import android.view.ViewGroup;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import com.blankj.utilcode.util.ScreenUtils;
|
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 {
|
public class DropHourlView extends LinearLayout {
|
||||||
|
|
||||||
private int rightMargin = 0;
|
private int rightMargin = 0;
|
||||||
@@ -62,8 +61,24 @@ public class DropHourlView extends LinearLayout {
|
|||||||
setTranslationY(y);
|
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;
|
boolean starDrap = false;
|
||||||
float X1;
|
float X1;
|
||||||
@@ -115,25 +130,76 @@ public class DropHourlView extends LinearLayout {
|
|||||||
return false;
|
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
|
@Override
|
||||||
public boolean onTouchEvent(MotionEvent event) {
|
public boolean onTouchEvent(MotionEvent event) {
|
||||||
|
if (event == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
switch (event.getAction()) {
|
switch (event.getAction()) {
|
||||||
|
case MotionEvent.ACTION_DOWN:
|
||||||
|
changeOriginalTouchParams(event);
|
||||||
|
updateSize(); // 添加这行确保尺寸是最新的
|
||||||
|
// ... 其他现有代码 ...
|
||||||
|
|
||||||
|
break;
|
||||||
case MotionEvent.ACTION_MOVE:
|
case MotionEvent.ACTION_MOVE:
|
||||||
|
|
||||||
|
updateViewPosition(event); // 使用更新后的带边界检查的方法
|
||||||
|
|
||||||
// setBackgroundResource(R.drawable.bg_home_drop_view);
|
// setBackgroundResource(R.drawable.bg_home_drop_view);
|
||||||
// 使用屏幕绝对坐标计算新位置
|
// 使用屏幕绝对坐标计算新位置
|
||||||
float newX = originalX + (event.getRawX() - X1);
|
// float newX = originalX + (event.getRawX() - X1);
|
||||||
float newY = originalY + (event.getRawY() - Y1);
|
// float newY = originalY + (event.getRawY() - Y1);
|
||||||
|
//
|
||||||
// 限制X和Y坐标在屏幕范围内
|
// // 限制X和Y坐标在屏幕范围内
|
||||||
newX = Math.max(0, Math.min(newX, screenWidth - getWidth()));
|
// newX = Math.max(0, Math.min(newX, screenWidth - getWidth()));
|
||||||
newY = Math.max(0, Math.min(newY, screenHeight - getHeight()));
|
// newY = Math.max(0, Math.min(newY, screenHeight - getHeight()));
|
||||||
|
//
|
||||||
setTranslationX(newX);
|
// setTranslationX(newX);
|
||||||
setTranslationY(newY);
|
// setTranslationY(newY);
|
||||||
X2 = event.getRawX();
|
// X2 = event.getRawX();
|
||||||
break;
|
break;
|
||||||
case MotionEvent.ACTION_UP:
|
case MotionEvent.ACTION_UP:
|
||||||
starDrap = false;
|
starDrap = false;
|
||||||
|
|||||||
@@ -163,8 +163,8 @@
|
|||||||
<com.xscm.moduleutil.view.QXMeetGiftView
|
<com.xscm.moduleutil.view.QXMeetGiftView
|
||||||
android:id="@+id/gv_sdlw"
|
android:id="@+id/gv_sdlw"
|
||||||
android:layout_width="@dimen/dp_94"
|
android:layout_width="@dimen/dp_94"
|
||||||
android:layout_height="@dimen/dp_108"
|
android:layout_height="@dimen/dp_90"
|
||||||
android:layout_marginTop="14dp"
|
android:layout_marginTop="19dp"
|
||||||
app:layout_constraintTop_toTopOf="@+id/gv_xyz"
|
app:layout_constraintTop_toTopOf="@+id/gv_xyz"
|
||||||
app:layout_constraintStart_toStartOf="@+id/gv_fzlw"
|
app:layout_constraintStart_toStartOf="@+id/gv_fzlw"
|
||||||
android:layout_marginStart="-11dp"
|
android:layout_marginStart="-11dp"
|
||||||
|
|||||||
@@ -380,6 +380,7 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
|||||||
mBinding.ll.setVisibility(View.INVISIBLE);
|
mBinding.ll.setVisibility(View.INVISIBLE);
|
||||||
CommonAppContext.getInstance().isShow = false;
|
CommonAppContext.getInstance().isShow = false;
|
||||||
CommonAppContext.getInstance().isPlaying = false;
|
CommonAppContext.getInstance().isPlaying = false;
|
||||||
|
CommonAppContext.getInstance().isRoomJoininj=false;
|
||||||
EventBus.getDefault().post(new RoomOutEvent());
|
EventBus.getDefault().post(new RoomOutEvent());
|
||||||
} else if (id == R.id.riv) {
|
} else if (id == R.id.riv) {
|
||||||
String roomId = CommonAppContext.getInstance().playId;
|
String roomId = CommonAppContext.getInstance().playId;
|
||||||
|
|||||||
@@ -2883,6 +2883,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
// 执行退出房间逻辑
|
// 执行退出房间逻辑
|
||||||
CommonAppContext.getInstance().isPlaying = false
|
CommonAppContext.getInstance().isPlaying = false
|
||||||
CommonAppContext.getInstance().isShow = false
|
CommonAppContext.getInstance().isShow = false
|
||||||
|
CommonAppContext.getInstance().playId = null
|
||||||
QXGiftPlayerManager.getInstance(this).destroyEffectSvga()
|
QXGiftPlayerManager.getInstance(this).destroyEffectSvga()
|
||||||
// 停止屏幕捕获和其他资源
|
// 停止屏幕捕获和其他资源
|
||||||
// AgoraManager.getInstance(this).stopScreenCapture();
|
// AgoraManager.getInstance(this).stopScreenCapture();
|
||||||
@@ -3733,9 +3734,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LogUtils.e("RoomActivity", "onResume")
|
LogUtils.e("RoomActivity", "onResume")
|
||||||
CommonAppContext.getInstance().isShow = true
|
CommonAppContext.getInstance().isShow = true
|
||||||
CommonAppContext.getInstance().isPlaying = true
|
CommonAppContext.getInstance().isPlaying = true
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import android.content.Intent
|
|||||||
import android.os.IBinder
|
import android.os.IBinder
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import com.tencent.imsdk.v2.V2TIMManager
|
import com.tencent.imsdk.v2.V2TIMManager
|
||||||
|
import com.xscm.moduleutil.http.RetrofitClient
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
//前台服务
|
//前台服务
|
||||||
@@ -20,8 +21,9 @@ class ForegroundService : Service() {
|
|||||||
timer?.schedule(object : TimerTask() {
|
timer?.schedule(object : TimerTask() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
Log.d("ForegroundService", "Timer task ${logInt++}")
|
Log.d("ForegroundService", "Timer task ${logInt++}")
|
||||||
|
RetrofitClient.getInstance().keepXintiao();
|
||||||
}
|
}
|
||||||
}, 0L, 300L)
|
}, 0L, 10000L)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.example.modulevoice.contacts.HotListContacts;
|
|||||||
import com.example.modulevoice.databinding.FragmentHotListBinding;
|
import com.example.modulevoice.databinding.FragmentHotListBinding;
|
||||||
import com.example.modulevoice.presenter.HotListPresenter;
|
import com.example.modulevoice.presenter.HotListPresenter;
|
||||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||||
|
import com.xscm.moduleutil.base.CommonAppContext;
|
||||||
import com.xscm.moduleutil.base.RoomManager;
|
import com.xscm.moduleutil.base.RoomManager;
|
||||||
import com.xscm.moduleutil.bean.HomeBean;
|
import com.xscm.moduleutil.bean.HomeBean;
|
||||||
import com.xscm.moduleutil.bean.TopRoom;
|
import com.xscm.moduleutil.bean.TopRoom;
|
||||||
@@ -179,6 +180,7 @@ public class HotListFragment extends BaseMvpFragment<HotListPresenter, FragmentH
|
|||||||
public void finishRefreshLoadMore() {
|
public void finishRefreshLoadMore() {
|
||||||
mBinding.smartRefreshLayout.finishRefresh();
|
mBinding.smartRefreshLayout.finishRefresh();
|
||||||
mBinding.smartRefreshLayout.finishLoadMore();
|
mBinding.smartRefreshLayout.finishLoadMore();
|
||||||
|
CommonAppContext.getInstance().isRoomJoininj=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import android.widget.ImageView;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.launcher.ARouter;
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
|
import com.blankj.utilcode.util.ToastUtils;
|
||||||
import com.example.modulevoice.R;
|
import com.example.modulevoice.R;
|
||||||
import com.example.modulevoice.adapter.CarouselBannerAdapter;
|
import com.example.modulevoice.adapter.CarouselBannerAdapter;
|
||||||
import com.example.modulevoice.contacts.VoiceCategoryContacts;
|
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.google.android.material.tabs.TabLayoutMediator;
|
||||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||||
|
import com.xscm.moduleutil.base.CommonAppContext;
|
||||||
import com.xscm.moduleutil.base.RoomManager;
|
import com.xscm.moduleutil.base.RoomManager;
|
||||||
import com.xscm.moduleutil.bean.BannerModel;
|
import com.xscm.moduleutil.bean.BannerModel;
|
||||||
import com.xscm.moduleutil.bean.RoomTypeModel;
|
import com.xscm.moduleutil.bean.RoomTypeModel;
|
||||||
@@ -283,6 +285,12 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
|||||||
public void setCategories(List<RoomTypeModel> list) {
|
public void setCategories(List<RoomTypeModel> list) {
|
||||||
// // 数据有效性检查
|
// // 数据有效性检查
|
||||||
if (list == null || list.isEmpty() || getActivity() == null) {
|
if (list == null || list.isEmpty() || getActivity() == null) {
|
||||||
|
try {
|
||||||
|
ToastUtils.showLong("登录已过期,请重新登录");
|
||||||
|
CommonAppContext.getInstance().clearLoginInfo();
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
|
|||||||
userInd userInfo = getUserInfo();
|
userInd userInfo = getUserInfo();
|
||||||
|
|
||||||
if (userInfo != null) {
|
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();
|
Toast.makeText(getContext(), "充值不足"+userInfo.getCan_chat_money()+"元,您无法发送消息", Toast.LENGTH_LONG).show();
|
||||||
ARouter.getInstance().build("/modulevocal/RechargeActivity").navigation();
|
ARouter.getInstance().build("/modulevocal/RechargeActivity").navigation();
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user