Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
LuckyFarm
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
LuckyFarm
Commits
0be7fc44
Commit
0be7fc44
authored
Dec 16, 2020
by
Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[李俊岐]预加载提前,升级sdk
parent
26c7abff
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
16 deletions
+23
-16
GameActivity.kt
app/src/main/java/com/ym/game/GameActivity.kt
+0
-2
SplashActivity.kt
app/src/main/java/com/ym/game/activity/SplashActivity.kt
+2
-0
BaseApplication.kt
app/src/main/java/com/ym/game/application/BaseApplication.kt
+20
-13
build.gradle
library/build.gradle
+1
-1
No files found.
app/src/main/java/com/ym/game/GameActivity.kt
View file @
0be7fc44
...
...
@@ -88,8 +88,6 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
// }
openNotif
()
AdUtils
.
loadNextCacheRewardVideoAd
(
this
)
AdUtils
.
loadFeedCacheAdToCache
(
this
)
}
override
fun
onDestroy
()
{
...
...
app/src/main/java/com/ym/game/activity/SplashActivity.kt
View file @
0be7fc44
...
...
@@ -191,5 +191,7 @@ class SplashActivity : MyBaseActivity(), SplashContract.View {
Utils
.
obj2Str
(
ReportEntity
(
MyConstant
.
ReportSessionId
,
"SplashActivity"
,
"onPause"
))
)
MobclickAgent
.
onPause
(
this
)
AdUtils
.
loadNextCacheRewardVideoAd
(
this
)
AdUtils
.
loadFeedCacheAdToCache
(
this
)
}
}
\ No newline at end of file
app/src/main/java/com/ym/game/application/BaseApplication.kt
View file @
0be7fc44
...
...
@@ -47,30 +47,32 @@ class BaseApplication : BaseApplication() {
// 从前台进入后台的时间
private
var
frontToBackTime
:
Long
=
0
// 从后台返回前台的时间
private
var
backToFrontTime
:
Long
=
0
override
fun
onCreate
()
{
super
.
onCreate
()
NetConfig
.
setBase_Url
(
NetConfig
.
Environment
.
PRODUCT
)
// TODO 上线之后提成成 NetConfig.Environment.PRODUCT
NetConfig
.
BASE_FEED_URL
=
"https://fsapi.ihuomao.com/"
NetConfig
.
BASE_AD_URL
=
"https://bs.ihuomao.com/"
NetConfig
.
URL_REPORT_BASE
=
"http://report.ihuomao.com/"
var
isDebug
=
true
if
(
NetConfig
.
sEnvironment
==
NetConfig
.
Environment
.
PRODUCT
)
{
isDebug
=
false
NetConfig
.
BASE_FEED_URL
=
"https://fsapi.ihuomao.com/"
NetConfig
.
BASE_AD_URL
=
"https://bs.ihuomao.com/"
NetConfig
.
URL_REPORT_BASE
=
"http://report.ihuomao.com/"
}
else
{
NetConfig
.
BASE_FEED_URL
=
"http://feedapitest2.zhangxinhulian.com/"
}
//TODO 上线去掉测试地址
// NetConfig.BASE_FEED_URL = "http://feedapitest2.zhangxinhulian.com/"
// Constant.appLs = "b59e7d03c0f91730"//appls
AdManager
.
init
(
this
,
"b59e7d03c0f91730"
)
LogUtils
.
getConfig
().
logSwitch
=
false
AdManager
.
init
(
this
,
"b59e7d03c0f91730"
)
LogUtils
.
getConfig
().
logSwitch
=
isDebug
UMConfigure
.
setLogEnabled
(
false
)
UMConfigure
.
init
(
this
,
"5fc658ef4034454d32e7e6ba"
,
""
,
UMConfigure
.
DEVICE_TYPE_PHONE
,
""
)
PlatformConfig
.
setWeixin
(
MyConstant
.
WX_APPID
,
MyConstant
.
WX_APPKEY
)
var
isDebug
=
true
if
(
NetConfig
.
sEnvironment
==
NetConfig
.
Environment
.
PRODUCT
)
{
isDebug
=
false
}
//========== Bugly ==========
val
strategy
=
CrashReport
.
UserStrategy
(
this
)
...
...
@@ -95,6 +97,7 @@ class BaseApplication : BaseApplication() {
super
.
attachBaseContext
(
base
)
MultiDex
.
install
(
base
)
}
/**
* 当前Activity个数
*/
...
...
@@ -109,9 +112,9 @@ class BaseApplication : BaseApplication() {
flag
=
false
sAppState
=
STATE_BACK_TO_FRONT
backToFrontTime
=
System
.
currentTimeMillis
()
if
(
canShowAd
())
{
if
(
canShowAd
())
{
var
intent
=
Intent
()
intent
.
setClass
(
applicationContext
,
SplashResumeActivity
::
class
.
java
)
intent
.
setClass
(
applicationContext
,
SplashResumeActivity
::
class
.
java
)
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
AppliContext
.
get
().
startActivity
(
intent
)
}
...
...
@@ -122,6 +125,7 @@ class BaseApplication : BaseApplication() {
activityCount
++
}
override
fun
onActivityResumed
(
activity
:
Activity
)
{}
override
fun
onActivityPaused
(
activity
:
Activity
)
{}
override
fun
onActivityStopped
(
activity
:
Activity
)
{
...
...
@@ -135,14 +139,16 @@ class BaseApplication : BaseApplication() {
sAppState
=
STATE_NORMAL
;
}
}
override
fun
onActivitySaveInstanceState
(
activity
:
Activity
,
outState
:
Bundle
)
{}
override
fun
onActivityDestroyed
(
activity
:
Activity
)
{}
}
fun
canShowAd
():
Boolean
{
return
sAppState
===
STATE_BACK_TO_FRONT
&&
backToFrontTime
-
frontToBackTime
>
10000
backToFrontTime
-
frontToBackTime
>
10000
}
fun
isCurAppTop
(
context
:
Context
?):
Boolean
{
if
(
context
==
null
)
{
return
false
...
...
@@ -161,6 +167,7 @@ class BaseApplication : BaseApplication() {
}
return
false
}
/**
* 获取进程号对应的进程名
*
...
...
library/build.gradle
View file @
0be7fc44
...
...
@@ -67,7 +67,7 @@ dependencies {
api
(
"com.bx:adsdk:1.3.3"
){
exclude
group:
'com.google.code.gson'
}
api
'com.ym.admodule:admodule:1.0.3.
3
'
api
'com.ym.admodule:admodule:1.0.3.
14
'
api
'com.airbnb.android:lottie:3.1.0'
/* api 'androidx.appcompat:appcompat:1.2.0-alpha02'
api 'com.android.support:design:28.0.0'
...
...
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