fix bugs.
This commit is contained in:
@@ -274,9 +274,11 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
|
||||
}
|
||||
|
||||
if (item.getRoom_id() != null && !item.getRoom_id().equals("0")) {
|
||||
helper.setText(R.id.gensui, "跟随");
|
||||
helper.setText(R.id.gensui, "");
|
||||
helper.getView(R.id.gensui).setBackgroundResource(com.xscm.moduleutil.R.mipmap.gsui);
|
||||
} else if (item.getRoom_id() == null || item.getRoom_id().equals("0")) {
|
||||
helper.setText(R.id.gensui, "私信");
|
||||
helper.setText(R.id.gensui, "");
|
||||
helper.getView(R.id.gensui).setBackgroundResource(com.xscm.moduleutil.R.mipmap.six);
|
||||
}
|
||||
//分享数
|
||||
// helper.setText(R.id.dy_zs, item.getRewards_num() != null ? item.getRewards_num() : "0");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.xscm.moduleutil.dialog;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
@@ -36,6 +37,7 @@ public class ConfirmDialog extends Dialog {
|
||||
private int countdownSeconds = 0; // 倒计时秒数
|
||||
private CountDownTimer countDownTimer; // 倒计时对象
|
||||
|
||||
private Context context;
|
||||
|
||||
public ConfirmDialog(Context context, String title, String message,
|
||||
String positiveButtonText, String negativeButtonText,
|
||||
@@ -43,6 +45,7 @@ public class ConfirmDialog extends Dialog {
|
||||
View.OnClickListener negativeButtonClickListener,
|
||||
boolean isCountdownEnabled, int countdownSeconds) {
|
||||
super(context);
|
||||
this.context = context;
|
||||
this.title = title;
|
||||
this.message = message;
|
||||
this.positiveButtonText = positiveButtonText;
|
||||
@@ -60,6 +63,7 @@ public class ConfirmDialog extends Dialog {
|
||||
View.OnClickListener negativeButtonClickListener,
|
||||
boolean isCountdownEnabled, int countdownSeconds) {
|
||||
super(context);
|
||||
this.context = context;
|
||||
this.title = title;
|
||||
this.spannableMessage = spannableMessage;
|
||||
this.positiveButtonText = positiveButtonText;
|
||||
@@ -178,6 +182,12 @@ public class ConfirmDialog extends Dialog {
|
||||
countDownTimer.cancel(); // 取消倒计时
|
||||
countDownTimer = null;
|
||||
}
|
||||
if (context instanceof Activity) {
|
||||
Activity activity = (Activity) context;
|
||||
if (activity.isFinishing() || activity.isDestroyed()) {
|
||||
return; // Don't try to dismiss if activity is gone
|
||||
}
|
||||
}
|
||||
super.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,6 @@ public class DailyTasksActivity extends BaseMvpActivity<DailyTasksPresenter, Act
|
||||
super.onPause();
|
||||
Observable.timer(5, TimeUnit.MILLISECONDS).observeOn(AndroidSchedulers.mainThread()).subscribe(aLong -> {
|
||||
mBinding.coolWaitView.setVisibility(View.GONE);
|
||||
|
||||
if (!isFinishing()){
|
||||
finish();
|
||||
}
|
||||
@@ -267,7 +266,6 @@ public class DailyTasksActivity extends BaseMvpActivity<DailyTasksPresenter, Act
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
((RoomActivity) ActivityUtils.getActivityList().get(ActivityUtils.getActivityList().size() - 2)).refreshRoomInfo(roomId);
|
||||
finish();
|
||||
return;
|
||||
|
||||
@@ -9,11 +9,16 @@ import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.http.RetrofitClient;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class DailyTasksPresenter extends BasePresenter<DailyTasksConacts.View> implements DailyTasksConacts.IMePre{
|
||||
|
||||
DailyTasksConacts.View mView;
|
||||
public DailyTasksPresenter(DailyTasksConacts.View view, Context context) {
|
||||
super(view, context);
|
||||
mView = view;
|
||||
}
|
||||
//获取礼盒列表
|
||||
@Override
|
||||
@@ -27,6 +32,9 @@ public class DailyTasksPresenter extends BasePresenter<DailyTasksConacts.View> i
|
||||
|
||||
@Override
|
||||
public void onNext(GiftBoxBean giftBoxBean) {
|
||||
if (MvpRef == null){
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().setGiftBox(giftBoxBean);
|
||||
}
|
||||
});
|
||||
@@ -42,6 +50,9 @@ public class DailyTasksPresenter extends BasePresenter<DailyTasksConacts.View> i
|
||||
|
||||
@Override
|
||||
public void onNext(GiftName giftName) {
|
||||
if (MvpRef == null){
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().dailyTasksOpenBox(giftName);
|
||||
}
|
||||
});
|
||||
@@ -58,6 +69,9 @@ public class DailyTasksPresenter extends BasePresenter<DailyTasksConacts.View> i
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
if (MvpRef == null){
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().dailyTasksComplete();
|
||||
}
|
||||
});
|
||||
@@ -75,6 +89,9 @@ public class DailyTasksPresenter extends BasePresenter<DailyTasksConacts.View> i
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
if (MvpRef == null){
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().taskJumpRoom(item,s);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -54,7 +54,7 @@ public class TaskDataAdapter extends BaseQuickAdapter<GiftBoxBean.TaskDataBean.D
|
||||
|
||||
|
||||
|
||||
ImageUtils.loadHeadCC(item.getIcon(), helper.getView(R.id.task_pic));
|
||||
ImageUtils.loadCenterCrop(item.getIcon(), helper.getView(R.id.task_pic));
|
||||
helper.setText(R.id.task_name, item.getTask_name());
|
||||
helper.setText(R.id.task_jb_number, item.getReward_str());
|
||||
helper.getView(R.id.task_type).setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.xscm.modulemain.activity.main.activity.MainActivity;
|
||||
import com.xscm.modulemain.activity.room.activity.RoomActivity;
|
||||
import com.xscm.modulemain.activity.user.activity.DailyTasksActivity;
|
||||
import com.xscm.modulemain.activity.user.activity.MyRoomActivity;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
@@ -155,6 +156,10 @@ public class RoomManager {
|
||||
if (resp != null) {
|
||||
if (ActivityUtils.getTopActivity() instanceof MainActivity){
|
||||
((MainActivity) ActivityUtils.getTopActivity()).isShowLoading(false);
|
||||
}else if (ActivityUtils.getTopActivity() instanceof MyRoomActivity){
|
||||
((MyRoomActivity) ActivityUtils.getTopActivity()).isShowLoading(false);
|
||||
}else if (ActivityUtils.getTopActivity() instanceof DailyTasksActivity){
|
||||
((DailyTasksActivity) ActivityUtils.getTopActivity()).isShowLoading(false);
|
||||
}
|
||||
if (!resp.getRoom_id().isEmpty()){
|
||||
if(CommonAppContext.getInstance().playId==null){
|
||||
@@ -194,6 +199,8 @@ public class RoomManager {
|
||||
((MainActivity) ActivityUtils.getTopActivity()).isShowLoading(false);
|
||||
}else if (ActivityUtils.getTopActivity() instanceof MyRoomActivity){
|
||||
((MyRoomActivity) ActivityUtils.getTopActivity()).isShowLoading(false);
|
||||
} else if (ActivityUtils.getTopActivity() instanceof DailyTasksActivity){
|
||||
((DailyTasksActivity) ActivityUtils.getTopActivity()).isShowLoading(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user