fix[声望升级-同步弹窗功能]
This commit is contained in:
@@ -12,6 +12,7 @@ import android.app.NotificationChannel;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.ClipData;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
@@ -224,7 +225,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
SWAuManager.get().initRtcEngine(this);
|
||||
ActivityCompat.postponeEnterTransition(this);
|
||||
ConversationIMListManager.get(this);
|
||||
OpenAdManager.getInstance();
|
||||
//在请求一下这个接口给我后台版本号
|
||||
CommonHttpUtil.getConfig(mContext, new CommonCallback<ConfigBean>() {
|
||||
@Override
|
||||
@@ -363,6 +363,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
}
|
||||
break;
|
||||
}
|
||||
OpenAdManager.getInstance().show(OpenAdManager.TYPE_HOME, false);
|
||||
if (mTabButtonGroup.getCurPosition() != position) {
|
||||
System.err.println("重连IM:" + IMLoginManager.isLogin(mContext));
|
||||
if (!IMLoginManager.isLogin(mContext)) {
|
||||
@@ -845,7 +846,15 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
if (!APKManager.get().getApkVerNew()) {
|
||||
new XPopup.Builder(mContext).isDestroyOnDismiss(true).dismissOnBackPressed(false) // 按返回键是否关闭弹窗,默认为true
|
||||
.dismissOnTouchOutside(false) // 点击外部是否关闭弹窗,默认为true
|
||||
.asCustom(new APKUpdateCustomPopup(mContext, false)).show();
|
||||
.asCustom(
|
||||
new APKUpdateCustomPopup(mContext, false)
|
||||
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialogInterface) {
|
||||
requestBonus();
|
||||
}
|
||||
})
|
||||
).show();
|
||||
}
|
||||
} else {
|
||||
requestBonus();
|
||||
@@ -855,6 +864,10 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
});
|
||||
}
|
||||
|
||||
private void initAdOpenWindows() {
|
||||
OpenAdManager.getInstance().show(OpenAdManager.TYPE_HOME, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 填写邀请码
|
||||
*/
|
||||
@@ -885,14 +898,21 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
* 签到奖励
|
||||
*/
|
||||
SigninDialog fragment;
|
||||
boolean isRequestBonus = false;
|
||||
|
||||
private void requestBonus() {
|
||||
|
||||
fragment = new SigninDialog();
|
||||
MainHttpUtil.requestNewBonus(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
public void onError() {
|
||||
super.onError();
|
||||
isRequestBonus = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
isRequestBonus = true;
|
||||
if (info.length > 0) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
if (code == 0) {
|
||||
@@ -901,14 +921,24 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
bundle.putString("send_exp", obj.getString("send_exp"));
|
||||
bundle.putString("sign_day", obj.getString("sign_day"));
|
||||
fragment.setArguments(bundle);
|
||||
fragment.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialogInterface) {
|
||||
initAdOpenWindows();
|
||||
}
|
||||
});
|
||||
if (!getSupportFragmentManager().isStateSaved()) {
|
||||
fragment.show(getSupportFragmentManager(), "SigninDialog");
|
||||
}
|
||||
} else {
|
||||
initAdOpenWindows();
|
||||
}
|
||||
if (obj != null && obj.containsKey("msg_zdy_send") && obj.containsKey("msg_zdy_send_text")) {
|
||||
Log.e("MainActivity333", info[0]);
|
||||
NoviceInstructorManager.get(mContext).getNetNoviceInstructor(info[0]);
|
||||
}
|
||||
} else {
|
||||
initAdOpenWindows();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -942,6 +972,9 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
NoviceInstructorManager.get(mContext).getNoviceInstructor();
|
||||
NoviceInstructorManager.get(mContext).checktHomeZdyPop();
|
||||
initAnchorRecommendBanner();
|
||||
if (isRequestBonus) {
|
||||
initAdOpenWindows();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1140,7 +1173,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
if (EasyFloat.isShow("LiveFloatView")) {
|
||||
EasyFloat.dismiss("LiveFloatView", true);
|
||||
}
|
||||
OpenAdManager.getInstance().reset();
|
||||
OpenAdManager.getInstance().close();
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.yunbao.main.dialog;
|
||||
import static com.yunbao.common.utils.RouteUtil.PATH_REWARD;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
@@ -20,12 +21,18 @@ import com.yunbao.main.R;
|
||||
|
||||
public class SigninDialog extends AbsDialogFragment {
|
||||
TextView gold, sign_day;
|
||||
private DialogInterface.OnDismissListener onDismissListener;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.signin_dialog;
|
||||
}
|
||||
|
||||
public SigninDialog setOnDismissListener(DialogInterface.OnDismissListener onDismissListener) {
|
||||
this.onDismissListener = onDismissListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDialogStyle() {
|
||||
return R.style.dialog;
|
||||
@@ -58,7 +65,7 @@ public class SigninDialog extends AbsDialogFragment {
|
||||
goto_sign.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
ARouter.getInstance().build(PATH_REWARD).withString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index" + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : "0")).navigation();
|
||||
ARouter.getInstance().build(PATH_REWARD).withString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index" + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0")).navigation();
|
||||
dismiss();
|
||||
|
||||
}
|
||||
@@ -79,4 +86,12 @@ public class SigninDialog extends AbsDialogFragment {
|
||||
|
||||
sign_day.setText(String.format(getString(R.string.this_month), bundle.getString("sign_day")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
super.onDismiss(dialog);
|
||||
if (onDismissListener != null) {
|
||||
onDismissListener.onDismiss(dialog);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -567,7 +567,6 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
OpenAdManager.getInstance().show(OpenAdManager.TYPE_HOME, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user