调整弹窗、签到弹窗、更新弹窗优先级

This commit is contained in:
zlzw 2024-05-30 15:33:19 +08:00
parent ab24348f72
commit 949c0ab759
8 changed files with 74 additions and 7 deletions

View File

@ -157,6 +157,9 @@
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="${isUploadLog}" />
<meta-data
android:name="BUILD_TIME"
android:value="${buildTime}" />
<meta-data
android:name="com.openinstall.APP_KEY"
android:value="smvslm" />

View File

@ -37,6 +37,7 @@ public class CommonAppConfig {
public static final boolean IS_UPLOAD_ERROR_LOG = getMetaDataBoolean("IS_UPLOAD_ERROR_LOG");
//是否为插件包模式
public static final boolean IS_PLUGIN_MODEL = getMetaDataBoolean("IS_PLUGIN_MODEL");
public static final String BUILD_TIME = getMetaDataString("BUILD_TIME");
//外部sd卡
public static final String DCMI_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath();

View File

@ -15,6 +15,7 @@ import com.lzf.easyfloat.EasyFloat;
import com.lzf.easyfloat.enums.ShowPattern;
import com.lzf.easyfloat.interfaces.OnPermissionResult;
import com.lzf.easyfloat.permission.PermissionUtils;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.adapter.DebugDialogAdapter;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.ToastUtil;
@ -138,7 +139,7 @@ public class DebugDialog {
EasyFloat.updateFloat("debug");
}
});
params.put("debug弹窗", textView);
params.put("发包时间:"+ CommonAppConfig.BUILD_TIME, textView);
adapter.setParamMap(params);
EasyFloat.with(mContext)

View File

@ -83,7 +83,6 @@ public class OpenAdManager {
LiveNetManager.get(context).activityPopup(new HttpCallback<List<OpenAdModel>>() {
@Override
public void onSuccess(List<OpenAdModel> data) {
data.clear();
if (data == null || data.isEmpty()) {
Log.i(TAG, "onSuccess: 没有数据");
list = new ArrayList<>();

View File

@ -2,6 +2,7 @@ package com.yunbao.common.views;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
@ -44,6 +45,7 @@ public class APKUpdateCustomPopup extends CenterPopupView {
private ProgressBar progressBar;
private Activity mContext;
private boolean mInside;
private DialogInterface.OnDismissListener onDismissListener;
public APKUpdateCustomPopup(@NonNull Activity context, boolean inside) {
super(context);
@ -57,6 +59,11 @@ public class APKUpdateCustomPopup extends CenterPopupView {
return R.layout.apk_update_custom_popup;
}
public APKUpdateCustomPopup setOnDismissListener(DialogInterface.OnDismissListener onDismissListener) {
this.onDismissListener = onDismissListener;
return this;
}
// 执行初始化操作比如findView设置点击或者任何你弹窗内的业务逻辑
@Override
protected void onCreate() {
@ -69,6 +76,14 @@ public class APKUpdateCustomPopup extends CenterPopupView {
}
@Override
protected void onDismiss() {
super.onDismiss();
if (onDismissListener != null) {
onDismissListener.onDismiss(null);
}
}
private void initView() {
if (!mInside) {
if (CommonAppConfig.IS_GOOGLE_PLAY == 0 && APKManager.get().getAPKGoogleIsUp() == 1) {

View File

@ -13,6 +13,8 @@ ext {
//
serverHost : "https://ceshi.yaoulive.com",
buildTime : new Date().format("MM-dd HH:mm", TimeZone.getTimeZone("GMT+8")),
//
baiduAppId : "23774720",

View File

@ -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;
@ -551,7 +552,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
//获取指导员账号
ConversationIMListManager.get(this).getUserInstructor(this);
checkVersion();
OpenAdManager.getInstance().show(OpenAdManager.TYPE_HOME, false);
}
/**
@ -848,7 +848,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();
@ -858,6 +866,10 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
});
}
private void initAdOpenWindows() {
OpenAdManager.getInstance().show(OpenAdManager.TYPE_HOME, false);
}
/**
* 填写邀请码
*/
@ -888,14 +900,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) {
@ -904,14 +923,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();
}
}
});
@ -945,7 +974,9 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
NoviceInstructorManager.get(mContext).getNoviceInstructor();
NoviceInstructorManager.get(mContext).checktHomeZdyPop();
initAnchorRecommendBanner();
OpenAdManager.getInstance().show(OpenAdManager.TYPE_HOME, false);
if (isRequestBonus) {
initAdOpenWindows();
}
}
/**

View File

@ -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);
}
}
}