Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
Out
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xjl
Out
Commits
87746f93
Commit
87746f93
authored
Dec 04, 2023
by
xujialang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
# Conflicts: # app/src/main/java/com/zl/sdk/OutHelp.java
parents
36512f68
48d25eab
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
54 deletions
+45
-54
build.gradle
app/build.gradle
+1
-0
OutHelp.java
app/src/main/java/com/zl/sdk/OutHelp.java
+11
-5
AdDataManager.java
app/src/main/java/com/zl/sdk/ad/AdDataManager.java
+22
-20
IconAdConfig.java
app/src/main/java/com/zl/sdk/bean/IconAdConfig.java
+0
-3
IconOpt.java
app/src/main/java/com/zl/sdk/bean/IconOpt.java
+0
-3
RemindersInfo.java
app/src/main/java/com/zl/sdk/bean/RemindersInfo.java
+0
-2
WeatherAdData.java
app/src/main/java/com/zl/sdk/bean/WeatherAdData.java
+0
-3
OutAdManager.java
app/src/main/java/com/zl/sdk/out/OutAdManager.java
+6
-12
DxActivity.java
app/src/main/java/com/zl/sdk/out/ui/DxActivity.java
+5
-6
No files found.
app/build.gradle
View file @
87746f93
...
...
@@ -39,6 +39,7 @@ dependencies {
implementation
'com.google.firebase:firebase-analytics'
implementation
'cn.kw.lib:pi:1.0.2'
compileOnly
'cn.kw.lib:c:1.0.18'
implementation
'com.squareup.retrofit2:converter-gson:2.4.0'
...
...
app/src/main/java/com/zl/sdk/OutHelp.java
View file @
87746f93
...
...
@@ -7,8 +7,6 @@ import android.content.Context;
import
android.content.Intent
;
import
android.content.IntentFilter
;
import
androidx.annotation.Keep
;
import
com.zl.sdk.ad.topOn.TopOnAdManager
;
import
com.zl.sdk.bean.AdAppInfo
;
import
com.zl.sdk.bean.IconOpt
;
...
...
@@ -19,6 +17,7 @@ import com.zl.sdk.out.ActionFrom;
import
com.zl.sdk.out.DialogShowStatusCallback
;
import
com.zl.sdk.out.OutAdManager
;
import
com.zl.sdk.util.LogUtil
;
import
com.zl.sdk.util.log.LogToLogcat
;
import
java.lang.reflect.Constructor
;
import
java.lang.reflect.Field
;
...
...
@@ -29,7 +28,6 @@ import java.lang.reflect.Proxy;
import
java.util.Timer
;
import
java.util.TimerTask
;
@Keep
public
final
class
OutHelp
implements
KPListener
{
private
OutHelp
()
{
}
...
...
@@ -67,6 +65,8 @@ public final class OutHelp implements KPListener {
NameInterfaceHelp
.
setClassPath
(
nameInterfacePath
);
LogUtil
.
addObserver
(
new
LogToLogcat
());
//初始化广告SDK
AdAppInfo
appInfo
=
new
AdAppInfo
(
appId
,
appKey
);
TopOnAdManager
.
get
().
initSDK
(
context
,
appInfo
);
...
...
@@ -84,14 +84,20 @@ public final class OutHelp implements KPListener {
initReceiver
();
}
private
Timer
timer
;
private
void
initTimer
()
{
Timer
timer
=
new
Timer
();
timer
=
new
Timer
();
timer
.
schedule
(
new
TimerTask
()
{
@Override
public
void
run
()
{
LogUtil
.
d
(
TAG
,
"firstLx : "
+
firstLx
);
showOutAd
(
firstLx
);
if
(
firstLx
)
{
firstLx
=
false
;
}
}
},
60
*
1000
);
},
0
,
60
*
1000
);
}
private
void
initReceiver
()
{
...
...
app/src/main/java/com/zl/sdk/ad/AdDataManager.java
View file @
87746f93
...
...
@@ -16,6 +16,8 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
cn.kw.lib.common.PROP
;
public
class
AdDataManager
{
private
AdDataManager
()
{
}
...
...
@@ -109,26 +111,26 @@ public class AdDataManager {
}
if
(
adData
==
null
)
{
//
adData = new WeatherAdData.NormalAdData();
//
adData.cpName = WeatherAdData.CP_AD_TOPON;
//
adData.cpAdtype = WeatherAdData.CP_AD_TYPE_CHAPING;
//
adData.position = WeatherAdData.POSITION_HOME;
// adData.cpAppid = "a654e2fe6de6d6
";
// adData.cpAdslot = "b1f5i60t92g4gq";//cp:b1f5eocpkk4pq
8 native:b1f5eocpkk4f3f release cp:b1f5i60t92g4gq
//
adData.showCount = 5;
//
adData.showTimes = 5;
// adData.interval = 30
* 60;//30分钟 未隐藏icon
//
adData.intervalHide = 10 * 60;//10分钟 隐藏icon
//
adData.showTimesHideForAdId = 30;
//
adData.showTimeHide = 30;
//
adData.moment = 8;
//
adData.modeAd = 3;
//
adData.modeContent = 3;
//
adData.showTop = 10;
//
adData.showMid = 10;
//
adData.showBottom = 10;
adData
=
getDefaultData
();
adData
=
new
WeatherAdData
.
NormalAdData
();
adData
.
cpName
=
WeatherAdData
.
CP_AD_TOPON
;
adData
.
cpAdtype
=
WeatherAdData
.
CP_AD_TYPE_CHAPING
;
adData
.
position
=
WeatherAdData
.
POSITION_HOME
;
adData
.
cpAppid
=
PROP
.
isTest
()?
"a6501757a165c4"
:
"
"
;
adData
.
cpAdslot
=
PROP
.
isTest
()?
"b6509805ed0208"
:
""
;
//cp:b6509805ed020
8 native:b1f5eocpkk4f3f release cp:b1f5i60t92g4gq
adData
.
showCount
=
5
;
adData
.
showTimes
=
5
;
adData
.
interval
=
1
*
60
;
//30分钟 未隐藏icon
adData
.
intervalHide
=
10
*
60
;
//10分钟 隐藏icon
adData
.
showTimesHideForAdId
=
30
;
adData
.
showTimeHide
=
30
;
adData
.
moment
=
8
;
adData
.
modeAd
=
3
;
adData
.
modeContent
=
3
;
adData
.
showTop
=
10
;
adData
.
showMid
=
10
;
adData
.
showBottom
=
10
;
//
adData = getDefaultData();
LogUtil
.
d
(
TAG
,
"getAdData adData(test) ="
+
adData
);
}
else
{
LogUtil
.
d
(
TAG
,
"getAdData adData(release) ="
+
adData
);
...
...
app/src/main/java/com/zl/sdk/bean/IconAdConfig.java
View file @
87746f93
package
com
.
zl
.
sdk
.
bean
;
import
androidx.annotation.Keep
;
import
java.io.Serializable
;
@Keep
public
class
IconAdConfig
implements
Serializable
{
public
int
retry_interval_time
=
0
;
//外展广告重试间隔时间
public
int
retry_times
=
0
;
//外展广告重试次数
...
...
app/src/main/java/com/zl/sdk/bean/IconOpt.java
View file @
87746f93
package
com
.
zl
.
sdk
.
bean
;
import
androidx.annotation.Keep
;
import
java.io.Serializable
;
@Keep
public
class
IconOpt
implements
Serializable
{
public
boolean
is_screen_off
=
false
;
public
int
hide_sw
=
0
;
// 0 --什么也不做; 1-隐藏icon; 2-显示icon
...
...
app/src/main/java/com/zl/sdk/bean/RemindersInfo.java
View file @
87746f93
...
...
@@ -3,7 +3,6 @@ package com.zl.sdk.bean;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
androidx.annotation.Keep
;
import
androidx.annotation.NonNull
;
import
com.zl.sdk.Config
;
...
...
@@ -11,7 +10,6 @@ import com.zl.sdk.Config;
import
java.io.Serializable
;
import
java.util.Objects
;
@Keep
public
class
RemindersInfo
implements
Parcelable
,
Serializable
{
public
int
reminderType
;
public
String
id
=
""
;
...
...
app/src/main/java/com/zl/sdk/bean/WeatherAdData.java
View file @
87746f93
...
...
@@ -2,14 +2,11 @@ package com.zl.sdk.bean;
import
android.text.TextUtils
;
import
androidx.annotation.Keep
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
@Keep
public
class
WeatherAdData
extends
BaseWeatherBean
{
public
static
final
String
CP_AD_TOPON
=
"topon"
;
public
static
final
String
CP_AD_PANGLE
=
"Pangle"
;
...
...
app/src/main/java/com/zl/sdk/out/OutAdManager.java
View file @
87746f93
...
...
@@ -111,14 +111,9 @@ public class OutAdManager extends BaseOutShowManager {
/**
* 此设备是否是第一次播放外展
*
* @param lastShowTime
* @return
*/
private
boolean
isAppFirstStartInTheDevices
(
long
lastShowTime
)
{
//说明是已经展示过外展广告的用户升级上来的
if
(
lastShowTime
!=
0
)
{
return
false
;
}
private
boolean
isAppFirstStartInTheDevices
()
{
boolean
isAppFirstStartInTheDevices
=
AppOutSP
.
isAppFirstStart
();
if
(
isAppFirstStartInTheDevices
)
{
AppOutSP
.
setIsAppFirstStart
(
false
);
...
...
@@ -140,22 +135,20 @@ public class OutAdManager extends BaseOutShowManager {
LogUtil
.
d
(
TAG
+
">>>轮询检查<<< 是否需要展示广告 =============>>> START"
);
LogUtil
.
d
(
TAG
);
long
lastShowTime
=
AppOutSP
.
getHomeLastShowTime
();
//firstCheck 进程起来立马进行的第一次轮询
//isIconHided 是否是隐藏icon的用户
//isAppFirstStartInTheDevices app在此设备上的首次启动
if
(
firstCheck
/*
if (firstCheck
&& !OutHelp.get().iconIsHide()
&&
isAppFirstStartInTheDevices
(
lastShowTime
))
{
&& isAppFirstStartInTheDevices()) {
LogUtil.d(TAG, ">>>轮询检查<<< first start, no need check");
Map<String, Object> map = new HashMap<>();
map.put("type", String.valueOf(OutHelp.get().iconIsHide()));
map.put("init", String.valueOf(OutHelp.get().isInit()));
Statistics.getInstance().dotEvent(OutHelp.get().getContext(), "time_first_trig", "", map);
return;
}
}
*/
WeatherAdData
.
NormalAdData
adData
=
getAdData
();
...
...
@@ -166,6 +159,7 @@ public class OutAdManager extends BaseOutShowManager {
return
;
}
long
lastShowTime
=
AppOutSP
.
getHomeLastShowTime
();
long
curTime
=
System
.
currentTimeMillis
();
long
showIntervalTime
=
Math
.
abs
(
curTime
-
lastShowTime
);
LogUtil
.
d
(
TAG
+
"检查是否需要展示广告 上次展示时间="
+
lastShowTime
);
...
...
@@ -342,7 +336,7 @@ public class OutAdManager extends BaseOutShowManager {
//这个参数传0 就是不悬挂在桌面,1000 就是悬挂一秒,-1 就是持续悬挂
// notificationConfig.duration = 0;
LogUtil
.
d
(
TAG
+
"拉起广告SLK
"
);
LogUtil
.
d
(
TAG
+
"拉起广告SLK
:"
+
OutHelp
.
get
().
getSdkName
()
);
OutHelp
.
get
().
startOutDialog
(
intent
,
new
DialogShowStatusCallback
()
{
@Override
...
...
app/src/main/java/com/zl/sdk/out/ui/DxActivity.java
View file @
87746f93
...
...
@@ -115,8 +115,7 @@ public class DxActivity extends BaseActivity {
return
false
;
}
@Override
public
void
finish
()
{
public
void
close
()
{
if
(
IconHelp
.
get
().
isIconHide
())
{
LogUtil
.
d
(
TAG
+
"icon隐藏 退回到后台"
);
if
(
proxyView
!=
null
)
{
...
...
@@ -136,7 +135,7 @@ public class DxActivity extends BaseActivity {
@Override
public
boolean
beforeBackPressed
()
{
finish
();
close
();
return
true
;
}
...
...
@@ -174,13 +173,13 @@ public class DxActivity extends BaseActivity {
if
(
remindersInfo
==
null
)
{
LogUtil
.
d
(
TAG
+
"finish remindersInfo为空"
);
finish
();
close
();
return
;
}
if
(
remindersInfo
.
reminderType
!=
Config
.
REMINDER_TYPE_WEATHER_PURE_AD
&&
IconHelp
.
get
().
isIconHide
())
{
LogUtil
.
d
(
TAG
+
"finish 不是纯广告并且隐藏了icon"
);
finish
();
close
();
return
;
}
...
...
@@ -197,7 +196,7 @@ public class DxActivity extends BaseActivity {
if
(
proxyView
==
null
)
{
LogUtil
.
d
(
TAG
+
"finish 5 View=null"
);
finish
();
close
();
return
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment