调整注册后首次弹窗时间

This commit is contained in:
zlzw 2024-06-21 18:11:45 +08:00
parent de8d5d78ff
commit acf20107c1
4 changed files with 84 additions and 53 deletions

View File

@ -201,7 +201,7 @@ android {
}else{
server='测试服'
}
outputFileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${channel}-${server}-${variant.buildType.name}.apk"
outputFileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]潘多拉-${defaultConfig.versionName}-${channel}-${server}-${variant.buildType.name}.apk"
}
tasks.named("sign${variant.name.capitalize()}Bundle", com.android.build.gradle.internal.tasks.FinalizeBundleTask) {
File file = finalBundleFile.asFile.get()
@ -215,7 +215,7 @@ android {
} else {
channel = "链接"
}
File finalFile = new File(file.parentFile, "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${channel}-${variant.buildType.name}.aab")
File finalFile = new File(file.parentFile, "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]潘多拉-${defaultConfig.versionName}-${channel}-${variant.buildType.name}.aab")
finalBundleFile.set(finalFile)
}
project.afterEvaluate { project ->

View File

@ -416,7 +416,7 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
-ignorewarnings
# End of content from C:\Users\58381\Documents\AndroidProject\pandorapan\app\proguard-rules.pro
# The proguard configuration file for the following section is C:\Users\58381\Documents\AndroidProject\pandorapan\app\build\intermediates\aapt_proguard_file\google_onlineRelease\processGoogle_onlineReleaseResources\aapt_rules.txt
# The proguard configuration file for the following section is C:\Users\58381\Documents\AndroidProject\pandorapan\app\build\intermediates\aapt_proguard_file\link_testRelease\processLink_testReleaseResources\aapt_rules.txt
-keep class androidx.core.app.CoreComponentFactory { <init>(); }
-keep class androidx.core.content.FileProvider { <init>(); }
-keep class androidx.core.content.FileProvider4Utils { <init>(); }
@ -1090,10 +1090,10 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
-keepclassmembers class * { *** videoEditClick(android.view.View); }
# End of content from C:\Users\58381\Documents\AndroidProject\pandorapan\app\build\intermediates\aapt_proguard_file\google_onlineRelease\processGoogle_onlineReleaseResources\aapt_rules.txt
# The proguard configuration file for the following section is C:\Users\58381\Documents\AndroidProject\pandorapan\lib_faceunity\build\intermediates\consumer_proguard_dir\google_onlineRelease\exportGoogle_onlineReleaseConsumerProguardFiles\lib0\proguard.txt
# End of content from C:\Users\58381\Documents\AndroidProject\pandorapan\app\build\intermediates\aapt_proguard_file\link_testRelease\processLink_testReleaseResources\aapt_rules.txt
# The proguard configuration file for the following section is C:\Users\58381\Documents\AndroidProject\pandorapan\lib_faceunity\build\intermediates\consumer_proguard_dir\link_testRelease\exportLink_testReleaseConsumerProguardFiles\lib0\proguard.txt
# End of content from C:\Users\58381\Documents\AndroidProject\pandorapan\lib_faceunity\build\intermediates\consumer_proguard_dir\google_onlineRelease\exportGoogle_onlineReleaseConsumerProguardFiles\lib0\proguard.txt
# End of content from C:\Users\58381\Documents\AndroidProject\pandorapan\lib_faceunity\build\intermediates\consumer_proguard_dir\link_testRelease\exportLink_testReleaseConsumerProguardFiles\lib0\proguard.txt
# The proguard configuration file for the following section is C:\gradle-6.1.1\caches\transforms-3\8d3e3177c15403546de73d87508067d6\transformed\jetified-XPopup-2.10.0\proguard.txt
# Generated keep rule for Lifecycle observer adapter.
-if class com.lxj.xpopup.core.BasePopupView {
@ -1153,9 +1153,9 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
# End of content from C:\gradle-6.1.1\caches\transforms-3\a1df9a6aa192455030f7c9970b70e0e9\transformed\material-1.4.0\proguard.txt
# The proguard configuration file for the following section is C:\Users\58381\Documents\AndroidProject\pandorapan\lib_google\build\intermediates\consumer_proguard_dir\google_onlineRelease\exportGoogle_onlineReleaseConsumerProguardFiles\lib0\proguard.txt
# The proguard configuration file for the following section is C:\Users\58381\Documents\AndroidProject\pandorapan\lib_google\build\intermediates\consumer_proguard_dir\link_testRelease\exportLink_testReleaseConsumerProguardFiles\lib0\proguard.txt
# End of content from C:\Users\58381\Documents\AndroidProject\pandorapan\lib_google\build\intermediates\consumer_proguard_dir\google_onlineRelease\exportGoogle_onlineReleaseConsumerProguardFiles\lib0\proguard.txt
# End of content from C:\Users\58381\Documents\AndroidProject\pandorapan\lib_google\build\intermediates\consumer_proguard_dir\link_testRelease\exportLink_testReleaseConsumerProguardFiles\lib0\proguard.txt
# The proguard configuration file for the following section is C:\gradle-6.1.1\caches\transforms-3\2929985d9627ba3bb45a0ebd18eaf9d3\transformed\jetified-linesdk-5.0.1\proguard.txt
-keepattributes *Annotation*

View File

@ -12,6 +12,16 @@ public class MessageSayHiBean extends BaseModel{
@SerializedName("status")
private int status;
private int oldTime;
public int getOldTime() {
return oldTime;
}
public void setOldTime(int oldTime) {
this.oldTime = oldTime;
}
public MessageUserInfoBean getUser() {
return user;
}

View File

@ -58,6 +58,7 @@ public class MessageSayHiNotifyManager {
hiBean = new MessageSayHiBean();
hiBean.setModel("init");
hiBean.setNextTime(data.getNextTime());
hiBean.setOldTime(data.getNextTime());
Log.i(TAG, "onSuccess: 初始化定时器,第一轮时间:" + data.getNextTime());
}
@ -87,8 +88,10 @@ public class MessageSayHiNotifyManager {
timer.schedule(createTask(), data.getNextTime() * 1000L);
return;
}
data.setOldTime(hiBean.getNextTime());
hiBean = data;
showDialog(data);
Log.i(TAG, "onSuccess: 展示弹框时间:" + data);
showDialog();
}
@Override
@ -97,49 +100,7 @@ public class MessageSayHiNotifyManager {
}
void showDialog(MessageSayHiBean bean) {
if (isShowDialog) {
Log.i(TAG, "showDialog: 展示对话框中");
return;
}
if (isStopShow) {
Log.i(TAG, "showDialog: 非目标页面,停止展示");
lastActivity = null;
isRun = false;
return;
}
String simpleName = AppManager.getInstance().getLastActivity().getClass().getSimpleName();
if (simpleName.equals(lastActivity)) {
Log.i(TAG, "showDialog: 与上次触发是同一个页面,不展示");
isRun = false;
return;
}
isShowDialog = true;
Log.i(TAG, "showDialog: 打开本轮打招呼弹框 " + bean);
lastActivity = AppManager.getInstance().getLastActivity().getClass().getSimpleName();
new MessageSayHiNotifyDialog(AppManager.getInstance().getLastActivity(), bean.getUser()).setOnDismissListener((userId, position) ->
{
Log.i(TAG, "showDialog: 关闭打招呼弹窗,uid:" + userId + ",是否点击打招呼:" + (position == 2));
isShowDialog = false;
LiveNetManager.get(AppManager.getInstance().getLastActivity())
.callBackMessageSayHiTimer(userId, position, new HttpCallback<List<BaseModel>>() {
@Override
public void onSuccess(List<BaseModel> data) {
}
@Override
public void onError(String error) {
}
});
Log.i(TAG, "onSuccess: 启动定时器,下一轮时间:" + bean.getNextTime() + "");
timer = new Timer();
timer.schedule(createTask(), bean.getNextTime() * 1000L);
}).setCancelable(isCancelDialog)
.showDialog();
}
});
}
@ -149,14 +110,19 @@ public class MessageSayHiNotifyManager {
return;
}
if (hiBean == null) return;
Log.i(TAG, "reload: 重载定时器当前Activity:" + AppManager.getInstance().getLastActivity());
Log.i(TAG, "reload: 重载定时器当前Activity:" + AppManager.getInstance().getLastActivity() + "|等待:" + hiBean.getNextTime());
isStopShow = false;
if (timer != null) {
timer.cancel();
}
timer = new Timer();
if (hiBean.getStatus() == -2) {
Log.i(TAG, "reload: -2的bean = " + hiBean);
timer.schedule(createTask(), hiBean.getOldTime() * 1000L);
} else {
timer.schedule(createTask(), hiBean.getNextTime() * 1000L);
}
}
public void resetActivity() {
lastActivity = null;
@ -169,6 +135,9 @@ public class MessageSayHiNotifyManager {
public void stop() {
Log.i(TAG, "stop: 停止定时器当前Activity:" + AppManager.getInstance().getLastActivity());
isStopShow = true;
if(hiBean!=null) {
hiBean.setStatus(-2);
}
if (timer != null) {
timer.cancel();
timer = null;
@ -184,6 +153,10 @@ public class MessageSayHiNotifyManager {
timer.cancel();
}
cancel();
if (hiBean.getStatus() == -2) {
showDialog();
return;
}
Log.i(TAG, "run: 定时器到点,启动下一轮");
next();
}
@ -220,6 +193,54 @@ public class MessageSayHiNotifyManager {
}
}
void showDialog() {
if (isShowDialog) {
Log.i(TAG, "showDialog: 展示对话框中");
hiBean.setStatus(-2);
return;
}
if (isStopShow) {
Log.i(TAG, "showDialog: 非目标页面,停止展示");
hiBean.setStatus(-2);
lastActivity = null;
isRun = false;
return;
}
String simpleName = AppManager.getInstance().getLastActivity().getClass().getSimpleName();
if (simpleName.equals(lastActivity)) {
Log.i(TAG, "showDialog: 与上次触发是同一个页面,不展示");
isRun = false;
hiBean.setStatus(-2);
return;
}
isShowDialog = true;
Log.i(TAG, "showDialog: 打开本轮打招呼弹框 " + hiBean);
lastActivity = AppManager.getInstance().getLastActivity().getClass().getSimpleName();
new MessageSayHiNotifyDialog(AppManager.getInstance().getLastActivity(), hiBean.getUser()).setOnDismissListener((userId, position) ->
{
Log.i(TAG, "showDialog: 关闭打招呼弹窗,uid:" + userId + ",是否点击打招呼:" + (position == 2));
isShowDialog = false;
LiveNetManager.get(AppManager.getInstance().getLastActivity())
.callBackMessageSayHiTimer(userId, position, new HttpCallback<List<BaseModel>>() {
@Override
public void onSuccess(List<BaseModel> data) {
}
@Override
public void onError(String error) {
}
});
Log.i(TAG, "onSuccess: 启动定时器,下一轮时间:" + hiBean.getNextTime() + "");
hiBean.setStatus(1);
timer = new Timer();
timer.schedule(createTask(), hiBean.getNextTime() * 1000L);
}).setCancelable(isCancelDialog)
.showDialog();
}
public synchronized void push(Context mContext, String targetId, String content) {
LiveNetManager.get(mContext)
.getOtherInfo(targetId, new HttpCallback<MessageUserInfoBean>() {