Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_youyou
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
android
android_youyou
Commits
18ef89cc
Commit
18ef89cc
authored
Mar 30, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优量汇SDK更新,代码位更新
parent
741652f9
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
332 additions
and
105 deletions
+332
-105
build.gradle
app/build.gradle
+1
-1
GDTSDK.unionNormal.4.333.1203.aar
app/libs/GDTSDK.unionNormal.4.333.1203.aar
+0
-0
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+16
-13
WenshuApplication.java
app/src/main/java/com/wenshu/youyou/WenshuApplication.java
+3
-3
PreLoadExpressManager.kt
...ava/com/wenshu/youyou/ad/express/PreLoadExpressManager.kt
+2
-0
TTPreLoadExpressManager.java
...com/wenshu/youyou/ad/express/TTPreLoadExpressManager.java
+2
-5
YlhVideoAdManager.java
...in/java/com/wenshu/youyou/ad/video/YlhVideoAdManager.java
+4
-1
Constant.kt
app/src/main/java/com/wenshu/youyou/common/Constant.kt
+1
-1
DeviceInfo.kt
app/src/main/java/com/wenshu/youyou/common/DeviceInfo.kt
+3
-3
TtCsjAdManager.java
...c/main/java/com/wenshu/youyou/manager/TtCsjAdManager.java
+16
-15
WnManager.kt
app/src/main/java/com/wenshu/youyou/manager/WnManager.kt
+6
-6
YlhAdManager.kt
app/src/main/java/com/wenshu/youyou/manager/YlhAdManager.kt
+18
-18
SplashCsjADActivity.kt
...ava/com/wenshu/youyou/ui/activitys/SplashCsjADActivity.kt
+149
-0
MainFragment.kt
...c/main/java/com/wenshu/youyou/ui/fragment/MainFragment.kt
+81
-33
ForegroundOrBackground.java
.../java/com/wenshu/youyou/utils/ForegroundOrBackground.java
+28
-4
ShareSDK.xml
shareSdkLib/src/main/assets/ShareSDK.xml
+2
-2
No files found.
app/build.gradle
View file @
18ef89cc
...
...
@@ -198,7 +198,7 @@ dependencies {
// 穿山甲广告 版本3.4.1.2
implementation
(
name:
'open_ad_sdk'
,
ext:
'aar'
)
// 广点通广告 腾讯
implementation
(
name:
'GDTSDK.unionNo
Plugin.4.294.1164
'
,
ext:
'aar'
)
implementation
(
name:
'GDTSDK.unionNo
rmal.4.333.1203
'
,
ext:
'aar'
)
// shareSdk
implementation
project
(
':shareSdkLib'
)
// 应用管理中心分包
...
...
app/libs/GDTSDK.unionNormal.4.333.1203.aar
0 → 100644
View file @
18ef89cc
File added
app/src/main/AndroidManifest.xml
View file @
18ef89cc
...
...
@@ -38,7 +38,7 @@
<uses-permission
android:name=
"com.wenshu.youyou.permission"
/>
<!-- 蘑菇星球 -->
<uses-permission
android:name=
"android.permission.REQUEST_DELETE_PACKAGES"
/>
<uses-permission
android:name=
"android.permission.REQUEST_DELETE_PACKAGES"
/>
<permission
android:name=
"com.wenshu.youyou.permission"
...
...
@@ -91,9 +91,9 @@
android:value=
"${UMENG_KEY}"
/>
<!-- TalkingData -->
<!-- <meta-data-->
<!-- android:name="TD_KEY"-->
<!-- android:value="${TD_KEY}" />-->
<!-- <meta-data-->
<!-- android:name="TD_KEY"-->
<!-- android:value="${TD_KEY}" />-->
<!-- ShareSDK -->
<meta-data
...
...
@@ -140,6 +140,9 @@
android:launchMode=
"singleTask"
android:screenOrientation=
"portrait"
android:theme=
"@style/AppTheme.NoneTranslucent"
/>
<activity
android:name=
".ui.activitys.SplashCsjADActivity"
android:screenOrientation=
"portrait"
/>
<activity
android:name=
"com.wenshu.youyou.ui.activitys.WebActivity"
/>
<activity
android:name=
"com.wenshu.library.base.BaseWebActivity"
...
...
@@ -299,15 +302,15 @@
</provider>
<!-- 鱼丸盒子广告 -->
<!-- <provider-->
<!-- android:name="com.component.dly.xzzq_ywsdk.YwFileProvider"-->
<!-- android:authorities="${applicationId}.YwFileProvider"-->
<!-- android:exported="false"-->
<!-- android:grantUriPermissions="true">-->
<!-- <meta-data-->
<!-- android:name="android.support.FILE_PROVIDER_PATHS"-->
<!-- android:resource="@xml/ywsdk_file_paths" />-->
<!-- </provider>-->
<!-- <provider-->
<!-- android:name="com.component.dly.xzzq_ywsdk.YwFileProvider"-->
<!-- android:authorities="${applicationId}.YwFileProvider"-->
<!-- android:exported="false"-->
<!-- android:grantUriPermissions="true">-->
<!-- <meta-data-->
<!-- android:name="android.support.FILE_PROVIDER_PATHS"-->
<!-- android:resource="@xml/ywsdk_file_paths" />-->
<!-- </provider>-->
<!-- 穿山甲广告 -->
<provider
...
...
app/src/main/java/com/wenshu/youyou/WenshuApplication.java
View file @
18ef89cc
...
...
@@ -154,12 +154,12 @@ public class WenshuApplication extends MultiDexApplication {
* 初始化喜马拉雅
*/
private
void
initXmly
()
{
XmPlayerConfig
.
getInstance
(
this
).
setDefualtNotificationNickNameAndInfo
(
Constant
.
wenshu_APP_NAME
,
Constant
.
w
enshu_APP_NAME
);
XmPlayerConfig
.
getInstance
(
this
).
setDefualtNotificationNickNameAndInfo
(
Constant
.
Wenshu_APP_NAME
,
Constant
.
W
enshu_APP_NAME
);
if
(
BaseUtil
.
isMainProcess
(
this
))
{
ConstantsOpenSdk
.
isDebug
=
BuildConfig
.
DEBUG
;
CommonRequest
mXimalaya
=
CommonRequest
.
getInstanse
();
String
mAppSecret
=
"
e31c08462e63e0c3f71ffd7fbba85850
"
;
String
mAppKey
=
"
fe44f14a0fcfbb101632099787eadd04
"
;
String
mAppSecret
=
"
c4b04d0784307e48be3950158c77fb0d
"
;
String
mAppKey
=
"
ba8e54e24fcea42993500cb414fb23f3
"
;
mXimalaya
.
setAppkey
(
mAppKey
);
mXimalaya
.
setPackid
(
Constant
.
wenshu_PKG_NAME
);
mXimalaya
.
init
(
this
,
mAppSecret
);
...
...
app/src/main/java/com/wenshu/youyou/ad/express/PreLoadExpressManager.kt
View file @
18ef89cc
package
com.wenshu.youyou.ad.express
import
android.annotation.SuppressLint
import
android.view.View
import
android.view.ViewGroup
import
android.widget.FrameLayout
...
...
@@ -13,6 +14,7 @@ import java.util.*
/**
* 预加载信息流管理类
*/
@SuppressLint
(
"StaticFieldLeak"
)
object
PreLoadExpressManager
:
TTADLoadSuccessListener
,
YLHADLoadSuccessListener
,
KSADLoadSuccessListener
{
private
val
TAG
=
PreLoadExpressManager
::
class
.
java
.
simpleName
...
...
app/src/main/java/com/wenshu/youyou/ad/express/TTPreLoadExpressManager.java
View file @
18ef89cc
...
...
@@ -42,19 +42,16 @@ public class TTPreLoadExpressManager {
DisplayMetrics
displayMetrics
=
WenshuApplication
.
getContext
().
getResources
().
getDisplayMetrics
();
float
density
=
displayMetrics
.
density
;
float
pxWidth
=
displayMetrics
.
widthPixels
-
(
50
*
density
+
0.5f
);
float
dpWidth
=
pxWidth
/
density
+
0.5f
;
return
dpWidth
;
return
pxWidth
/
density
+
0.5f
;
}
/**
* 预加载 信息流
*/
public
void
loadTtFrameLayout
(
FrameLayout
adFrameLayout
)
{
//
init();
init
();
try
{
ttNativeExpressManager
.
getNativeExpressInit
(
TtCsjAdManager
.
TT_AD_NATIVEEXPRESS_AWARD
,
adFrameLayout
,
getViewWidth
(),
0
);
ttNativeExpressManager
.
setTTNativeExpressManagerListener
(
view
->
{
try
{
...
...
app/src/main/java/com/wenshu/youyou/ad/video/YlhVideoAdManager.java
View file @
18ef89cc
...
...
@@ -2,6 +2,7 @@ package com.wenshu.youyou.ad.video;
import
android.app.Activity
;
import
android.os.SystemClock
;
import
com.wenshu.youyou.ad.video.base.BaseVideoAd
;
import
com.wenshu.youyou.ad.video.base.VideoAdStatusListener
;
import
com.wenshu.youyou.common.AppConfig
;
...
...
@@ -13,6 +14,8 @@ import com.qq.e.ads.rewardvideo.RewardVideoAD;
import
com.qq.e.ads.rewardvideo.RewardVideoADListener
;
import
com.qq.e.comm.util.AdError
;
import
java.util.Map
;
/**
* 优量汇视频
*/
...
...
@@ -168,7 +171,7 @@ public class YlhVideoAdManager extends BaseVideoAd {
}
@Override
public
void
onReward
()
{
//激励视频广告激励发放
public
void
onReward
(
Map
<
String
,
Object
>
map
)
{
//激励视频广告激励发放
// if (activity != null) {
// ylhVideoAdPresenter.reportAddCoinMsg(activity, getAdMapVO(carrierType));
// }
...
...
app/src/main/java/com/wenshu/youyou/common/Constant.kt
View file @
18ef89cc
...
...
@@ -17,7 +17,7 @@ object Constant {
/**
* app名称
*/
const
val
w
enshu_APP_NAME
=
"尤友"
const
val
W
enshu_APP_NAME
=
"尤友"
/**
* 应用包名
...
...
app/src/main/java/com/wenshu/youyou/common/DeviceInfo.kt
View file @
18ef89cc
...
...
@@ -567,7 +567,7 @@ class DeviceInfo private constructor() {
val
appMap
:
MutableMap
<
String
,
String
>
=
HashMap
()
appMap
[
"appName"
]
=
appInfo
.
loadLabel
(
mContext
!!
.
packageManager
)
as
String
appMap
[
"appPkg"
]
=
pinfo
.
packageName
if
(
TextUtils
.
equals
(
Constant
.
w
enshu_APP_NAME
,
appInfo
.
loadLabel
(
mContext
!!
.
packageManager
)
as
String
)
&&
if
(
TextUtils
.
equals
(
Constant
.
W
enshu_APP_NAME
,
appInfo
.
loadLabel
(
mContext
!!
.
packageManager
)
as
String
)
&&
TextUtils
.
equals
(
pinfo
.
packageName
,
Constant
.
wenshu_PKG_NAME
))
{
continue
}
...
...
@@ -600,7 +600,7 @@ class DeviceInfo private constructor() {
//系统程序 忽略
}
else
{
//非系统程序
if
(
TextUtils
.
equals
(
Constant
.
w
enshu_APP_NAME
,
appInfo
.
loadLabel
(
mContext
!!
.
packageManager
)
as
String
)
&&
if
(
TextUtils
.
equals
(
Constant
.
W
enshu_APP_NAME
,
appInfo
.
loadLabel
(
mContext
!!
.
packageManager
)
as
String
)
&&
TextUtils
.
equals
(
pinfo
.
packageName
,
Constant
.
wenshu_PKG_NAME
))
{
continue
}
...
...
@@ -634,7 +634,7 @@ class DeviceInfo private constructor() {
//系统程序 忽略
}
else
{
//非系统程序
if
(
TextUtils
.
equals
(
Constant
.
w
enshu_APP_NAME
,
appInfo
.
loadLabel
(
mContext
!!
.
packageManager
)
as
String
)
&&
if
(
TextUtils
.
equals
(
Constant
.
W
enshu_APP_NAME
,
appInfo
.
loadLabel
(
mContext
!!
.
packageManager
)
as
String
)
&&
TextUtils
.
equals
(
pinfo
.
packageName
,
Constant
.
wenshu_PKG_NAME
))
{
continue
}
...
...
app/src/main/java/com/wenshu/youyou/manager/TtCsjAdManager.java
View file @
18ef89cc
...
...
@@ -17,13 +17,14 @@ import com.wenshu.youyou.mvp.model.ServerAdBean;
*/
public
class
TtCsjAdManager
{
public
static
final
String
TT_AD_APPID
=
"5
038593
"
;
public
static
final
String
TT_AD_NAME
=
Constant
.
w
enshu_APP_NAME
;
public
static
final
String
TT_AD_APPID
=
"5
155496
"
;
public
static
final
String
TT_AD_NAME
=
Constant
.
W
enshu_APP_NAME
;
/*激励视频*/
public
static
String
TT_AD_SPLASH_POSTID
=
"887454728"
;
// 个人中心
/*banner*/
public
static
String
TT_AD_BANNER_MY
=
"945
812059
"
;
// 个人中心
public
static
String
TT_AD_BANNER_MY
=
"945
968536
"
;
// 个人中心
public
static
String
TT_AD_BANNER_JULEYUN
=
""
;
// 聚乐云
/*激励视频*/
public
static
String
TT_AD_VEDIO_MAIN_DEV
=
"945811826"
;
// 开发使用
public
static
String
TT_AD_VEDIO_DRINK
=
"945811826"
;
//喝水打卡
public
static
String
TT_AD_VEDIO_WALK
=
"945811826"
;
//走路打卡
...
...
@@ -39,19 +40,19 @@ public class TtCsjAdManager {
public
static
String
TT_AD_VEDIO_GAME
=
""
;
// 猎豹
public
static
String
TT_AD_VEDIO_JULEYUN
=
""
;
// 聚乐云
public
static
String
TT_AD_VEDIO_BIANXIANMAO
=
""
;
// 变现猫
public
static
String
TT_AD_VEDIO_BLESSINGBAG
=
"945
811826
"
;
// 福袋
public
static
String
TT_AD_VEDIO_HOMEVEDIO
=
"945
811826
"
;
// 首页视频翻倍
public
static
String
TT_AD_VEDIO_SMALLHOMEVEDIO
=
"945
811826
"
;
// 短视频翻倍
public
static
String
TT_AD_VEDIO_KYLVEDIO
=
"945
811826
"
;
// 来电秀视频
public
static
String
TT_AD_VEDIO_BLESSINGBAG
=
"945
968497
"
;
// 福袋
public
static
String
TT_AD_VEDIO_HOMEVEDIO
=
"945
968497
"
;
// 首页视频翻倍
public
static
String
TT_AD_VEDIO_SMALLHOMEVEDIO
=
"945
968497
"
;
// 短视频翻倍
public
static
String
TT_AD_VEDIO_KYLVEDIO
=
"945
968497
"
;
// 来电秀视频
/*全屏视频*/
public
static
String
TT_AD_FULLVEDIO_ALL
=
"945
811843
"
;
// 通用
public
static
String
TT_AD_FULLVEDIO_ALL
=
"945
968499
"
;
// 通用
/*信息流*/
public
static
String
TT_AD_NATIVEEXPRESS_XMLY
=
"945
81181
6"
;
//喜马拉雅信息流
public
static
String
TT_AD_NATIVEEXPRESS_AWARD
=
"945
811936
"
;
//信息流弹窗
public
static
String
TT_AD_NATIVEEXPRESS_WALK
=
"945
811899
"
;
//走路
public
static
String
TT_AD_NATIVEEXPRESS_WATER
=
"945
811899
"
;
//喝水
public
static
String
TT_AD_NATIVEEXPRESS_MORNINGCLOCK
=
"945
811899
"
;
//早上打卡
public
static
String
TT_AD_NATIVEEXPRESS_EAT
=
"945
811899
"
;
//餐补
public
static
String
TT_AD_NATIVEEXPRESS_XMLY
=
"945
96850
6"
;
//喜马拉雅信息流
public
static
String
TT_AD_NATIVEEXPRESS_AWARD
=
"945
968518
"
;
//信息流弹窗
public
static
String
TT_AD_NATIVEEXPRESS_WALK
=
"945
968542
"
;
//走路
public
static
String
TT_AD_NATIVEEXPRESS_WATER
=
"945
968542
"
;
//喝水
public
static
String
TT_AD_NATIVEEXPRESS_MORNINGCLOCK
=
"945
968542
"
;
//早上打卡
public
static
String
TT_AD_NATIVEEXPRESS_EAT
=
"945
968542
"
;
//餐补
public
static
String
TT_AD_NATIVEEXPRESS_ID_LIEBAO_LISTEXIT
=
""
;
//猎豹列表和退出
/*全屏广告*/
public
static
String
TT_AD_ALLVEDIO_ID_LIEBAO
=
""
;
//猎豹全屏带跳过按钮
...
...
app/src/main/java/com/wenshu/youyou/manager/WnManager.kt
View file @
18ef89cc
...
...
@@ -12,13 +12,13 @@ import com.wannuosili.sdk.WNAdSdk
*/
object
WnManager
{
private
const
val
APP_ID
=
""
private
const
val
APP_ID
=
"
10000547
"
const
val
WN_AD_VEDIO_DRINK_POSTID
=
""
//喝水打卡
const
val
WN_AD_VEDIO_MAIN_POSTID
=
""
//我的界面视频
const
val
WN_AD_VEDIO_ERASE_POSTID
=
""
//刮刮乐
const
val
WN_AD_VEDIO_TURNABLE_POSTID
=
""
//大转盘
const
val
WN_AD_VEDIO_MOREDIALOG_POSTID
=
""
//签到、气泡、离线弹框
const
val
WN_AD_VEDIO_DRINK_POSTID
=
"
100000812008
"
//喝水打卡
const
val
WN_AD_VEDIO_MAIN_POSTID
=
"
100000812008
"
//我的界面视频
const
val
WN_AD_VEDIO_ERASE_POSTID
=
"
100000812008
"
//刮刮乐
const
val
WN_AD_VEDIO_TURNABLE_POSTID
=
"
100000812008
"
//大转盘
const
val
WN_AD_VEDIO_MOREDIALOG_POSTID
=
"
100000812008
"
//签到、气泡、离线弹框
/**
* 初始化
...
...
app/src/main/java/com/wenshu/youyou/manager/YlhAdManager.kt
View file @
18ef89cc
...
...
@@ -13,33 +13,33 @@ import com.qq.e.comm.managers.GDTADManager
object
YlhAdManager
{
/* 优量汇appid */
const
val
YLH_AD_APPID
=
"111
0058445
"
const
val
YLH_AD_APPID
=
"111
1577663
"
/* splash-postid */
var
YLH_AD_SPLASH_POSTID
=
"
105165997671968
6"
var
YLH_AD_SPLASH_POSTID
=
"
900127411425517
6"
/* 激励视频 */
var
YLH_AD_VEDIO_DRINK
=
"
705105590519326
6"
//喝水打卡
var
YLH_AD_VEDIO_WALK
=
"
705105590519326
6"
//走路打卡
var
YLH_AD_VEDIO_MAIN
=
"
705105590519326
6"
// 我的界面视频
var
YLH_AD_VEDIO_ERASE
=
"
705105590519326
6"
// 刮刮乐
var
YLH_AD_VEDIO_TURNABLE
=
"
705105590519326
6"
// 大转盘
var
YLH_AD_VEDIO_MOREDIALOG
=
"
705105590519326
6"
// 气泡
var
YLH_AD_VEDIO_SIGN
=
"
705105590519326
6"
// 签到
var
YLH_AD_VEDIO_EAT
=
"
705105590519326
6"
// 饭补
var
YLH_AD_VEDIO_OFFINELINE
=
"
705105590519326
6"
// 离线弹框
var
YLH_AD_VEDIO_DRAWCASH
=
"
705105590519326
6"
// 提现
var
YLH_AD_VEDIO_MOST
=
"
705105590519326
6"
// 超级翻倍/高额任务
var
YLH_AD_VEDIO_DRINK
=
"
406197516465407
6"
//喝水打卡
var
YLH_AD_VEDIO_WALK
=
"
406197516465407
6"
//走路打卡
var
YLH_AD_VEDIO_MAIN
=
"
406197516465407
6"
// 我的界面视频
var
YLH_AD_VEDIO_ERASE
=
"
406197516465407
6"
// 刮刮乐
var
YLH_AD_VEDIO_TURNABLE
=
"
406197516465407
6"
// 大转盘
var
YLH_AD_VEDIO_MOREDIALOG
=
"
406197516465407
6"
// 气泡
var
YLH_AD_VEDIO_SIGN
=
"
406197516465407
6"
// 签到
var
YLH_AD_VEDIO_EAT
=
"
406197516465407
6"
// 饭补
var
YLH_AD_VEDIO_OFFINELINE
=
"
406197516465407
6"
// 离线弹框
var
YLH_AD_VEDIO_DRAWCASH
=
"
406197516465407
6"
// 提现
var
YLH_AD_VEDIO_MOST
=
"
406197516465407
6"
// 超级翻倍/高额任务
var
YLH_AD_VEDIO_GAME
=
""
// 猎豹
var
YLH_AD_VEDIO_BLESSINGBAG
=
"
705105590519326
6"
// 福袋
var
YLH_AD_VEDIO_HOMEVEDIO
=
"
705105590519326
6"
// 首页视频翻倍
var
YLH_AD_VEDIO_SMALLHOMEVEDIO
=
"
705105590519326
6"
// 短视频翻倍
var
YLH_AD_VEDIO_KYLVEDIO
=
"
705105590519326
6"
// 来电秀视频
var
YLH_AD_VEDIO_BLESSINGBAG
=
"
406197516465407
6"
// 福袋
var
YLH_AD_VEDIO_HOMEVEDIO
=
"
406197516465407
6"
// 首页视频翻倍
var
YLH_AD_VEDIO_SMALLHOMEVEDIO
=
"
406197516465407
6"
// 短视频翻倍
var
YLH_AD_VEDIO_KYLVEDIO
=
"
406197516465407
6"
// 来电秀视频
/*信息流*/
var
YLH_AD_NATIVEEXPRESS_JULEYUN
=
""
//聚乐云
var
YLH_AD_NATIVEEXPRESS_AWARD
=
"
4081450906109922
"
//奖励弹窗
var
YLH_AD_NATIVEEXPRESS_AWARD
=
"
5061071124059461
"
//奖励弹窗
/* 插屏 */
var
YLH_AD_INTERSTITIALAD_LIEBAO
=
""
//猎豹
...
...
app/src/main/java/com/wenshu/youyou/ui/activitys/SplashCsjADActivity.kt
0 → 100644
View file @
18ef89cc
package
com.wenshu.youyou.ui.activitys
import
android.view.KeyEvent
import
android.view.View
import
android.view.ViewGroup
import
com.bytedance.sdk.openadsdk.AdSlot
import
com.bytedance.sdk.openadsdk.TTAdNative
import
com.bytedance.sdk.openadsdk.TTSplashAd
import
com.wenshu.youyou.R
import
com.wenshu.youyou.manager.TTNativeExpressManager
import
com.wenshu.youyou.manager.TtCsjAdManager
import
com.wenshu.youyou.ui.activitys.base.BaseActivity
import
com.wenshu.library.net.netstatus.NetUtils
private
val
TAG
=
SplashCsjADActivity
::
class
.
java
.
simpleName
/**
* 后台返回时每次都展示 快手广告
*/
class
SplashCsjADActivity
:
BaseActivity
()
{
private
var
container
:
ViewGroup
?
=
null
private
var
mIsPaused
=
false
var
canJump
=
false
private
var
mTTAdNative
:
TTAdNative
?
=
null
override
fun
getContentViewLayoutID
():
Int
{
return
R
.
layout
.
activity_splash_ylh
}
override
fun
initViewsAndEvents
()
{
if
(!
NetUtils
.
isNetworkConnected
(
context
))
{
finish
()
}
else
{
try
{
container
=
findViewById
<
View
>(
R
.
id
.
splash_container
)
as
ViewGroup
//step2:创建TTAdNative对象
val
ttNativeExpressManager
=
TTNativeExpressManager
()
mTTAdNative
=
ttNativeExpressManager
.
initTTAd
(
false
)
loadSplashAd
()
}
catch
(
e
:
Exception
)
{
readyGoOtherActivity
()
}
}
}
override
fun
isApplyKitKatTranslucency
():
Boolean
{
return
false
}
private
fun
loadSplashAd
()
{
//step3:创建开屏广告请求参数AdSlot
val
adSlot
:
AdSlot
?
=
AdSlot
.
Builder
()
.
setCodeId
(
TtCsjAdManager
.
TT_AD_SPLASH_POSTID
)
.
setImageAcceptedSize
(
1080
,
1920
)
.
build
()
mTTAdNative
!!
.
loadSplashAd
(
adSlot
,
object
:
TTAdNative
.
SplashAdListener
{
override
fun
onError
(
p0
:
Int
,
p1
:
String
?)
{
readyGoOtherActivity
()
}
override
fun
onTimeout
()
{
readyGoOtherActivity
()
}
override
fun
onSplashAdLoad
(
ad
:
TTSplashAd
?)
{
if
(
ad
==
null
)
{
readyGoOtherActivity
()
return
}
val
splashView
=
ad
.
splashView
if
(
container
!=
null
&&
!
isFinishing
)
{
container
!!
.
removeAllViews
()
//把SplashView 添加到ViewGroup中,注意开屏广告view:width >=70%屏幕宽;height >=50%屏幕高
container
!!
.
addView
(
splashView
)
//设置不开启开屏广告倒计时功能以及不显示跳过按钮,如果这么设置,您需要自定义倒计时逻辑
//ad.setNotAllowSdkCountdown();
}
else
{
readyGoOtherActivity
()
}
ad
.
setSplashInteractionListener
(
object
:
TTSplashAd
.
AdInteractionListener
{
override
fun
onAdClicked
(
p0
:
View
?,
p1
:
Int
)
{
}
override
fun
onAdShow
(
p0
:
View
?,
p1
:
Int
)
{
}
override
fun
onAdSkip
()
{
readyGoOtherActivity
()
}
override
fun
onAdTimeOver
()
{
readyGoOtherActivity
()
}
})
}
},
3000
)
}
/**
* 设置一个变量来控制当前开屏页面是否可以跳转,当开屏广告为普链类广告时,点击会打开一个广告落地页,此时开发者还不能打开自己的App主页。当从广告落地页返回以后,
* 才可以跳转到开发者自己的App主页;当开屏广告是App类广告时只会下载App。
*/
private
operator
fun
next
()
{
if
(
mIsPaused
)
{
canJump
=
true
}
else
{
readyGoOtherActivity
()
}
}
override
fun
onPause
()
{
super
.
onPause
()
mIsPaused
=
true
}
override
fun
onResume
()
{
super
.
onResume
()
mIsPaused
=
false
if
(
canJump
)
{
next
()
}
}
/**
* 开屏页一定要禁止用户对返回按钮的控制,否则将可能导致用户手动退出了App而广告无法正常曝光和计费
*/
override
fun
onKeyDown
(
keyCode
:
Int
,
event
:
KeyEvent
):
Boolean
{
return
if
(
keyCode
==
KeyEvent
.
KEYCODE_BACK
)
{
true
}
else
super
.
onKeyDown
(
keyCode
,
event
)
}
private
fun
readyGoOtherActivity
()
{
finish
()
}
}
\ No newline at end of file
app/src/main/java/com/wenshu/youyou/ui/fragment/MainFragment.kt
View file @
18ef89cc
...
...
@@ -332,7 +332,11 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
val
transaction
:
FragmentTransaction
=
supportFragmentManager
.
beginTransaction
()
if
(
littleVideoFragment
==
null
)
{
littleVideoFragment
=
YLLittleVideoFragment
.
newInstance
()
transaction
.
add
(
R
.
id
.
yilan_fragment_frame_container
,
littleVideoFragment
!!
,
YLLittleVideoFragment
::
class
.
java
.
simpleName
)
transaction
.
add
(
R
.
id
.
yilan_fragment_frame_container
,
littleVideoFragment
!!
,
YLLittleVideoFragment
::
class
.
java
.
simpleName
)
}
else
{
transaction
.
show
(
littleVideoFragment
!!
)
}
...
...
@@ -363,7 +367,12 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
override
fun
onLoopComplete
(
pager
:
String
?,
videoID
:
String
,
taskID
:
String
?,
num
:
Int
)
{
override
fun
onLoopComplete
(
pager
:
String
?,
videoID
:
String
,
taskID
:
String
?,
num
:
Int
)
{
// LogUtil.d(TAG, "registerPlayerCallBack onLoopComplete")
addVideoIdList
(
videoID
)
pauseDownloadTime
()
...
...
@@ -388,11 +397,17 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
private
fun
initListener
()
{
val
params
=
LinearLayout
.
LayoutParams
(
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
,
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
)
val
params
=
LinearLayout
.
LayoutParams
(
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
,
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
)
params
.
setMargins
(
0
,
0
,
0
,
BubbleUtils
.
dp2px
(
270
))
cdvvYilanTime
.
layoutParams
=
params
val
paramsRedBox
=
FrameLayout
.
LayoutParams
(
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
,
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
)
val
paramsRedBox
=
FrameLayout
.
LayoutParams
(
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
,
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
)
paramsRedBox
.
setMargins
(
0
,
BubbleUtils
.
dp2px
(
40
),
0
,
0
)
paramsRedBox
.
gravity
=
Gravity
.
END
rl_fragment_main_redbox
.
layoutParams
=
paramsRedBox
...
...
@@ -405,10 +420,24 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
override
fun
onSuccess
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
}
override
fun
onError
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
Int
,
p4
:
String
?,
p5
:
String
?)
{
override
fun
onError
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
Int
,
p4
:
String
?,
p5
:
String
?
)
{
}
override
fun
onRenderError
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
Int
,
p4
:
String
?,
p5
:
String
?)
{
override
fun
onRenderError
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
Int
,
p4
:
String
?,
p5
:
String
?
)
{
}
override
fun
onShow
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
)
{
...
...
@@ -539,14 +568,14 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
R
.
id
.
btn_dialogper_back
->
{
if
(
activity
!=
null
&&
!
activity
!!
.
isFinishing
&&
powerDialog
!=
null
&&
powerDialog
!!
.
isShowing
powerDialog
!=
null
&&
powerDialog
!!
.
isShowing
)
{
showToast
(
"请您同意授权,否则将无法使用APP功能"
)
}
}
R
.
id
.
btn_dialogper_next
->
{
if
(
activity
!=
null
&&
!
activity
!!
.
isFinishing
&&
powerDialog
!=
null
&&
powerDialog
!!
.
isShowing
powerDialog
!=
null
&&
powerDialog
!!
.
isShowing
)
{
powerDialog
!!
.
dismiss
()
ps
.
put
(
Constant
.
LOAN_PERMISSION_FLAG
,
false
)
...
...
@@ -555,12 +584,25 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
ShumeiManager
.
getInstance
().
initShumei
()
// 游客首次提示1500新人奖励 且 不是分享包
val
channel
=
CommonUtils
.
getAppMetaData
(
WenshuApplication
.
getContext
(),
"CHANNEL_NAME"
)
if
(!
TextUtils
.
equals
(
channel
,
Constant
.
CHANNEL_SHARE
)
&&
ps
.
getBoolean
(
Constant
.
FIRST_VISITOR_FLAG
,
true
))
{
val
channel
=
CommonUtils
.
getAppMetaData
(
WenshuApplication
.
getContext
(),
"CHANNEL_NAME"
)
if
(!
TextUtils
.
equals
(
channel
,
Constant
.
CHANNEL_SHARE
)
&&
ps
.
getBoolean
(
Constant
.
FIRST_VISITOR_FLAG
,
true
)
)
{
ps
.
put
(
Constant
.
FIRST_VISITOR_FLAG
,
false
)
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
if
(
userMsgBean
!=
null
&&
userMsgBean
!!
.
userMsg
.
showCoin
>
0
)
userMsgBean
?.
userMsg
?.
showCoin
!!
else
1500
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_NEW_VISITOR
)
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
if
(
userMsgBean
!=
null
&&
userMsgBean
!!
.
userMsg
.
showCoin
>
0
)
userMsgBean
?.
userMsg
?.
showCoin
!!
else
1500
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_NEW_VISITOR
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
}
...
...
@@ -575,20 +617,24 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
* 设置视频权重
*/
private
fun
initAdWeight
(
data
:
UserTaskMsgBean
)
{
videoAdingManager
?.
initAdWeight
(
data
.
vedioRules
.
csJ_VEDIO
.
rate
,
data
.
vedioRules
.
ylH_VEDIO
.
rate
,
data
.
vedioRules
.
sdhZ_VEDIO
.
rate
,
data
.
vedioRules
.
fL_VEDIO
.
rate
,
data
.
vedioRules
.
corAl_VIDEO
.
rate
,
data
.
vedioRules
.
csjfulL_VEDIO
.
rate
,
data
.
vedioRules
.
kS_VEDIO
.
rate
)
LogUtil
.
d
(
TAG
,
"首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} "
+
"ylhWeight:${data.vedioRules.ylH_VEDIO.rate} "
+
"sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} "
+
"csjFullWeight:${data.vedioRules.csjfulL_VEDIO.rate} "
+
"shWeight:${data.vedioRules.corAl_VIDEO.rate} "
+
"flWeight:${data.vedioRules.fL_VEDIO.rate} "
+
"ksWeight:${data.vedioRules.kS_VEDIO.rate} "
)
videoAdingManager
?.
initAdWeight
(
data
.
vedioRules
.
csJ_VEDIO
.
rate
,
data
.
vedioRules
.
ylH_VEDIO
.
rate
,
data
.
vedioRules
.
sdhZ_VEDIO
.
rate
,
data
.
vedioRules
.
fL_VEDIO
.
rate
,
data
.
vedioRules
.
corAl_VIDEO
.
rate
,
data
.
vedioRules
.
csjfulL_VEDIO
.
rate
,
data
.
vedioRules
.
kS_VEDIO
.
rate
)
LogUtil
.
d
(
TAG
,
"首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} "
+
"ylhWeight:${data.vedioRules.ylH_VEDIO.rate} "
+
"sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} "
+
"csjFullWeight:${data.vedioRules.csjfulL_VEDIO.rate} "
+
"shWeight:${data.vedioRules.corAl_VIDEO.rate} "
+
"flWeight:${data.vedioRules.fL_VEDIO.rate} "
+
"ksWeight:${data.vedioRules.kS_VEDIO.rate} "
)
// 广告视频数
AppConfig
.
csjVideoAdCount
=
data
.
vedioRules
.
csJ_VEDIO
.
surplus
AppConfig
.
ylhAdCount
=
data
.
vedioRules
.
ylH_VEDIO
.
surplus
...
...
@@ -597,13 +643,15 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
AppConfig
.
csjFullVedioAdCount
=
data
.
vedioRules
.
csjfulL_VEDIO
.
surplus
AppConfig
.
shVideoAdCount
=
data
.
vedioRules
.
corAl_VIDEO
.
surplus
AppConfig
.
ksVideoAdCount
=
data
.
vedioRules
.
kS_VEDIO
.
surplus
LogUtil
.
d
(
TAG
,
"首页视频数:csjCount:${AppConfig.csjVideoAdCount} "
+
"ylhCount:${AppConfig.ylhAdCount} "
+
"sdhzCount:${AppConfig.wnVideoAdCount} "
+
"csjFullCount:${AppConfig.csjFullVedioAdCount} "
+
"shCount:${AppConfig.shVideoAdCount} "
+
"flCount:${AppConfig.flVideoAdCount} "
+
"ksCount:${AppConfig.ksVideoAdCount} "
)
LogUtil
.
d
(
TAG
,
"首页视频数:csjCount:${AppConfig.csjVideoAdCount} "
+
"ylhCount:${AppConfig.ylhAdCount} "
+
"sdhzCount:${AppConfig.wnVideoAdCount} "
+
"csjFullCount:${AppConfig.csjFullVedioAdCount} "
+
"shCount:${AppConfig.shVideoAdCount} "
+
"flCount:${AppConfig.flVideoAdCount} "
+
"ksCount:${AppConfig.ksVideoAdCount} "
)
}
private
fun
initExpress
(
flowAdRules
:
FlowAdRulesBean
)
{
...
...
app/src/main/java/com/wenshu/youyou/utils/ForegroundOrBackground.java
View file @
18ef89cc
...
...
@@ -9,6 +9,7 @@ import android.text.TextUtils;
import
com.wenshu.youyou.manager.TrackManager
;
import
com.wenshu.youyou.mvp.presenters.VersionUpdatePresenter
;
import
com.wenshu.youyou.ui.activitys.SplashADActivity
;
import
com.wenshu.youyou.ui.activitys.SplashCsjADActivity
;
import
java.lang.ref.WeakReference
;
...
...
@@ -23,11 +24,14 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
private
static
ForegroundOrBackground
instance
;
public
int
count
=
0
;
private
volatile
boolean
isYlhSplash
=
false
;
private
Intent
ylhIntent
;
private
Intent
csjIntent
;
//获取当前最上层的activity
private
static
WeakReference
<
Activity
>
app_activity
;
private
VersionUpdatePresenter
vup
;
private
WeakReference
<
Activity
>
reference
;
private
Intent
intent
;
public
static
ForegroundOrBackground
init
(
Application
application
)
{
if
(
instance
==
null
)
{
...
...
@@ -99,10 +103,30 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
// LogUtil.d("ForegroundOrBackground", System.currentTimeMillis() - leaveTime + " onActivityStarted");
// 60秒后打开应用 显示开屏广告
if
(
System
.
currentTimeMillis
()
-
leaveTime
>=
60000
)
{
if
(
intent
==
null
)
{
intent
=
new
Intent
(
activity
,
SplashADActivity
.
class
);
if
(
isYlhSplash
)
{
isYlhSplash
=
false
;
if
(
ylhIntent
==
null
)
{
// 优量汇广告
ylhIntent
=
new
Intent
(
activity
,
SplashADActivity
.
class
);
}
activity
.
startActivity
(
ylhIntent
);
}
else
{
isYlhSplash
=
true
;
if
(
csjIntent
==
null
)
{
// 快手广告
csjIntent
=
new
Intent
(
activity
,
SplashCsjADActivity
.
class
);
}
activity
.
startActivity
(
csjIntent
);
// if (ksIntent == null) {
// // 快手广告
// ksIntent = new Intent(activity, SplashKsADActivity.class);
// }
// activity.startActivity(ksIntent);
}
activity
.
startActivity
(
intent
);
}
}
count
++;
...
...
shareSdkLib/src/main/assets/ShareSDK.xml
View file @
18ef89cc
...
...
@@ -82,10 +82,10 @@
MiniprogramType=
"0"
Path=
"pages/index/index.html?id=1"
SortId=
"4"
UserName=
"gh_afb25ac019c9"
WithShareTicket=
"true"
/>
<WechatMoments
AppId=
"wx
c8ac2985f6a805e2"
AppSecret=
"05ec1f88c19ef905325ad4a316f62e9d
"
BypassApproval=
"false"
<WechatMoments
AppId=
"wx
a9c7cc9c01db59f1"
AppSecret=
"4d317618b7205c56992219f195349a2c
"
BypassApproval=
"false"
Enable=
"true"
Id=
"5"
SortId=
"5"
/>
<WechatFavorite
AppId=
"wx
4868b35061f87885"
AppSecret=
"64020361b8ec4c99936c0e3999a9f249
"
Enable=
"true"
<WechatFavorite
AppId=
"wx
a9c7cc9c01db59f1"
AppSecret=
"4d317618b7205c56992219f195349a2c
"
Enable=
"true"
Id=
"6"
SortId=
"6"
/>
<!-- ShareByAppClient标识是否使用微博客户端分享,默认是false -->
...
...
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