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
26c7abff
Commit
26c7abff
authored
Dec 15, 2020
by
xw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[提交人]:王雪伟
[提交简述] :多多花园1.0.3 [实现方案] :升级广告SDK
parent
c8b17f94
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
56 changed files
with
834 additions
and
1951 deletions
+834
-1951
jarRepositories.xml
.idea/jarRepositories.xml
+5
-0
GameActivity.kt
app/src/main/java/com/ym/game/GameActivity.kt
+24
-17
ClockInWithdrawActitivy.kt
...main/java/com/ym/game/activity/ClockInWithdrawActitivy.kt
+4
-5
SplashActivity.kt
app/src/main/java/com/ym/game/activity/SplashActivity.kt
+24
-19
WelfareActivity.kt
app/src/main/java/com/ym/game/activity/WelfareActivity.kt
+2
-2
WxLoginActivity.kt
app/src/main/java/com/ym/game/activity/WxLoginActivity.kt
+2
-7
ClockInWithdrawAdpater.kt
...c/main/java/com/ym/game/adapter/ClockInWithdrawAdpater.kt
+0
-1
BaseApplication.kt
app/src/main/java/com/ym/game/application/BaseApplication.kt
+2
-4
MainDialog.kt
app/src/main/java/com/ym/game/view/MainDialog.kt
+1
-8
PuzzleDialog.kt
app/src/main/java/com/ym/game/view/PuzzleDialog.kt
+0
-10
SiginDropsPopupwindow.kt
app/src/main/java/com/ym/game/view/SiginDropsPopupwindow.kt
+0
-7
SpeedWaterPopupWindow.kt
app/src/main/java/com/ym/game/view/SpeedWaterPopupWindow.kt
+0
-7
build.gradle
build.gradle
+4
-0
build.gradle
library/build.gradle
+1
-1
MyConstant.java
library/src/main/java/com/ym/library/MyConstant.java
+1
-2
JavaInterface.kt
...ry/src/main/java/com/ym/library/activity/JavaInterface.kt
+29
-27
NewWebActivity.kt
...y/src/main/java/com/ym/library/activity/NewWebActivity.kt
+4
-5
WebActivity.kt
library/src/main/java/com/ym/library/activity/WebActivity.kt
+2
-2
WebViewActivity.java
...rc/main/java/com/ym/library/activity/WebViewActivity.java
+2
-11
XiaoManActivity.kt
.../src/main/java/com/ym/library/activity/XiaoManActivity.kt
+3
-7
BaseDialog.kt
library/src/main/java/com/ym/library/base/BaseDialog.kt
+1
-1
UpdateVersionPresenter.kt
...c/main/java/com/ym/library/down/UpdateVersionPresenter.kt
+4
-4
VersionClient.kt
library/src/main/java/com/ym/library/down/VersionClient.kt
+4
-6
UserInfoEntity.kt
...ary/src/main/java/com/ym/library/module/UserInfoEntity.kt
+57
-0
AdUpload.kt
library/src/main/java/com/ym/library/net/AdUpload.kt
+12
-11
ApiClient.kt
library/src/main/java/com/ym/library/net/ApiClient.kt
+7
-7
BaseActivity.java
library/src/main/java/com/ym/library/net/BaseActivity.java
+0
-261
EventApiClient.kt
library/src/main/java/com/ym/library/net/EventApiClient.kt
+4
-4
GameApiClient.kt
library/src/main/java/com/ym/library/net/GameApiClient.kt
+7
-7
IUserApi.kt
library/src/main/java/com/ym/library/net/IUserApi.kt
+1
-1
MyBaseActivity.java
library/src/main/java/com/ym/library/net/MyBaseActivity.java
+47
-0
PermissionsActivity.java
...src/main/java/com/ym/library/net/PermissionsActivity.java
+6
-7
SplashPresenter.kt
library/src/main/java/com/ym/library/net/SplashPresenter.kt
+129
-127
ZXADClient.kt
library/src/main/java/com/ym/library/net/ZXADClient.kt
+7
-8
RounterApi.kt
library/src/main/java/com/ym/library/router/RounterApi.kt
+53
-53
AdUtils.kt
library/src/main/java/com/ym/library/utils/AdUtils.kt
+1
-0
CenterDialog.kt
library/src/main/java/com/ym/library/utils/CenterDialog.kt
+3
-7
FileUtils.kt
library/src/main/java/com/ym/library/utils/FileUtils.kt
+2
-2
JumpUtils.java
library/src/main/java/com/ym/library/utils/JumpUtils.java
+7
-6
LogUtils.java
library/src/main/java/com/ym/library/utils/LogUtils.java
+3
-3
MyPhoneUtils.kt
library/src/main/java/com/ym/library/utils/MyPhoneUtils.kt
+254
-0
OpenFiles.kt
library/src/main/java/com/ym/library/utils/OpenFiles.kt
+11
-11
PhoneUtils.kt
library/src/main/java/com/ym/library/utils/PhoneUtils.kt
+0
-1176
SettingPreference.java
...src/main/java/com/ym/library/utils/SettingPreference.java
+59
-58
Utils.java
library/src/main/java/com/ym/library/utils/Utils.java
+2
-1
WxImplUtils.java
library/src/main/java/com/ym/library/utils/WxImplUtils.java
+9
-8
ZxDownLoadServices.java
...rc/main/java/com/ym/library/utils/ZxDownLoadServices.java
+1
-0
IUserInfoApi.kt
library/src/main/java/com/ym/library/wechat/IUserInfoApi.kt
+1
-1
UserApiClient.kt
library/src/main/java/com/ym/library/wechat/UserApiClient.kt
+7
-9
NavigationBottomView.java
...main/java/com/ym/library/widget/NavigationBottomView.java
+2
-2
SettingActivity.kt
...n/java/com/ym/userinfo/module/activity/SettingActivity.kt
+9
-13
WithdrawalsRecordActivity.kt
.../ym/userinfo/module/activity/WithdrawalsRecordActivity.kt
+2
-2
UserContract.kt
...main/java/com/ym/userinfo/module/contract/UserContract.kt
+1
-1
IUserInfoApi.kt
.../src/main/java/com/ym/userinfo/module/net/IUserInfoApi.kt
+1
-1
UserApiClient.kt
...src/main/java/com/ym/userinfo/module/net/UserApiClient.kt
+7
-9
UserPresenter.kt
...in/java/com/ym/userinfo/module/presenter/UserPresenter.kt
+3
-2
No files found.
.idea/jarRepositories.xml
View file @
26c7abff
...
...
@@ -46,5 +46,10 @@
<option
name=
"name"
value=
"maven3"
/>
<option
name=
"url"
value=
"http://zx-maven.huolea.com/repository/admodule/"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"maven"
/>
<option
name=
"name"
value=
"maven"
/>
<option
name=
"url"
value=
"https://dl.bintray.com/mintegral-official/Andorid_ad_SDK_for_china"
/>
</remote-repository>
</component>
</project>
\ No newline at end of file
app/src/main/java/com/ym/game/GameActivity.kt
View file @
26c7abff
...
...
@@ -5,23 +5,19 @@ import android.app.Dialog
import
android.content.ComponentName
import
android.content.Intent
import
android.content.ServiceConnection
import
android.content.pm.ActivityInfo
import
android.os.Bundle
import
android.os.IBinder
import
android.text.TextUtils
import
android.util.Log
import
android.view.View
import
android.view.WindowManager
import
com.bx.adsdk.AdSdk
import
com.game.luckyfarm.UnityPlayerActivity
import
com.gyf.immersionbar.ImmersionBar
import
com.umeng.analytics.MobclickAgent
import
com.ym.ddhy.
R
import
com.ym.ddhy.
UserInfoEntity
import
com.ym.game.activity.WxLoginActivity
import
com.ym.game.listener.IDialogViewCloseCallback
import
com.ym.game.notif.NotificationService
import
com.ym.game.view.*
import
com.ym.library.Constant
import
com.ym.library.
My
Constant
import
com.ym.library.down.UpdateVersionManager
import
com.ym.library.listener.IAdVideoListener
import
com.ym.library.module.*
...
...
@@ -31,7 +27,7 @@ import com.ym.library.net.GameApiClient
import
com.ym.library.net.RxSchedulers
import
com.ym.library.utils.*
import
com.ym.modulecommon.AppliContext
import
com.ym.modulecommon.
module.UserInfoEntity
import
com.ym.modulecommon.
utils.AdPreference
import
io.reactivex.Observable
import
io.reactivex.android.schedulers.AndroidSchedulers
import
org.jetbrains.anko.act
...
...
@@ -64,7 +60,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
mRefreshLoginObservable
?.
observeOn
(
AndroidSchedulers
.
mainThread
())
?.
subscribe
({
when
(
it
)
{
"not_login"
->
{
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
setToken
(
""
)
Ad
Preference
.
setToken
(
""
)
try
{
val
intent
=
Intent
(
this
,
WxLoginActivity
::
class
.
java
)
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
...
...
@@ -87,7 +83,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
// //小满上报
// if (Constant.isReportXiaoman) {
// AdSdk.exposure("2773",
com.ym.modulecommon.utils.Setting
Preference.getToken())
// AdSdk.exposure("2773",
Ad
Preference.getToken())
// Constant.isReportXiaoman = false
// }
openNotif
()
...
...
@@ -116,7 +112,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
Log
.
d
(
"I/Unity"
,
"onResume"
)
EventUtils
.
onEvent
(
"page_status"
,
Utils
.
obj2Str
(
ReportEntity
(
Constant
.
ReportSessionId
,
"GameActivity"
,
"onResume"
))
Utils
.
obj2Str
(
ReportEntity
(
My
Constant
.
ReportSessionId
,
"GameActivity"
,
"onResume"
))
)
}
...
...
@@ -125,7 +121,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
MobclickAgent
.
onPause
(
this
)
EventUtils
.
onEvent
(
"page_status"
,
Utils
.
obj2Str
(
ReportEntity
(
Constant
.
ReportSessionId
,
"GameActivity"
,
"onPause"
))
Utils
.
obj2Str
(
ReportEntity
(
My
Constant
.
ReportSessionId
,
"GameActivity"
,
"onPause"
))
)
}
...
...
@@ -180,9 +176,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
*/
fun
gotoWithdrawPage
(
type
:
Int
)
{
if
(
type
==
1
)
{
JumpUtils
.
h5Jump
(
"跳转提现页"
,
Constant
.
Param
.
WithDraw2
,
false
,
act
)
JumpUtils
.
h5Jump
(
"跳转提现页"
,
My
Constant
.
Param
.
WithDraw2
,
false
,
act
)
}
else
{
JumpUtils
.
h5Jump
(
"跳转提现页"
,
Constant
.
Param
.
WithDraw
,
false
,
act
)
JumpUtils
.
h5Jump
(
"跳转提现页"
,
My
Constant
.
Param
.
WithDraw
,
false
,
act
)
}
}
...
...
@@ -191,7 +187,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
*/
fun
ranklistClick
()
{
//JumpUtils.h5Jump("上榜赚钱", Constant.Param.RankList)
JumpUtils
.
h5Jump
(
"排行榜"
,
Constant
.
Param
.
RankList
,
false
,
act
)
JumpUtils
.
h5Jump
(
"排行榜"
,
My
Constant
.
Param
.
RankList
,
false
,
act
)
}
/**
...
...
@@ -216,7 +212,6 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
* 拼图红包
*/
fun
onPuzzleClick
()
{
Log
.
d
(
"wxw"
,
"拼图红包"
)
MainLooper
.
get
()
?.
post
(
Runnable
{
if
(
Utils
.
isFastClick2
())
{
//CashExchangeDialog.showCashExchage(this, this)
...
...
@@ -225,6 +220,18 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
})
}
/**
* 拼图红包
*/
fun
onMonopolyClick
()
{
MainLooper
.
get
()
?.
post
(
Runnable
{
if
(
Utils
.
isFastClick2
())
{
//CashExchangeDialog.showCashExchage(this, this)
// PuzzleDialog.showPuzzleDialog(this, this)
}
})
}
private
var
isclick
=
false
/**
...
...
@@ -937,10 +944,10 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
EventUtils
.
onEvent
(
"SplashPresenter_getUserInfo_fail"
)
}
else
{
EventUtils
.
onEvent
(
"SplashPresenter_getUserInfo_success"
)
com
.
ym
.
modulecommon
.
utils
.
SettingPreference
.
saveUserInfo
(
result
)
SettingPreference
.
saveUserInfo
(
result
)
SettingPreference
.
setTrackId
(
result
.
gaodeTrackId
?:
0L
)
SettingPreference
.
setTerminalId
(
result
.
gaodeTerminalId
?:
0L
)
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
setUid
(
uid
)
Ad
Preference
.
setUid
(
uid
)
}
}
...
...
app/src/main/java/com/ym/game/activity/ClockInWithdrawActitivy.kt
View file @
26c7abff
...
...
@@ -9,17 +9,16 @@ import com.ym.game.adapter.ClockInWithdrawAdpater
import
com.ym.game.contract.ClockInWithdrawContract
import
com.ym.game.presenter.ClockInWithdrawPresenter
import
com.ym.game.view.MainDialog
import
com.ym.library.Constant
import
com.ym.library.
My
Constant
import
com.ym.library.listener.OnRecycleItemClickListener
import
com.ym.library.module.ClockInWithdrawEntity
import
com.ym.library.module.ExchangeEntity
import
com.ym.library.net.BaseActivity
import
com.ym.library.utils.CenterDialog
import
com.ym.library.net.MyBaseActivity
import
com.ym.library.utils.EventUtils
import
kotlinx.android.synthetic.main.activity_clock_in_withdraw.*
//打卡提现 福利
class
ClockInWithdrawActitivy
:
BaseActivity
(),
ClockInWithdrawContract
.
View
,
class
ClockInWithdrawActitivy
:
My
BaseActivity
(),
ClockInWithdrawContract
.
View
,
OnRecycleItemClickListener
<
ClockInWithdrawEntity
.
ClockInItemEntity
>
{
private
var
mPresenter
:
ClockInWithdrawPresenter
?
=
null
...
...
@@ -74,7 +73,7 @@ class ClockInWithdrawActitivy : BaseActivity(), ClockInWithdrawContract.View,
//任务列表结果
override
fun
clockInWithdrawListResult
(
result
:
ClockInWithdrawEntity
?)
{
if
(
result
!=
null
)
{
Constant
.
videoNum
=
result
?.
videoNum
?:
20
My
Constant
.
videoNum
=
result
?.
videoNum
?:
20
tv_clock_in_days
?.
text
=
Html
.
fromHtml
(
"已连续打卡 <font color=\"#8F2C0F\"><big>${result?.clockNum}</big></font> 天"
)
...
...
app/src/main/java/com/ym/game/activity/SplashActivity.kt
View file @
26c7abff
...
...
@@ -15,16 +15,18 @@ import com.ym.admodule.listener.ZXADSplashListener
import
com.ym.ddhy.R
import
com.ym.game.GameActivity
import
com.ym.game.utils.CenterDialog
import
com.ym.library.Constant
import
com.ym.library.
My
Constant
import
com.ym.library.module.ReportEntity
import
com.ym.library.net.MyBaseActivity
import
com.ym.library.net.PermissionsActivity
import
com.ym.library.net.SplashContract
import
com.ym.library.net.SplashPresenter
import
com.ym.library.net.SplashPresenter.Companion.PERMISSIONS
import
com.ym.library.utils.*
import
com.ym.modulecommon.base.BaseActivity
import
com.ym.modulecommon.utils.AdPreference
class
SplashActivity
:
BaseActivity
(),
SplashContract
.
View
{
class
SplashActivity
:
My
BaseActivity
(),
SplashContract
.
View
{
override
fun
layoutID
():
Int
=
R
.
layout
.
splash_layout
...
...
@@ -37,7 +39,8 @@ class SplashActivity : BaseActivity(), SplashContract.View {
finish
()
return
}
Constant
.
ReportSessionId
=
""
+
System
.
currentTimeMillis
()
+
ReportUtils
.
getRandom
(
10
)
//上报使用的sessionId
MyConstant
.
ReportSessionId
=
""
+
System
.
currentTimeMillis
()
+
ReportUtils
.
getRandom
(
10
)
//上报使用的sessionId
EventUtils
.
onEvent
(
"app_start"
)
ImmersionBar
.
with
(
this
)
.
hideBar
(
BarHide
.
FLAG_HIDE_NAVIGATION_BAR
)
...
...
@@ -63,15 +66,15 @@ class SplashActivity : BaseActivity(), SplashContract.View {
}
override
fun
className
():
String
{
return
SplashActivity
::
class
.
java
.
simpleName
}
override
fun
jumpPage
()
{
if
(!
SettingPreference
.
getIsShowGuide
())
{
EventUtils
.
onEvent
(
"SplashActivity_loadSplash"
)
AdManager
.
loadSplashAd
(
this
,
ADConfig
.
AD_SPLASH
,
"splash"
,
tv_skipview
,
splash_container
!!
,
object
:
ZXADSplashListener
{
ADConfig
.
AD_SPLASH
,
"splash"
,
tv_skipview
,
splash_container
!!
,
object
:
ZXADSplashListener
{
override
fun
onAdShow
()
{}
override
fun
onAdSkip
()
{
...
...
@@ -99,12 +102,12 @@ class SplashActivity : BaseActivity(), SplashContract.View {
isClick
=
false
startTime
=
System
.
currentTimeMillis
()
// startActivity(Intent(this@SplashActivity, GameActivity::class.java))
val
token
=
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getToken
()
if
(
token
.
isEmpty
()){
val
token
=
Ad
Preference
.
getToken
()
if
(
token
.
isEmpty
())
{
EventUtils
.
onEvent
(
"login_token_null"
,
"未登录"
)
startActivity
(
Intent
(
this
@SplashActivity
,
WxLoginActivity
::
class
.
java
))
finish
()
}
else
{
}
else
{
EventUtils
.
onEvent
(
"login_token_not_null"
,
"已登录"
)
startActivity
(
Intent
(
this
@SplashActivity
,
GameActivity
::
class
.
java
))
finish
()
...
...
@@ -148,7 +151,7 @@ class SplashActivity : BaseActivity(), SplashContract.View {
ActivityCompat
.
startActivityForResult
(
this
,
intent
,
Constant
.
REQUEST_CODE_ASK_PERMISSIONS
,
My
Constant
.
REQUEST_CODE_ASK_PERMISSIONS
,
null
)
}
...
...
@@ -159,7 +162,7 @@ class SplashActivity : BaseActivity(), SplashContract.View {
data
:
Intent
?
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
)
if
(
requestCode
==
Constant
.
REQUEST_CODE_ASK_PERMISSIONS
&&
resultCode
==
PermissionsActivity
.
PERMISSIONS_DENIED
)
{
if
(
requestCode
==
My
Constant
.
REQUEST_CODE_ASK_PERMISSIONS
&&
resultCode
==
PermissionsActivity
.
PERMISSIONS_DENIED
)
{
//TODO 有权限的时候
Log
.
e
(
"huang"
,
"onActivityResult()"
)
startMain
()
...
...
@@ -168,23 +171,25 @@ class SplashActivity : BaseActivity(), SplashContract.View {
}
}
override
fun
activity
():
Activity
{
return
this
}
override
fun
getDestroyed
():
Boolean
{
return
false
}
override
fun
onResume
()
{
super
.
onResume
()
EventUtils
.
onEvent
(
"page_status"
,
Utils
.
obj2Str
(
ReportEntity
(
Constant
.
ReportSessionId
,
"SplashActivity"
,
"onResume"
)))
EventUtils
.
onEvent
(
"page_status"
,
Utils
.
obj2Str
(
ReportEntity
(
MyConstant
.
ReportSessionId
,
"SplashActivity"
,
"onResume"
))
)
MobclickAgent
.
onResume
(
this
)
}
override
fun
onPause
()
{
super
.
onPause
()
EventUtils
.
onEvent
(
"page_status"
,
Utils
.
obj2Str
(
ReportEntity
(
Constant
.
ReportSessionId
,
"SplashActivity"
,
"onPause"
)))
EventUtils
.
onEvent
(
"page_status"
,
Utils
.
obj2Str
(
ReportEntity
(
MyConstant
.
ReportSessionId
,
"SplashActivity"
,
"onPause"
))
)
MobclickAgent
.
onPause
(
this
)
}
}
\ No newline at end of file
app/src/main/java/com/ym/game/activity/WelfareActivity.kt
View file @
26c7abff
...
...
@@ -17,11 +17,11 @@ import com.ym.game.view.MainDialog
import
com.ym.library.listener.IAdVideoListener
import
com.ym.library.listener.OnRecycleItemClickListener
import
com.ym.library.module.*
import
com.ym.library.net.BaseActivity
import
com.ym.library.net.
My
BaseActivity
import
com.ym.library.utils.*
import
kotlinx.android.synthetic.main.activity_welfare.*
class
WelfareActivity
:
BaseActivity
(),
WelfareContract
.
View
,
class
WelfareActivity
:
My
BaseActivity
(),
WelfareContract
.
View
,
OnRecycleItemClickListener
<
NewsEntity
>
{
private
var
mPresenter
:
WelfarePresenter
?
=
null
...
...
app/src/main/java/com/ym/game/activity/WxLoginActivity.kt
View file @
26c7abff
package
com.ym.game.activity
import
android.content.Intent
import
android.util.Log
import
android.view.View
import
android.widget.Toast
import
com.umeng.analytics.MobclickAgent
import
com.ym.game.GameActivity
import
com.ym.library.Constant
import
com.ym.library.module.ReportEntity
import
com.ym.library.net.*
import
com.ym.library.utils.*
import
com.ym.library.utils.EventUtils.onEvent
import
com.ym.library.wechat.UserApiClient
import
com.ym.ddhy.R
import
kotlinx.android.synthetic.main.activity_wx_login.*
import
org.jetbrains.anko.act
...
...
@@ -21,7 +16,7 @@ import org.jetbrains.anko.act
* @datetime 2020-10-23 18:19 GMT+8
* @detail :
*/
class
WxLoginActivity
:
BaseActivity
(),
WxImplUtils
.
IWxLoginCallback
{
class
WxLoginActivity
:
My
BaseActivity
(),
WxImplUtils
.
IWxLoginCallback
{
override
fun
layoutID
():
Int
{
return
R
.
layout
.
activity_wx_login
}
...
...
@@ -70,7 +65,7 @@ class WxLoginActivity : BaseActivity(), WxImplUtils.IWxLoginCallback {
// finish()
// }
// val token =
com.ym.modulecommon.utils.Setting
Preference.getToken()
// val token =
Ad
Preference.getToken()
// Log.d("wxw","token"+token)
// UserApiClient.userApi.getIsBindWithdrawWx(token)
// .compose(RxSchedulers.observableIO2Main())
...
...
app/src/main/java/com/ym/game/adapter/ClockInWithdrawAdpater.kt
View file @
26c7abff
...
...
@@ -13,7 +13,6 @@ import androidx.recyclerview.widget.RecyclerView
import
com.ym.library.listener.OnRecycleItemClickListener
import
com.ym.library.base.BaseRecyclerAdapter
import
com.ym.ddhy.R
import
com.ym.library.Constant
import
com.ym.library.module.ClockInWithdrawEntity
import
com.ym.library.utils.Utils
...
...
app/src/main/java/com/ym/game/application/BaseApplication.kt
View file @
26c7abff
...
...
@@ -12,13 +12,11 @@ import android.os.Process
import
android.text.TextUtils
import
android.util.Log
import
androidx.multidex.MultiDex
import
androidx.multidex.MultiDexApplication
import
com.bx.adsdk.AdSdk
import
com.tencent.bugly.crashreport.CrashReport
import
com.umeng.commonsdk.UMConfigure
import
com.umeng.socialize.PlatformConfig
import
com.ym.admodule.config.AdManager
import
com.ym.library.Constant
import
com.ym.library.
My
Constant
import
com.ym.modulecommon.AppliContext
import
com.ym.modulecommon.base.BaseApplication
import
com.ym.modulecommon.base.SplashResumeActivity
...
...
@@ -67,7 +65,7 @@ class BaseApplication : BaseApplication() {
LogUtils
.
getConfig
().
logSwitch
=
false
UMConfigure
.
setLogEnabled
(
false
)
UMConfigure
.
init
(
this
,
"5fc658ef4034454d32e7e6ba"
,
""
,
UMConfigure
.
DEVICE_TYPE_PHONE
,
""
)
PlatformConfig
.
setWeixin
(
Constant
.
WX_APPID
,
Constant
.
WX_APPKEY
)
PlatformConfig
.
setWeixin
(
MyConstant
.
WX_APPID
,
My
Constant
.
WX_APPKEY
)
var
isDebug
=
true
if
(
NetConfig
.
sEnvironment
==
NetConfig
.
Environment
.
PRODUCT
)
{
...
...
app/src/main/java/com/ym/game/view/MainDialog.kt
View file @
26c7abff
...
...
@@ -3,25 +3,18 @@ package com.ym.game.view
import
android.app.Activity
import
android.app.Dialog
import
android.content.Context
import
android.content.DialogInterface
import
android.os.Debug
import
android.util.Log
import
android.view.Gravity
import
android.view.MotionEvent
import
android.view.View
import
android.view.ViewGroup
import
android.widget.*
import
com.bytedance.sdk.openadsdk.TTNativeExpressAd
import
com.qq.e.ads.nativ.NativeExpressADView
import
com.ym.admodule.config.AdManager
import
com.ym.admodule.config.ZXADSizeConfig
import
com.ym.game.listener.IDialogViewCloseCallback
import
com.ym.modulecommon.AppliContext
import
com.ym.ddhy.R
import
com.ym.library.Constant
import
com.ym.library.module.FlyBoxEntity
import
com.ym.library.module.TurntableEntity
import
com.ym.library.utils.*
import
com.ym.modulecommon.utils.PhoneUtils
object
MainDialog
{
...
...
app/src/main/java/com/ym/game/view/PuzzleDialog.kt
View file @
26c7abff
...
...
@@ -23,9 +23,6 @@ import android.widget.RelativeLayout
import
androidx.recyclerview.widget.GridLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
com.airbnb.lottie.LottieAnimationView
import
com.google.gson.annotations.Until
import
com.ym.admodule.config.AdManager
import
com.ym.admodule.listener.ZXADVideoListener
import
com.ym.ddhy.R
import
com.ym.game.contract.PuzzleContract
import
com.ym.game.listener.IDialogViewCloseCallback
...
...
@@ -35,15 +32,8 @@ import com.ym.library.listener.OnRecycleItemClickListener
import
com.ym.library.module.PuzzleEntity
import
com.ym.library.rxbus.RxBusUtil
import
com.ym.library.utils.Utils
import
com.ym.modulecommon.AppliContext
import
com.ym.game.adapter.PuzzleBottomAdapter
import
com.ym.library.Constant
import
com.ym.library.listener.IAdVideoListener
import
com.ym.library.module.StatusEntity
import
com.ym.library.net.BaseObserver
import
com.ym.library.net.GameApiClient
import
com.ym.library.net.RxSchedulers
import
com.ym.library.utils.ADConfig
import
com.ym.library.utils.AdUtils
import
com.ym.library.utils.EventUtils
import
com.ym.piggybank.adapter.PuzzleTopAdapter
...
...
app/src/main/java/com/ym/game/view/SiginDropsPopupwindow.kt
View file @
26c7abff
...
...
@@ -3,7 +3,6 @@ package com.ym.game.view
import
android.annotation.SuppressLint
import
android.app.Activity
import
android.graphics.drawable.ColorDrawable
import
android.util.Log
import
android.view.*
import
android.widget.ImageView
import
android.widget.PopupWindow
...
...
@@ -11,17 +10,12 @@ import android.widget.RelativeLayout
import
android.widget.TextView
import
androidx.recyclerview.widget.GridLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
com.ym.admodule.config.AdManager
import
com.ym.admodule.listener.ZXADVideoListener
import
com.ym.library.listener.OnRecycleItemClickListener
import
com.ym.game.listener.IDialogViewCloseCallback
import
com.ym.game.adapter.SigninDropsAdapter
import
com.ym.game.adapter.WateringTaskAdpater
import
com.ym.game.contract.WateringRewardContract
import
com.ym.game.presenter.WateringRewardPresenter
import
com.ym.library.Constant
import
com.ym.library.net.BaseObserver
import
com.ym.library.net.RxSchedulers
import
com.ym.library.rxbus.RxBusConstant
import
com.ym.library.rxbus.RxBusUtil
import
com.ym.library.rxbus.Subscribe
...
...
@@ -29,7 +23,6 @@ import com.ym.library.rxbus.ThreadMode
import
com.ym.ddhy.R
import
com.ym.library.listener.IAdVideoListener
import
com.ym.library.module.*
import
com.ym.library.net.GameApiClient
import
com.ym.library.utils.*
/**
...
...
app/src/main/java/com/ym/game/view/SpeedWaterPopupWindow.kt
View file @
26c7abff
...
...
@@ -3,24 +3,18 @@ package com.ym.game.view
import
android.annotation.SuppressLint
import
android.app.Activity
import
android.graphics.drawable.ColorDrawable
import
android.util.Log
import
android.view.*
import
android.widget.ImageView
import
android.widget.PopupWindow
import
android.widget.RelativeLayout
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
com.ym.admodule.config.AdManager
import
com.ym.admodule.listener.ZXADVideoListener
import
com.ym.library.listener.OnRecycleItemClickListener
import
com.ym.game.adapter.SpeedWaterTaskAdapter
import
com.ym.game.contract.SpeedWaterContract
import
com.ym.game.listener.IDialogViewCloseCallback
import
com.ym.game.presenter.SpeedWaterPresenter
import
com.ym.library.Constant
import
com.ym.library.module.NewsEntity
import
com.ym.library.net.BaseObserver
import
com.ym.library.net.RxSchedulers
import
com.ym.library.rxbus.RxBusConstant
import
com.ym.library.rxbus.RxBusUtil
import
com.ym.library.rxbus.Subscribe
...
...
@@ -29,7 +23,6 @@ import com.ym.ddhy.R
import
com.ym.library.listener.IAdVideoListener
import
com.ym.library.module.TaskListEntity
import
com.ym.library.module.WateringTaskEntity
import
com.ym.library.net.GameApiClient
import
com.ym.library.utils.*
class
SpeedWaterPopupWindow
:
PopupWindow
(),
SpeedWaterContract
.
View
,
...
...
build.gradle
View file @
26c7abff
...
...
@@ -22,6 +22,9 @@ allprojects {
repositories
{
google
()
jcenter
()
maven
{
url
"https://dl.bintray.com/mintegral-official/Andorid_ad_SDK_for_china"
}
maven
{
url
"http://47.97.184.214:8081/nexus/content/groups/public"
}
...
...
@@ -31,6 +34,7 @@ allprojects {
maven
{
url
"http://zx-maven.huolea.com/repository/admodule/"
}
}
}
...
...
library/build.gradle
View file @
26c7abff
...
...
@@ -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.
2.31
'
api
'com.ym.admodule:admodule:1.0.
3.3
'
api
'com.airbnb.android:lottie:3.1.0'
/* api 'androidx.appcompat:appcompat:1.2.0-alpha02'
api 'com.android.support:design:28.0.0'
...
...
library/src/main/java/com/ym/library/Constant.java
→
library/src/main/java/com/ym/library/
My
Constant.java
View file @
26c7abff
...
...
@@ -4,7 +4,6 @@ import android.Manifest;
import
android.os.Build
;
import
com.ym.library.net.LatestLoginInfo
;
import
com.ym.library.utils.PhoneUtils
;
import
java.util.List
;
...
...
@@ -12,7 +11,7 @@ import java.util.List;
* Created by gaoleichao on 2018/4/25.
*/
public
class
Constant
{
public
class
My
Constant
{
public
static
int
REQUEST_CODE_ASK_PERMISSIONS
=
0x0101
;
public
static
final
String
scheme
=
"ddhy"
;
...
...
library/src/main/java/com/ym/library/activity/JavaInterface.kt
View file @
26c7abff
...
...
@@ -24,7 +24,7 @@ import android.widget.Toast
import
androidx.core.app.ActivityCompat
import
androidx.core.app.NotificationManagerCompat
import
androidx.core.content.FileProvider
import
com.ym.library.Constant
import
com.ym.library.
My
Constant
import
com.ym.library.module.NewsEntity
import
com.ym.library.net.ApiClient
import
com.ym.library.net.RxSchedulers
...
...
@@ -32,6 +32,8 @@ import com.ym.library.rxbus.RxBusConstant
import
com.ym.library.rxbus.RxBusUtil
import
com.ym.library.utils.*
import
com.ym.modulecommon.AppliContext
import
com.ym.modulecommon.utils.AdPreference
import
com.ym.modulecommon.utils.PhoneUtils
import
io.reactivex.Observer
import
io.reactivex.disposables.Disposable
import
okhttp3.ResponseBody
...
...
@@ -59,7 +61,7 @@ abstract class JavaInterface {
@JavascriptInterface
fun
getNovelUid
():
String
?
{
System
.
out
.
println
(
"getNovelUid()"
)
return
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUid
()
return
Ad
Preference
.
getUid
()
}
@JavascriptInterface
...
...
@@ -86,7 +88,7 @@ abstract class JavaInterface {
*/
@JavascriptInterface
fun
getToken
():
String
{
return
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getToken
()
return
Ad
Preference
.
getToken
()
}
/**
...
...
@@ -439,7 +441,7 @@ abstract class JavaInterface {
// 即是在清单文件中配置的authorities
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
My
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
// 给目标应用一个临时授权
...
...
@@ -460,28 +462,28 @@ abstract class JavaInterface {
val
params
=
JSONObject
()
val
ts
=
System
.
currentTimeMillis
()
params
.
put
(
Constant
.
Device
.
ts
,
ts
)
params
.
put
(
Constant
.
Device
.
uid
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUid
())
params
.
put
(
Constant
.
Device
.
token
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getToken
())
params
.
put
(
Constant
.
Device
.
aid
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getAndroidId
())
params
.
put
(
Constant
.
Device
.
imei
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getImei
())
params
.
put
(
Constant
.
Device
.
device
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getDevice
())
params
.
put
(
Constant
.
Device
.
mac
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getMac
())
params
.
put
(
Constant
.
Device
.
platform
,
"android"
)
params
.
put
(
Constant
.
Device
.
carrier
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getCarrier
())
params
.
put
(
Constant
.
Device
.
w
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getW
())
params
.
put
(
Constant
.
Device
.
vendor
,
Build
.
MANUFACTURER
)
params
.
put
(
Constant
.
Device
.
h
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getH
())
params
.
put
(
Constant
.
Device
.
ip
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getIp
())
params
.
put
(
Constant
.
Device
.
imsi
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getImsi
())
params
.
put
(
Constant
.
Device
.
model
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getModel
())
params
.
put
(
Constant
.
Device
.
vn
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getVN
())
params
.
put
(
Constant
.
Device
.
ntt
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getNTT
())
params
.
put
(
Constant
.
Device
.
vc
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getVC
())
params
.
put
(
Constant
.
Device
.
source
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getSource
())
params
.
put
(
Constant
.
Device
.
ua
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUA
())
params
.
put
(
Constant
.
Device
.
svn
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getSVN
())
params
.
put
(
My
Constant
.
Device
.
ts
,
ts
)
params
.
put
(
MyConstant
.
Device
.
uid
,
Ad
Preference
.
getUid
())
params
.
put
(
MyConstant
.
Device
.
token
,
Ad
Preference
.
getToken
())
params
.
put
(
MyConstant
.
Device
.
aid
,
Ad
Preference
.
getAndroidId
())
params
.
put
(
MyConstant
.
Device
.
imei
,
Ad
Preference
.
getImei
())
params
.
put
(
MyConstant
.
Device
.
device
,
Ad
Preference
.
getDevice
())
params
.
put
(
MyConstant
.
Device
.
mac
,
Ad
Preference
.
getMac
())
params
.
put
(
My
Constant
.
Device
.
platform
,
"android"
)
params
.
put
(
MyConstant
.
Device
.
carrier
,
Ad
Preference
.
getCarrier
())
params
.
put
(
MyConstant
.
Device
.
w
,
Ad
Preference
.
getW
())
params
.
put
(
My
Constant
.
Device
.
vendor
,
Build
.
MANUFACTURER
)
params
.
put
(
MyConstant
.
Device
.
h
,
Ad
Preference
.
getH
())
params
.
put
(
MyConstant
.
Device
.
ip
,
Ad
Preference
.
getIp
())
params
.
put
(
MyConstant
.
Device
.
imsi
,
Ad
Preference
.
getImsi
())
params
.
put
(
MyConstant
.
Device
.
model
,
Ad
Preference
.
getModel
())
params
.
put
(
MyConstant
.
Device
.
vn
,
Ad
Preference
.
getVN
())
params
.
put
(
MyConstant
.
Device
.
ntt
,
Ad
Preference
.
getNTT
())
params
.
put
(
MyConstant
.
Device
.
vc
,
Ad
Preference
.
getVC
())
params
.
put
(
MyConstant
.
Device
.
source
,
Ad
Preference
.
getSource
())
params
.
put
(
MyConstant
.
Device
.
ua
,
Ad
Preference
.
getUA
())
params
.
put
(
MyConstant
.
Device
.
svn
,
Ad
Preference
.
getSVN
())
var
param
=
obj2Array
(
params
)
System
.
out
.
println
(
"-------------:$param"
)
return
params
.
toString
()
...
...
@@ -624,7 +626,7 @@ abstract class JavaInterface {
@JavascriptInterface
fun
withDraw
()
{
val
token
=
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getToken
()
val
token
=
Ad
Preference
.
getToken
()
if
(
token
.
isEmpty
())
{
WxImplUtils
().
onAuth
(
act
,
object
:
WxImplUtils
.
IWxLoginCallback
{
override
fun
onWxSuccess
(
token
:
String
?,
openid
:
String
?)
{
...
...
library/src/main/java/com/ym/library/activity/NewWebActivity.kt
View file @
26c7abff
...
...
@@ -19,12 +19,11 @@ import androidx.annotation.RequiresApi
import
androidx.coordinatorlayout.widget.CoordinatorLayout
import
com.bumptech.glide.Glide
import
com.umeng.analytics.MobclickAgent
import
com.ym.library.Constant
import
com.ym.library.
My
Constant
import
com.ym.library.R
import
com.ym.library.activity.contract.NewWebContract
import
com.ym.library.activity.presenter.NewWebPresenter
import
com.ym.library.module.ReportEntity
import
com.ym.library.net.BaseActivity
import
com.ym.library.net.MyBaseActivity
import
com.ym.library.rxbus.RxBusConstant
import
com.ym.library.rxbus.RxBusConstant.RX_MAIN_WATER_DROP_UPDATE
import
com.ym.library.rxbus.RxBusUtil
...
...
@@ -36,7 +35,7 @@ import kotlinx.android.synthetic.main.activity_new_web.*
/**
* Created by gaoleichao on 2019/4/22
*/
class
NewWebActivity
:
BaseActivity
(),
NewWebContract
.
View
,
ScrollWebView
.
OnScrollChangeListener
,
class
NewWebActivity
:
My
BaseActivity
(),
NewWebContract
.
View
,
ScrollWebView
.
OnScrollChangeListener
,
DownloadListener
,
View
.
OnClickListener
{
...
...
@@ -146,7 +145,7 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
// showCoins(coins)
isAdds
=
true
var
text
=
"阅读奖励 金币+"
+
coins
if
(
Constant
.
kkz_award_render_type
==
1
)
{
if
(
My
Constant
.
kkz_award_render_type
==
1
)
{
CenterDialog
.
showDialogReadCoins
(
this
,
coins
,
value
,
object
:
View
.
OnClickListener
{
override
fun
onClick
(
v
:
View
?)
{
isAdds
=
false
...
...
library/src/main/java/com/ym/library/activity/WebActivity.kt
View file @
26c7abff
...
...
@@ -25,7 +25,7 @@ import com.ym.library.module.CoinEntity
import
com.ym.library.module.NewsEntity
import
com.ym.library.module.TaskEntity
import
com.ym.library.net.ApiClient
import
com.ym.library.net.BaseActivity
import
com.ym.library.net.
My
BaseActivity
import
com.ym.library.net.BaseObserver
import
com.ym.library.net.RxSchedulers
import
com.ym.library.rxbus.RxBusConstant
...
...
@@ -41,7 +41,7 @@ import java.util.regex.Pattern
* Created by gaoleichao on 2018/5/8.
*/
class
WebActivity
:
BaseActivity
(),
View
.
OnClickListener
{
class
WebActivity
:
My
BaseActivity
(),
View
.
OnClickListener
{
private
val
TAG
=
"WebActivity"
...
...
library/src/main/java/com/ym/library/activity/WebViewActivity.java
View file @
26c7abff
package
com
.
ym
.
library
.
activity
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.os.Build
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.webkit.WebSettings
;
import
android.webkit.WebView
;
import
android.webkit.WebViewClient
;
import
android.widget.LinearLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
com.umeng.analytics.MobclickAgent
;
import
com.ym.library.R
;
import
com.ym.library.net.BaseActivity
;
import
com.ym.library.rxbus.RxBusConstant
;
import
com.ym.library.rxbus.RxBusUtil
;
import
com.ym.library.net.MyBaseActivity
;
import
com.ym.library.utils.StatusBarUtil
;
import
org.jetbrains.annotations.NotNull
;
import
static
com
.
ym
.
library
.
rxbus
.
RxBusConstant
.
RX_MAIN_WATER_DROP_UPDATE
;
public
class
WebViewActivity
extends
BaseActivity
{
public
class
WebViewActivity
extends
MyBaseActivity
{
private
String
url
;
private
String
title
;
...
...
library/src/main/java/com/ym/library/activity/XiaoManActivity.kt
View file @
26c7abff
package
com.ym.library.activity
import
android.os.SystemClock
import
android.util.Log
import
com.bx.adsdk.CampaignCallback
import
com.bx.adsdk.CampaignFragment
import
com.bytedance.sdk.openadsdk.*
...
...
@@ -11,16 +10,13 @@ import com.qq.e.ads.rewardvideo.RewardVideoADListener
import
com.qq.e.comm.managers.GDTADManager
import
com.qq.e.comm.util.AdError
import
com.umeng.analytics.MobclickAgent
import
com.ym.library.Constant
import
com.ym.library.R
import
com.ym.library.module.ReportEntity
import
com.ym.library.net.*
import
com.ym.library.utils.EventUtils
import
com.ym.library.utils.SettingPreference
import
com.ym.library.utils.Utils
import
com.ym.modulecommon.utils.AdPreference
import
kotlinx.android.synthetic.main.activity_xiaoman.*
class
XiaoManActivity
:
BaseActivity
()
{
class
XiaoManActivity
:
My
BaseActivity
()
{
override
fun
layoutID
():
Int
=
R
.
layout
.
activity_xiaoman
...
...
@@ -35,7 +31,7 @@ class XiaoManActivity : BaseActivity() {
* @param placeId 资源位id:必传
* @param callback CampaignCallback 回调
*/
campaignFragment
=
CampaignFragment
.
newInstance
(
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getToken
())
campaignFragment
=
CampaignFragment
.
newInstance
(
Ad
Preference
.
getToken
())
campaignFragment
?.
setPlaceId
(
"2773"
)
campaignFragment
?.
setCallback
(
object
:
CampaignCallback
()
{
override
fun
showAd
(
params
:
String
)
{
...
...
library/src/main/java/com/ym/library/base/BaseDialog.kt
View file @
26c7abff
...
...
@@ -5,8 +5,8 @@ import android.content.Context
import
android.view.Gravity
import
android.view.View
import
android.view.ViewGroup
import
com.ym.library.utils.PhoneUtils
import
com.ym.modulecommon.AppliContext
import
com.ym.modulecommon.utils.PhoneUtils
/**
* Created by gaoleichao on 2020-06-03
...
...
library/src/main/java/com/ym/library/down/UpdateVersionPresenter.kt
View file @
26c7abff
...
...
@@ -8,14 +8,14 @@ import android.os.Build
import
android.os.Environment
import
android.text.TextUtils
import
android.util.Log
import
com.ym.library.Constant
import
com.ym.library.
My
Constant
import
com.ym.library.module.VersionEntity
import
com.ym.library.net.BaseObserver
import
com.ym.library.net.RxSchedulers
import
com.ym.library.utils.PhoneUtils
import
com.ym.library.utils.SettingPreference
import
com.ym.library.utils.Utils
import
com.ym.modulecommon.AppliContext
import
com.ym.modulecommon.utils.PhoneUtils
import
io.reactivex.disposables.Disposable
import
java.util.concurrent.Executors
import
java.util.concurrent.ScheduledExecutorService
...
...
@@ -68,7 +68,7 @@ class UpdateVersionPresenter : UpdateVersionContract.Presenter {
request
.
setDestinationInExternalFilesDir
(
AppliContext
.
get
(),
Environment
.
DIRECTORY_DOWNLOADS
,
Constant
.
Param
.
mPacketName
+
".apk"
My
Constant
.
Param
.
mPacketName
+
".apk"
)
request
.
setNotificationVisibility
(
DownloadManager
.
Request
.
VISIBILITY_VISIBLE
or
DownloadManager
.
Request
.
VISIBILITY_VISIBLE_NOTIFY_COMPLETED
)
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
{
...
...
@@ -80,7 +80,7 @@ class UpdateVersionPresenter : UpdateVersionContract.Presenter {
//表示允许MediaScanner扫描到这个文件,默认不允许。
request
.
allowScanningByMediaScanner
()
}
request
.
setTitle
(
Constant
.
Param
.
mPacketName
)
request
.
setTitle
(
My
Constant
.
Param
.
mPacketName
)
request
.
setMimeType
(
"application/vnd.android.package-archive"
)
downloadId
=
downloadManager
.
enqueue
(
request
)
if
(
scheduledExecutorService
==
null
)
{
...
...
library/src/main/java/com/ym/library/down/VersionClient.kt
View file @
26c7abff
package
com.ym.library.down
import
com.ym.library.Constant
import
com.ym.library.
My
Constant
import
com.ym.library.net.IUserApi
import
com.ym.library.net.NetConfig
import
com.ym.library.utils.LogUtils
import
com.ym.library.utils.PhoneUtils
import
com.ym.library.utils.SettingPreference
import
com.ym.modulecommon.utils.AdPreference
import
okhttp3.Interceptor
import
okhttp3.logging.HttpLoggingInterceptor
import
retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
...
...
@@ -40,9 +38,9 @@ object VersionClient {
// builder.addHeader("User-Agent", SettingPreference.getUserAgent())
// }
// if (request.url().host().toString().contains("zhangxinhulian.com")) {
builder
.
addHeader
(
Constant
.
aid
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getAndroidId
())
builder
.
addHeader
(
MyConstant
.
aid
,
Ad
Preference
.
getAndroidId
())
LogUtils
.
e
(
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getAndroidId
())
LogUtils
.
e
(
Ad
Preference
.
getAndroidId
())
// }
chain
.
proceed
(
builder
.
build
())
}
...
...
library/src/main/java/com/ym/library/module/UserInfoEntity.kt
0 → 100644
View file @
26c7abff
package
com.ym.ddhy
import
java.io.Serializable
/**
* Created by Antonio on 2019/6/12.
*/
class
UserInfoEntity
:
Serializable
{
var
uid
:
String
?
=
""
var
token
:
String
?
=
""
var
successMsg
:
String
?
=
""
var
diamond
:
Diamond
?
=
null
var
receiveCoins
:
Int
?
=
0
//待领取金币
var
avaCent
:
Double
=
0.0
//可用金额(分)
var
avaYuan
:
Double
=
0.0
//可用金额 (元)
var
avaCoin
:
Int
=
0
//可用金币
var
coinRate
:
Int
=
0
//比例
var
title
:
String
=
""
var
mind
:
String
=
""
class
Diamond
{
var
value
:
Int
=
0
var
cash
:
String
=
""
}
var
headImage
:
String
?
=
""
//头像
var
nickname
:
String
?
=
""
//昵称
var
sex
:
String
?
=
""
//性别
var
phoneNo
:
String
?
=
""
//手机号
var
availCoins
:
Int
?
=
0
//可用金币
var
headimgurl
:
String
?
=
""
//头像
var
coins
:
Int
?
=
0
var
newAwardFlag
:
Int
=
0
var
memberType
:
Int
=
0
var
isTourist
:
Int
?
=
0
var
isMember
:
Boolean
=
false
var
weight
:
String
?
=
""
var
height
:
String
?
=
""
var
gaodeTrackId
:
Long
?
=
0
var
gaodeTerminalId
:
Long
?
=
0
var
age
:
String
?
=
""
var
memberEndTime
:
String
?
=
""
var
appIcon
:
String
?
=
""
var
shareCode
:
String
?
=
""
var
task
:
String
?
=
""
//是否有任务通知
var
isBindPhone
:
Boolean
?
=
false
//是否绑定手机
var
isBind
:
Boolean
?
=
false
//是否绑定微信
var
isBindWxPayOpenid
:
Boolean
?
=
false
//微信提现授权
}
\ No newline at end of file
library/src/main/java/com/ym/library/net/AdUpload.kt
View file @
26c7abff
...
...
@@ -6,7 +6,8 @@ import com.ym.commen.module.VideoEntity
import
com.ym.library.module.NewsEntity
import
com.ym.library.module.NovelEntity
import
com.ym.library.module.ReportAd
import
com.ym.library.utils.PhoneUtils
import
com.ym.library.utils.MyPhoneUtils
import
com.ym.modulecommon.utils.PhoneUtils
import
io.reactivex.schedulers.Schedulers
import
org.jetbrains.anko.doAsync
import
java.lang.StringBuilder
...
...
@@ -28,7 +29,7 @@ object AdUpload {
newsEntity
.
isDeeplinkSuc
=
true
if
(
newsEntity
?.
deeplinkSucc
!=
null
&&
newsEntity
?.
deeplinkSucc
?.
size
?:
0
>
0
)
{
for
(
i
in
0
until
newsEntity
?.
deeplinkSucc
?.
size
!!
)
{
var
newUrl
:
String
=
PhoneUtils
.
replaceUrl
(
newsEntity
?.
deeplinkSucc
!!
[
i
],
newsEntity
)
var
newUrl
:
String
=
My
PhoneUtils
.
replaceUrl
(
newsEntity
?.
deeplinkSucc
!!
[
i
],
newsEntity
)
apiClient
(
newUrl
,
newsEntity
,
i
,
""
)
}
}
...
...
@@ -45,7 +46,7 @@ object AdUpload {
newsEntity
.
isDeeplinkSuc
=
true
if
(
newsEntity
?.
deeplinkSucc
!=
null
&&
newsEntity
?.
deeplinkSucc
?.
size
?:
0
>
0
)
{
for
(
i
in
0
until
newsEntity
?.
deeplinkSucc
?.
size
!!
)
{
var
newUrl
:
String
=
PhoneUtils
.
replaceUrl
(
newsEntity
?.
deeplinkSucc
!!
[
i
],
newsEntity
)
var
newUrl
:
String
=
My
PhoneUtils
.
replaceUrl
(
newsEntity
?.
deeplinkSucc
!!
[
i
],
newsEntity
)
apiClient
(
newUrl
,
null
,
i
,
""
)
}
}
...
...
@@ -62,7 +63,7 @@ object AdUpload {
entity
?.
isShow
=
true
if
(
entity
?.
imp_tracking
!=
null
&&
entity
?.
imp_tracking
?.
size
?:
0
>
0
)
{
for
(
i
in
0
until
entity
?.
imp_tracking
?.
size
!!
)
{
var
newUrl
:
String
=
PhoneUtils
.
replaceUrl
(
entity
?.
imp_tracking
!!
[
i
],
entity
)
var
newUrl
:
String
=
My
PhoneUtils
.
replaceUrl
(
entity
?.
imp_tracking
!!
[
i
],
entity
)
apiClient
(
newUrl
,
entity
,
i
,
""
)
}
}
...
...
@@ -79,7 +80,7 @@ object AdUpload {
newsEntity
.
isClick
=
true
if
(
newsEntity
?.
clk_tracking
!=
null
&&
newsEntity
?.
clk_tracking
?.
size
?:
0
>
0
)
{
for
(
i
in
0
until
newsEntity
?.
clk_tracking
?.
size
!!
)
{
var
newUrl
:
String
=
PhoneUtils
.
replaceUrl
(
newsEntity
?.
clk_tracking
!!
[
i
],
newsEntity
)
var
newUrl
:
String
=
My
PhoneUtils
.
replaceUrl
(
newsEntity
?.
clk_tracking
!!
[
i
],
newsEntity
)
apiClient
(
newUrl
,
newsEntity
,
i
,
""
)
}
}
...
...
@@ -95,7 +96,7 @@ object AdUpload {
if
(!
data
.
isDowanload
)
{
data
.
isDowanload
=
true
data
?.
startDownload
?.
forEach
{
apiClient
(
PhoneUtils
.
replaceUrl
(
it
,
data
),
null
,
0
,
""
)
apiClient
(
My
PhoneUtils
.
replaceUrl
(
it
,
data
),
null
,
0
,
""
)
}
}
}
...
...
@@ -109,7 +110,7 @@ object AdUpload {
if
(!
data
.
isDowanloadSuc
)
{
data
.
isDowanloadSuc
=
true
data
?.
downloadSucc
?.
forEach
{
apiClient
(
PhoneUtils
.
replaceUrl
(
it
,
data
),
null
,
0
,
""
)
apiClient
(
My
PhoneUtils
.
replaceUrl
(
it
,
data
),
null
,
0
,
""
)
}
}
}
...
...
@@ -123,7 +124,7 @@ object AdUpload {
if
(!
data
.
isInstall
)
{
data
.
isInstall
=
true
data
?.
startInstall
?.
forEach
{
apiClient
(
PhoneUtils
.
replaceUrl
(
it
,
data
),
null
,
0
,
""
)
apiClient
(
My
PhoneUtils
.
replaceUrl
(
it
,
data
),
null
,
0
,
""
)
}
}
}
...
...
@@ -139,7 +140,7 @@ object AdUpload {
if
(
entity
?.
imp_tracking
!=
null
&&
entity
?.
imp_tracking
?.
size
?:
0
>
0
)
{
for
(
i
in
0
until
entity
?.
imp_tracking
?.
size
!!
)
{
Log
.
d
(
"onAdImpression"
,
"slotName:"
+
entity
?.
slot_id
)
var
newUrl
:
String
=
PhoneUtils
.
replaceUrl
(
entity
?.
imp_tracking
!!
[
i
],
entity
)
var
newUrl
:
String
=
My
PhoneUtils
.
replaceUrl
(
entity
?.
imp_tracking
!!
[
i
],
entity
)
apiClient
(
newUrl
,
null
,
i
,
""
)
}
}
...
...
@@ -157,7 +158,7 @@ object AdUpload {
if
(
entity
?.
imp_tracking
!=
null
&&
entity
?.
imp_tracking
?.
size
?:
0
>
0
)
{
for
(
i
in
0
until
entity
?.
imp_tracking
?.
size
!!
)
{
// Log.d("onAdImpression", "slotName:" + entity?.slot_id)
var
newUrl
:
String
=
PhoneUtils
.
replaceUrl
(
entity
?.
imp_tracking
!!
[
i
],
entity
)
var
newUrl
:
String
=
My
PhoneUtils
.
replaceUrl
(
entity
?.
imp_tracking
!!
[
i
],
entity
)
apiClient
(
newUrl
,
null
,
i
,
""
)
}
}
...
...
@@ -218,7 +219,7 @@ object AdUpload {
newsEntity
.
isClick
=
true
if
(
newsEntity
?.
clk_tracking
!=
null
&&
newsEntity
?.
clk_tracking
?.
size
?:
0
>
0
)
{
for
(
i
in
0
until
newsEntity
?.
clk_tracking
?.
size
!!
)
{
var
newUrl
:
String
=
PhoneUtils
.
replaceUrl
(
newsEntity
?.
clk_tracking
!!
[
i
],
newsEntity
)
var
newUrl
:
String
=
My
PhoneUtils
.
replaceUrl
(
newsEntity
?.
clk_tracking
!!
[
i
],
newsEntity
)
Log
.
d
(
"glc"
,
newUrl
)
apiClient
(
newUrl
,
null
,
i
,
""
)
}
...
...
library/src/main/java/com/ym/library/net/ApiClient.kt
View file @
26c7abff
...
...
@@ -2,10 +2,10 @@ package com.ym.library.net
import
android.text.TextUtils
import
com.ym.library.BuildConfig
import
com.ym.library.Constant
import
com.ym.library.
My
Constant
import
com.ym.modulecommon.net.NetConfig
import
com.ym.modulecommon.utils.AdPreference
import
com.ym.modulecommon.utils.PhoneUtils
import
com.ym.modulecommon.utils.SettingPreference
import
okhttp3.Interceptor
import
okhttp3.Request
import
okhttp3.logging.HttpLoggingInterceptor
...
...
@@ -34,12 +34,12 @@ object ApiClient {
private
val
headInterceptor
=
Interceptor
{
chain
->
val
request
=
chain
.
request
()
val
builder
=
request
.
newBuilder
()
builder
.
addHeader
(
Constant
.
aid
,
Setting
Preference
.
getAndroidId
())
builder
.
addHeader
(
Constant
.
Device
.
env
,
Constant
.
Param
.
env
)
if
(!
TextUtils
.
isEmpty
(
Setting
Preference
.
getUserAgent
()))
{
builder
.
addHeader
(
"web-user-agent"
,
Setting
Preference
.
getUserAgent
())
builder
.
addHeader
(
MyConstant
.
aid
,
Ad
Preference
.
getAndroidId
())
builder
.
addHeader
(
MyConstant
.
Device
.
env
,
My
Constant
.
Param
.
env
)
if
(!
TextUtils
.
isEmpty
(
Ad
Preference
.
getUserAgent
()))
{
builder
.
addHeader
(
"web-user-agent"
,
Ad
Preference
.
getUserAgent
())
builder
.
removeHeader
(
"User-Agent"
)
builder
.
addHeader
(
"User-Agent"
,
Setting
Preference
.
getUserAgent
())
builder
.
addHeader
(
"User-Agent"
,
Ad
Preference
.
getUserAgent
())
}
val
headers
:
Request
=
builder
.
build
()
chain
.
proceed
(
headers
)
...
...
library/src/main/java/com/ym/library/net/BaseActivity.java
deleted
100644 → 0
View file @
c8b17f94
package
com
.
ym
.
library
.
net
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.pm.ActivityInfo
;
import
android.content.res.Configuration
;
import
android.content.res.Resources
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.provider.Settings
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.view.inputmethod.InputMethodManager
;
import
androidx.annotation.Nullable
;
import
com.gyf.immersionbar.ImmersionBar
;
import
com.gyf.immersionbar.OnNavigationBarListener
;
import
com.trello.rxlifecycle2.components.support.RxAppCompatActivity
;
import
com.umeng.analytics.MobclickAgent
;
import
com.ym.library.Constant
;
import
com.ym.library.module.ReportEntity
;
import
com.ym.library.rxbus.RxBusUtil
;
import
com.ym.library.utils.EventUtils
;
import
com.ym.library.utils.Utils
;
/**
* Created by gaoleichao on 2019/4/17
*/
public
abstract
class
BaseActivity
extends
RxAppCompatActivity
{
public
abstract
int
layoutID
();
// public abstract Context context();
public
Activity
activity
(){
return
this
;
}
public
String
className
()
{
return
activity
().
getClass
().
getSimpleName
();
}
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setRequestedOrientation
(
ActivityInfo
.
SCREEN_ORIENTATION_PORTRAIT
);
// 禁用横屏
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_SECURE
);
RxBusUtil
.
getDefault
().
register
(
this
);
before
();
if
(
layoutID
()
!=
0
)
{
setContentView
(
layoutID
());
}
after
();
init
(
savedInstanceState
);
init
();
data
();
}
public
void
before
()
{
// baseHandler = new WeakHandler();
// StatusBarUtil.setTranslucent(this);
}
protected
void
after
()
{
ImmersionBar
.
with
(
this
).
setOnNavigationBarListener
(
new
OnNavigationBarListener
()
{
@Override
public
void
onNavigationBarChange
(
boolean
show
)
{
}
}).
init
();
}
public
abstract
void
init
();
public
void
data
()
{
}
public
void
init
(
@Nullable
Bundle
savedInstanceState
)
{
}
// protected WeakHandler baseHandler;
protected
boolean
mIsNeedGoneNavigationBar
=
false
;
@Override
protected
void
onResume
()
{
super
.
onResume
();
if
(
activity
()
!=
null
)
{
MobclickAgent
.
onResume
(
activity
());
}
if
(
className
()
!=
null
)
{
Log
.
d
(
"BaseActivity"
,
"onResume ="
+
className
());
EventUtils
.
INSTANCE
.
onEvent
(
"page_status"
,
Utils
.
obj2Str
(
new
ReportEntity
(
Constant
.
ReportSessionId
,
className
(),
"onResume"
)));
}
}
@Override
protected
void
onPause
()
{
super
.
onPause
();
if
(
className
()
!=
null
)
{
Log
.
d
(
"BaseActivity"
,
"onPause ="
+
className
());
EventUtils
.
INSTANCE
.
onEvent
(
"page_status"
,
Utils
.
obj2Str
(
new
ReportEntity
(
Constant
.
ReportSessionId
,
className
(),
"onPause"
)));
}
if
(
activity
()
!=
null
)
{
MobclickAgent
.
onPause
(
activity
());
}
}
/**
* 设置是否隐藏导航栏
*
* @param isNeed
*/
protected
void
setNeedGoneNavigationBar
(
boolean
isNeed
)
{
// mIsNeedGoneNavigationBar = isNeed;
// if (mIsNeedGoneNavigationBar) {
// baseHandler.postDelayed(mHideRunnable, 200);
// final View decorView = getWindow().getDecorView();
// decorView.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
// @Override
// public void onSystemUiVisibilityChange(int visibility) {
// decorView.requestLayout();
//
// }
// });
// }
}
// protected Runnable mHideRunnable = new Runnable() {
// @Override
// public void run() {
// int flags;
// int curApiVersion = Build.VERSION.SDK_INT;
// // This work only for android 4.4+
// if (curApiVersion >= Build.VERSION_CODES.KITKAT) {
// // This work only for android 4.4+
// // hide navigation bar permanently in android activity
// // touch the screen, the navigation bar will not show
// flags = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE;
//// | View.SYSTEM_UI_FLAG_FULLSCREEN;
//
// } else {
// // touch the screen, the navigation bar will show
// flags = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
// }
//
// // must be executed in main thread :)
// getWindow().getDecorView().setSystemUiVisibility(flags);
// }
// };
public
void
openActivity
(
Class
pClass
)
{
openActivity
(
pClass
,
null
);
}
public
void
openActivity
(
Class
pClass
,
Bundle
pBundle
)
{
Intent
intent
=
new
Intent
(
this
,
pClass
);
if
(
pBundle
!=
null
)
{
intent
.
putExtras
(
pBundle
);
}
startActivity
(
intent
);
}
/**
* 设置屏幕亮度
*
* @param context
* @param brightness 1-255
*/
public
void
changeAppBrightness
(
Context
context
,
int
brightness
)
{
Window
window
=
((
Activity
)
context
).
getWindow
();
WindowManager
.
LayoutParams
lp
=
window
.
getAttributes
();
if
(
brightness
==
-
1
)
{
lp
.
screenBrightness
=
WindowManager
.
LayoutParams
.
BRIGHTNESS_OVERRIDE_NONE
;
}
else
{
Log
.
d
(
"glc"
,
"brightness:"
+
brightness
);
lp
.
screenBrightness
=
(
brightness
<=
0
?
1
:
brightness
)
/
255
f
;
;
}
window
.
setAttributes
(
lp
);
}
public
int
getAppBrightness
()
{
int
systemBrightness
=
0
;
try
{
systemBrightness
=
Settings
.
System
.
getInt
(
getContentResolver
(),
Settings
.
System
.
SCREEN_BRIGHTNESS
);
}
catch
(
Settings
.
SettingNotFoundException
e
)
{
e
.
printStackTrace
();
}
return
systemBrightness
;
}
// 隐藏键盘
public
void
hideKeyBoard
()
{
try
{
((
InputMethodManager
)
getSystemService
(
INPUT_METHOD_SERVICE
)).
hideSoftInputFromWindow
(
this
.
getCurrentFocus
().
getWindowToken
(),
InputMethodManager
.
HIDE_NOT_ALWAYS
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
// 显示键盘
public
void
showKeyBoard
(
View
view
)
{
try
{
((
InputMethodManager
)
getSystemService
(
INPUT_METHOD_SERVICE
)).
showSoftInput
(
view
,
0
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
public
void
hideNavigationBar
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
// 全屏显示,隐藏状态栏和导航栏,拉出状态栏和导航栏显示一会儿后消失。
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
|
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
View
.
SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
View
.
SYSTEM_UI_FLAG_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_IMMERSIVE_STICKY
);
}
else
{
// 全屏显示,隐藏状态栏
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_FULLSCREEN
);
}
}
}
// @Override
// protected void onResume() {
// super.onResume();
// MobclickAgent.onResume(context());
// }
// @Override
// protected void onPause() {
// super.onPause();
// MobclickAgent.onPause(context());
// }
@Override
protected
void
onDestroy
()
{
super
.
onDestroy
();
// Glide.get(AppliContext.get()).clearMemory();
RxBusUtil
.
getDefault
().
unregister
(
this
);
}
@Override
public
Resources
getResources
()
{
Resources
res
=
super
.
getResources
();
Configuration
config
=
new
Configuration
();
config
.
setToDefaults
();
res
.
updateConfiguration
(
config
,
res
.
getDisplayMetrics
());
return
res
;
}
}
library/src/main/java/com/ym/library/net/EventApiClient.kt
View file @
26c7abff
package
com.ym.library.net;
import
com.ym.library.Constant
import
com.ym.library.utils.PhoneUtils
import
com.ym.library.utils.SettingPreference
import
com.ym.library.MyConstant
import
com.ym.modulecommon.net.NetConfig
import
com.ym.modulecommon.utils.AdPreference
import
com.ym.modulecommon.utils.PhoneUtils
import
okhttp3.Interceptor
import
okhttp3.Request
import
okhttp3.logging.HttpLoggingInterceptor
...
...
@@ -33,7 +33,7 @@ object EventApiClient {
val
request
=
chain
.
request
()
val
builder
=
request
.
newBuilder
()
// PhoneUtils.addHeader(builder)
builder
.
addHeader
(
Constant
.
aid
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getAndroidId
())
builder
.
addHeader
(
MyConstant
.
aid
,
Ad
Preference
.
getAndroidId
())
val
headers
:
Request
=
builder
.
build
()
chain
.
proceed
(
headers
)
}
...
...
library/src/main/java/com/ym/library/net/GameApiClient.kt
View file @
26c7abff
...
...
@@ -2,10 +2,10 @@ package com.ym.library.net
import
android.text.TextUtils
import
com.ym.library.BuildConfig
import
com.ym.library.Constant
import
com.ym.library.
My
Constant
import
com.ym.modulecommon.net.NetConfig
import
com.ym.modulecommon.utils.AdPreference
import
com.ym.modulecommon.utils.PhoneUtils
import
com.ym.modulecommon.utils.SettingPreference
import
okhttp3.Interceptor
import
okhttp3.Request
import
okhttp3.logging.HttpLoggingInterceptor
...
...
@@ -36,12 +36,12 @@ object GameApiClient {
private
val
headInterceptor
=
Interceptor
{
chain
->
val
request
=
chain
.
request
()
val
builder
=
request
.
newBuilder
()
builder
.
addHeader
(
Constant
.
aid
,
Setting
Preference
.
getAndroidId
())
builder
.
addHeader
(
Constant
.
Device
.
env
,
Constant
.
Param
.
env
)
if
(!
TextUtils
.
isEmpty
(
Setting
Preference
.
getUserAgent
()))
{
builder
.
addHeader
(
"web-user-agent"
,
Setting
Preference
.
getUserAgent
())
builder
.
addHeader
(
MyConstant
.
aid
,
Ad
Preference
.
getAndroidId
())
builder
.
addHeader
(
MyConstant
.
Device
.
env
,
My
Constant
.
Param
.
env
)
if
(!
TextUtils
.
isEmpty
(
Ad
Preference
.
getUserAgent
()))
{
builder
.
addHeader
(
"web-user-agent"
,
Ad
Preference
.
getUserAgent
())
builder
.
removeHeader
(
"User-Agent"
)
builder
.
addHeader
(
"User-Agent"
,
Setting
Preference
.
getUserAgent
())
builder
.
addHeader
(
"User-Agent"
,
Ad
Preference
.
getUserAgent
())
}
val
headers
:
Request
=
builder
.
build
()
chain
.
proceed
(
headers
)
...
...
library/src/main/java/com/ym/library/net/IUserApi.kt
View file @
26c7abff
package
com.ym.library.net
import
com.ym.ddhy.UserInfoEntity
import
com.ym.library.module.*
import
com.ym.modulecommon.module.UserInfoEntity
import
io.reactivex.Observable
import
okhttp3.ResponseBody
import
retrofit2.http.*
...
...
library/src/main/java/com/ym/library/net/MyBaseActivity.java
0 → 100644
View file @
26c7abff
package
com
.
ym
.
library
.
net
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.pm.ActivityInfo
;
import
android.content.res.Configuration
;
import
android.content.res.Resources
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.provider.Settings
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.view.inputmethod.InputMethodManager
;
import
androidx.annotation.Nullable
;
import
com.gyf.immersionbar.ImmersionBar
;
import
com.gyf.immersionbar.OnNavigationBarListener
;
import
com.umeng.analytics.MobclickAgent
;
import
com.ym.library.MyConstant
;
import
com.ym.library.module.ReportEntity
;
import
com.ym.library.rxbus.RxBusUtil
;
import
com.ym.library.utils.EventUtils
;
import
com.ym.library.utils.Utils
;
import
com.ym.modulecommon.base.BaseActivity
;
/**
* Created by gaoleichao on 2019/4/17
*/
public
abstract
class
MyBaseActivity
extends
BaseActivity
{
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
RxBusUtil
.
getDefault
().
register
(
this
);
}
@Override
protected
void
onDestroy
()
{
super
.
onDestroy
();
RxBusUtil
.
getDefault
().
unregister
(
this
);
}
}
library/src/main/java/com/ym/library/net/PermissionsActivity.java
View file @
26c7abff
...
...
@@ -7,7 +7,6 @@ import android.net.Uri;
import
android.os.Bundle
;
import
android.provider.Settings
;
import
android.text.TextUtils
;
import
android.view.KeyEvent
;
import
android.view.View
;
import
android.view.WindowManager
;
...
...
@@ -18,7 +17,7 @@ import androidx.core.app.ActivityCompat;
import
com.badoo.mobile.util.WeakHandler
;
import
com.umeng.analytics.MobclickAgent
;
import
com.ym.library.Constant
;
import
com.ym.library.
My
Constant
;
import
com.ym.library.R
;
import
com.ym.library.utils.CenterDialog
;
import
com.ym.library.utils.Utils
;
...
...
@@ -37,7 +36,7 @@ public class PermissionsActivity extends Activity {
private
static
final
int
PERMISSION_REQUEST_CODE
=
0
;
// 系统权限管理页面的参数
public
static
final
String
EXTRA_PERMISSIONS
=
Constant
.
Param
.
mPacketName
+
".permission.extra_permission"
;
// 权限参数
public
static
final
String
EXTRA_PERMISSIONS
=
My
Constant
.
Param
.
mPacketName
+
".permission.extra_permission"
;
// 权限参数
private
static
final
String
PACKAGE_URL_SCHEME
=
"package:"
;
// 方案
private
boolean
isRequireCheck
;
// 是否需要系统权限检测
...
...
@@ -116,13 +115,13 @@ public class PermissionsActivity extends Activity {
String
insertStr
=
""
;
List
<
String
>
list
=
Utils
.
noPermissions
(
getPermissions
());
for
(
String
str
:
list
)
{
if
(
TextUtils
.
equals
(
str
,
Constant
.
Permission
.
PERMISSION_STORAGE
))
{
if
(
TextUtils
.
equals
(
str
,
My
Constant
.
Permission
.
PERMISSION_STORAGE
))
{
insertStr
+=
getString
(
R
.
string
.
permission_sdcard_str
);
}
else
if
(
TextUtils
.
equals
(
str
,
Constant
.
Permission
.
PERMISSION_PHONE
))
{
}
else
if
(
TextUtils
.
equals
(
str
,
My
Constant
.
Permission
.
PERMISSION_PHONE
))
{
insertStr
+=
getString
(
R
.
string
.
permission_phone_str
);
}
else
if
(
TextUtils
.
equals
(
str
,
Constant
.
Permission
.
PERMISSION_COARSE_LOCATION
))
{
}
else
if
(
TextUtils
.
equals
(
str
,
My
Constant
.
Permission
.
PERMISSION_COARSE_LOCATION
))
{
insertStr
+=
getString
(
R
.
string
.
permission_soarse_location_str
);
}
else
if
(
TextUtils
.
equals
(
str
,
Constant
.
Permission
.
PERMISSION_FINE_LOCATION
))
{
}
else
if
(
TextUtils
.
equals
(
str
,
My
Constant
.
Permission
.
PERMISSION_FINE_LOCATION
))
{
insertStr
+=
getString
(
R
.
string
.
permission_fine_location_str
);
}
}
...
...
library/src/main/java/com/ym/library/net/SplashPresenter.kt
View file @
26c7abff
This diff is collapsed.
Click to expand it.
library/src/main/java/com/ym/library/net/ZXADClient.kt
View file @
26c7abff
package
com.ym.library.net
import
android.text.TextUtils
import
com.ym.library.Constant
import
com.ym.library.utils.PhoneUtils
import
com.ym.library.utils.SettingPreference
import
com.ym.library.MyConstant
import
com.ym.modulecommon.net.NetConfig
import
com.ym.modulecommon.utils.AdPreference
import
okhttp3.Interceptor
import
okhttp3.Request
import
okhttp3.logging.HttpLoggingInterceptor
...
...
@@ -33,12 +32,12 @@ object ZXADClient {
private
val
headInterceptor
=
Interceptor
{
chain
->
val
request
=
chain
.
request
()
val
builder
=
request
.
newBuilder
()
builder
.
addHeader
(
Constant
.
aid
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getAndroidId
())
builder
.
addHeader
(
Constant
.
Device
.
env
,
Constant
.
Param
.
env
)
if
(!
TextUtils
.
isEmpty
(
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUserAgent
()))
{
builder
.
addHeader
(
"web-user-agent"
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUserAgent
())
builder
.
addHeader
(
MyConstant
.
aid
,
Ad
Preference
.
getAndroidId
())
builder
.
addHeader
(
MyConstant
.
Device
.
env
,
My
Constant
.
Param
.
env
)
if
(!
TextUtils
.
isEmpty
(
Ad
Preference
.
getUserAgent
()))
{
builder
.
addHeader
(
"web-user-agent"
,
Ad
Preference
.
getUserAgent
())
builder
.
removeHeader
(
"User-Agent"
)
builder
.
addHeader
(
"User-Agent"
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUserAgent
())
builder
.
addHeader
(
"User-Agent"
,
Ad
Preference
.
getUserAgent
())
}
val
headers
:
Request
=
builder
.
build
()
chain
.
proceed
(
headers
)
...
...
library/src/main/java/com/ym/library/router/RounterApi.kt
View file @
26c7abff
...
...
@@ -3,17 +3,17 @@ package com.ym.library.router
import
android.content.Intent
import
com.ym.commen.router.RounterParam
import
com.ym.commen.router.RounterUri
import
com.ym.library.Constant
import
com.ym.library.
My
Constant
/**
* Created by gaoleichao on 2018/12/8.
*/
interface
RounterApi
{
@RounterUri
(
Constant
.
scheme
+
"://login"
)
@RounterUri
(
My
Constant
.
scheme
+
"://login"
)
fun
getIntentActivityLogin
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://local_login"
)
@RounterUri
(
My
Constant
.
scheme
+
"://local_login"
)
fun
getIntentActivityLocalLogin
():
Intent
// @RounterUri(Constant.scheme + "://web")
...
...
@@ -22,41 +22,41 @@ interface RounterApi {
// @RounterParam("url") url: String
// ): Intent
@RounterUri
(
Constant
.
scheme
+
"://web"
)
@RounterUri
(
My
Constant
.
scheme
+
"://web"
)
fun
getIntentActivityWeb
(
@RounterParam
(
"title"
)
title
:
String
,
@RounterParam
(
"url"
)
url
:
String
,
@RounterParam
(
"showToolbar"
)
showToolbar
:
Boolean
):
Intent
@RounterUri
(
Constant
.
scheme
+
"://adshare"
)
@RounterUri
(
My
Constant
.
scheme
+
"://adshare"
)
fun
getIntentActivityAdShare
(
@RounterParam
(
"data"
)
data
:
String
):
Intent
@RounterUri
(
Constant
.
scheme
+
"://invite_code"
)
@RounterUri
(
My
Constant
.
scheme
+
"://invite_code"
)
fun
getIntentActivityInviteCode
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://read_and_timer"
)
@RounterUri
(
My
Constant
.
scheme
+
"://read_and_timer"
)
fun
getIntentActivityRead
(
@RounterParam
(
"type"
)
type
:
String
):
Intent
@RounterUri
(
Constant
.
scheme
+
"://click_ad"
)
@RounterUri
(
My
Constant
.
scheme
+
"://click_ad"
)
fun
getIntentActivityTaskNav
(
@RounterParam
(
"type"
)
type
:
String
):
Intent
@RounterUri
(
Constant
.
scheme
+
"://wechat_share"
)
@RounterUri
(
My
Constant
.
scheme
+
"://wechat_share"
)
fun
getIntentActivityAdShareList
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://collect"
)
@RounterUri
(
My
Constant
.
scheme
+
"://collect"
)
fun
getIntentActivityCollect
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://news_history"
)
@RounterUri
(
My
Constant
.
scheme
+
"://news_history"
)
fun
getIntentActivityNewsHistory
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://setting"
)
@RounterUri
(
My
Constant
.
scheme
+
"://setting"
)
fun
getIntentActivitySetting
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://message"
)
@RounterUri
(
My
Constant
.
scheme
+
"://message"
)
fun
getIntentActivityMessage
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://news_detail"
)
@RounterUri
(
My
Constant
.
scheme
+
"://news_detail"
)
fun
getIntentActivityNewsDatail
(
@RounterParam
(
"title"
)
title
:
String
,
@RounterParam
(
"url"
)
url
:
String
,
...
...
@@ -65,7 +65,7 @@ interface RounterApi {
@RounterParam
(
"tabid"
)
tabid
:
String
):
Intent
@RounterUri
(
Constant
.
scheme
+
"://video_detail"
)
@RounterUri
(
My
Constant
.
scheme
+
"://video_detail"
)
fun
getIntentActivityVideoDatail
(
@RounterParam
(
"videoId"
)
videoId
:
String
,
@RounterParam
(
"url"
)
url
:
String
,
...
...
@@ -74,28 +74,28 @@ interface RounterApi {
@RounterParam
(
"from"
)
from
:
String
):
Intent
@RounterUri
(
Constant
.
scheme
+
"://choice_city"
)
@RounterUri
(
My
Constant
.
scheme
+
"://choice_city"
)
fun
getIntentActivityChoiceCity
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://new_user_withdraw"
)
@RounterUri
(
My
Constant
.
scheme
+
"://new_user_withdraw"
)
fun
getIntentActivityNewUserWithdraw
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://withdraw"
)
@RounterUri
(
My
Constant
.
scheme
+
"://withdraw"
)
fun
getIntentActivityWithdraw
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://splash"
)
@RounterUri
(
My
Constant
.
scheme
+
"://splash"
)
fun
getIntentActivitySplash
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://main"
)
@RounterUri
(
My
Constant
.
scheme
+
"://main"
)
fun
getIntentActivityMain
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://redpackage"
)
@RounterUri
(
My
Constant
.
scheme
+
"://redpackage"
)
fun
getIntentActivityRedPackage
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://feedback"
)
@RounterUri
(
My
Constant
.
scheme
+
"://feedback"
)
fun
getIntentActivityFeedBack
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://videoplay"
)
@RounterUri
(
My
Constant
.
scheme
+
"://videoplay"
)
fun
getIntentActivityVideoPlay
(
@RounterParam
(
"url"
)
url
:
String
,
@RounterParam
(
"albumId"
)
albumId
:
String
...
...
@@ -108,7 +108,7 @@ interface RounterApi {
)
cChannel
:
String
):
Intent
@RounterUri
(
Constant
.
scheme
+
"://audioplay"
)
@RounterUri
(
My
Constant
.
scheme
+
"://audioplay"
)
fun
getIntentActivityAudioPlay
(
@RounterParam
(
"url"
)
url
:
String
,
@RounterParam
(
"albumId"
)
albumId
:
String
...
...
@@ -120,14 +120,14 @@ interface RounterApi {
@RounterParam
(
"jumpTag"
)
jumpTag
:
String
):
Intent
@RounterUri
(
Constant
.
scheme
+
"://search"
)
@RounterUri
(
My
Constant
.
scheme
+
"://search"
)
fun
getIntentActivitySearch
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://history"
)
@RounterUri
(
My
Constant
.
scheme
+
"://history"
)
fun
getIntentActivityHistory
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://starlist"
)
@RounterUri
(
My
Constant
.
scheme
+
"://starlist"
)
fun
getIntentActivityStarList
(
@RounterParam
(
"CChannel"
)
url
:
String
,
@RounterParam
(
"pid"
)
albumId
:
String
,
...
...
@@ -136,7 +136,7 @@ interface RounterApi {
):
Intent
@RounterUri
(
Constant
.
scheme
+
"://gather"
)
@RounterUri
(
My
Constant
.
scheme
+
"://gather"
)
fun
getIntentActivityGather
(
@RounterParam
(
"CChannel"
)
url
:
String
,
@RounterParam
(
"pid"
)
albumId
:
String
,
...
...
@@ -156,73 +156,73 @@ interface RounterApi {
):
Intent
@RounterUri
(
Constant
.
scheme
+
"://web"
)
@RounterUri
(
My
Constant
.
scheme
+
"://web"
)
fun
getIntentWeb
(
@RounterParam
(
"url"
)
url
:
String
,
@RounterParam
(
"title"
)
title
:
String
):
Intent
@RounterUri
(
Constant
.
scheme
+
"://baidu_video"
)
@RounterUri
(
My
Constant
.
scheme
+
"://baidu_video"
)
fun
getIntentBaiduVideo
(
@RounterParam
(
"url"
)
url
:
String
):
Intent
@RounterUri
(
Constant
.
scheme
+
"://withdrawcash"
)
@RounterUri
(
My
Constant
.
scheme
+
"://withdrawcash"
)
fun
getWithDrawCash
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://dialogpermission"
)
@RounterUri
(
My
Constant
.
scheme
+
"://dialogpermission"
)
fun
getDialogPermission
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://luckydraw"
)
@RounterUri
(
My
Constant
.
scheme
+
"://luckydraw"
)
fun
getIntentLuckyDraw
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://dimond_crash"
)
@RounterUri
(
My
Constant
.
scheme
+
"://dimond_crash"
)
fun
getIntentDimoneCrash
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://task_crash"
)
@RounterUri
(
My
Constant
.
scheme
+
"://task_crash"
)
fun
getIntentTaskCrash
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://coin_crash"
)
@RounterUri
(
My
Constant
.
scheme
+
"://coin_crash"
)
fun
getIntentCoinCrash
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://slotmachine"
)
@RounterUri
(
My
Constant
.
scheme
+
"://slotmachine"
)
fun
getIntentSlotMachine
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://incomingtelegram"
)
@RounterUri
(
My
Constant
.
scheme
+
"://incomingtelegram"
)
fun
getIntentIncomingTelegram
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://scraping_card"
)
@RounterUri
(
My
Constant
.
scheme
+
"://scraping_card"
)
fun
getIntentScratchCard
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://double_color"
)
@RounterUri
(
My
Constant
.
scheme
+
"://double_color"
)
fun
getIntentDoubleColor
(
@RounterParam
(
"ifnex"
)
ifnex
:
Boolean
):
Intent
@RounterUri
(
Constant
.
scheme
+
"://run_lottery"
)
@RounterUri
(
My
Constant
.
scheme
+
"://run_lottery"
)
fun
getIntentRunLottery
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://soundsearch"
)
@RounterUri
(
My
Constant
.
scheme
+
"://soundsearch"
)
fun
getIntentSoundSearch
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://shave"
)
@RounterUri
(
My
Constant
.
scheme
+
"://shave"
)
fun
getIntentShave
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://task"
)
@RounterUri
(
My
Constant
.
scheme
+
"://task"
)
fun
getIntentTask
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://gold_details"
)
@RounterUri
(
My
Constant
.
scheme
+
"://gold_details"
)
fun
getIntentGoldDetails
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://clockinwithdraw"
)
@RounterUri
(
My
Constant
.
scheme
+
"://clockinwithdraw"
)
fun
getIntentClockInWithdraw
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://welfare"
)
@RounterUri
(
My
Constant
.
scheme
+
"://welfare"
)
fun
getIntentWelfare
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://xiaoman"
)
@RounterUri
(
My
Constant
.
scheme
+
"://xiaoman"
)
fun
getIntentXiaoMan
(
@RounterParam
(
"title"
)
title
:
String
):
Intent
// intent.putExtra("url", url)
// intent.putExtra("title", title)
// intent.putExtra("slot_id", slot_id)
// intent.putExtra("sid", sid)
@RounterUri
(
Constant
.
scheme
+
"://new_web"
)
@RounterUri
(
My
Constant
.
scheme
+
"://new_web"
)
fun
getIntentReadH5
(
@RounterParam
(
"url"
)
url
:
String
,
@RounterParam
(
"title"
)
title
:
String
,
...
...
@@ -232,7 +232,7 @@ interface RounterApi {
)
sid
:
String
):
Intent
@RounterUri
(
Constant
.
scheme
+
"://ad_web"
)
@RounterUri
(
My
Constant
.
scheme
+
"://ad_web"
)
fun
getIntentAdWeb
(
@RounterParam
(
"incentive_level"
)
incentive_level
:
String
,
@RounterParam
(
"alert"
)
alert
:
String
,
...
...
@@ -246,12 +246,12 @@ interface RounterApi {
@RounterParam
(
"sid"
)
sid
:
String
):
Intent
@RounterUri
(
Constant
.
scheme
+
"://slot_machine_record"
)
@RounterUri
(
My
Constant
.
scheme
+
"://slot_machine_record"
)
fun
getIntentSlotMachineRecord
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://setting"
)
@RounterUri
(
My
Constant
.
scheme
+
"://setting"
)
fun
getIntentSetting
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://withdrawals_record"
)
@RounterUri
(
My
Constant
.
scheme
+
"://withdrawals_record"
)
fun
getIntentSWithdrawalsRecord
():
Intent
}
\ No newline at end of file
library/src/main/java/com/ym/library/utils/AdUtils.kt
View file @
26c7abff
...
...
@@ -14,6 +14,7 @@ import com.ym.library.net.BaseObserver
import
com.ym.library.net.GameApiClient
import
com.ym.library.net.RxSchedulers
import
com.ym.modulecommon.utils.LogUtils
import
com.ym.modulecommon.utils.PhoneUtils
object
AdUtils
{
val
TAG
=
"AdUtils"
...
...
library/src/main/java/com/ym/library/utils/CenterDialog.kt
View file @
26c7abff
...
...
@@ -3,12 +3,10 @@ package com.ym.library.utils
import
android.annotation.SuppressLint
import
android.app.Activity
import
android.app.Dialog
import
android.content.Context
import
android.content.DialogInterface
import
android.os.Build
import
android.os.CountDownTimer
import
android.text.TextUtils
import
android.util.Log
import
android.view.Gravity
import
android.view.View
import
android.webkit.WebView
...
...
@@ -16,9 +14,7 @@ import android.widget.FrameLayout
import
android.widget.ImageView
import
android.widget.TextView
import
androidx.annotation.RequiresApi
import
com.ym.admodule.config.AdManager
import
com.ym.admodule.config.ZXADSizeConfig
import
com.ym.library.Constant
import
com.ym.library.MyConstant
import
com.ym.library.R
import
com.ym.library.base.BaseDialog
import
com.ym.library.listener.AdCallback
...
...
@@ -53,7 +49,7 @@ object CenterDialog : BaseDialog() {
mDialog
.
setCanceledOnTouchOutside
(
true
)
mDialog
.
setOnDismissListener
{
SettingPreference
.
setCancelUpdateDate
(
activity
,
Utils
.
getNowDate
())
Constant
.
Switch
.
isShowUpdateDialoging
=
false
My
Constant
.
Switch
.
isShowUpdateDialoging
=
false
if
(
isShowLoginDialog
)
{
adCallback
?.
onResult
(
0
,
0
)
}
...
...
@@ -494,7 +490,7 @@ object CenterDialog : BaseDialog() {
if
(
activity
==
null
)
{
return
}
Constant
.
isDialogActivity
=
1
My
Constant
.
isDialogActivity
=
1
val
mDialog
=
Dialog
(
activity
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialogView
=
showBottomDialog
(
R
.
layout
.
dialog_sign_out_layout
,
activity
,
mDialog
,
0
,
Gravity
.
CENTER
)
...
...
library/src/main/java/com/ym/library/utils/FileUtils.kt
View file @
26c7abff
package
com.ym.library.utils
import
android.os.Environment
import
com.ym.library.Constant
import
com.ym.library.
My
Constant
import
com.ym.modulecommon.AppliContext
import
java.io.File
import
java.io.FileInputStream
...
...
@@ -181,7 +181,7 @@ object FileUtils {
var
photoDir
=
AppliContext
.
get
().
getExternalFilesDir
(
"photos"
)
var
path
=
if
(
photoDir
!=
null
)
photoDir
?.
absolutePath
else
Environment
.
getExternalStorageDirectory
().
absolutePath
+
File
.
separator
+
Constant
.
Param
.
mPacketName
+
File
.
separator
+
"photos"
Environment
.
getExternalStorageDirectory
().
absolutePath
+
File
.
separator
+
My
Constant
.
Param
.
mPacketName
+
File
.
separator
+
"photos"
return
path
}
...
...
library/src/main/java/com/ym/library/utils/JumpUtils.java
View file @
26c7abff
...
...
@@ -6,6 +6,7 @@ import android.text.TextUtils;
import
android.util.Log
;
import
com.ym.ddhy.UserInfoEntity
;
import
com.ym.library.listener.IAdVideoListener
;
import
com.ym.library.module.NewsEntity
;
import
com.ym.library.module.ShaveListEntity
;
...
...
@@ -16,7 +17,7 @@ import com.ym.library.rxbus.BusData;
import
com.ym.library.rxbus.RxBusConstant
;
import
com.ym.library.rxbus.RxBusUtil
;
import
com.ym.modulecommon.AppliContext
;
import
com.ym.modulecommon.
module.UserInfoEntity
;
import
com.ym.modulecommon.
utils.AdPreference
;
import
org.jetbrains.annotations.Nullable
;
...
...
@@ -107,14 +108,14 @@ public class JumpUtils {
}
public
static
boolean
isLogin
(
Boolean
isJump
)
{
String
token
=
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getToken
();
String
token
=
Ad
Preference
.
getToken
();
Log
.
i
(
"TAG"
,
"isLogin: "
+
token
);
String
uid
=
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUid
();
String
uid
=
Ad
Preference
.
getUid
();
UserInfoEntity
entity
=
SettingPreference
.
getUserInfoData
();
if
(
TextUtils
.
isEmpty
(
token
)
||
TextUtils
.
isEmpty
(
uid
)
||
entity
==
null
)
{
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
setUid
(
""
);
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
setToken
(
""
);
com
.
ym
.
modulecommon
.
utils
.
SettingPreference
.
saveUserInfo
(
null
);
Ad
Preference
.
setUid
(
""
);
Ad
Preference
.
setToken
(
""
);
SettingPreference
.
saveUserInfo
(
null
);
return
false
;
}
return
true
;
...
...
library/src/main/java/com/ym/library/utils/LogUtils.java
View file @
26c7abff
...
...
@@ -3,7 +3,7 @@ package com.ym.library.utils;
import
android.os.Environment
;
import
android.util.Log
;
import
com.ym.library.Constant
;
import
com.ym.library.
My
Constant
;
import
org.json.JSONArray
;
import
org.json.JSONException
;
...
...
@@ -431,9 +431,9 @@ public final class LogUtils {
private
Config
()
{
if
(
sDefaultDir
!=
null
)
return
;
if
(
Environment
.
MEDIA_MOUNTED
.
equals
(
Environment
.
getExternalStorageState
()))
sDefaultDir
=
"/storage/emulated/0/Android/data/"
+
Constant
.
Param
.
mPacketName
+
"/cache"
+
FILE_SEP
+
"log"
+
FILE_SEP
;
sDefaultDir
=
"/storage/emulated/0/Android/data/"
+
My
Constant
.
Param
.
mPacketName
+
"/cache"
+
FILE_SEP
+
"log"
+
FILE_SEP
;
else
{
sDefaultDir
=
"/data/data/"
+
Constant
.
Param
.
mPacketName
+
"/cache"
+
FILE_SEP
+
"log"
+
FILE_SEP
;
sDefaultDir
=
"/data/data/"
+
My
Constant
.
Param
.
mPacketName
+
"/cache"
+
FILE_SEP
+
"log"
+
FILE_SEP
;
}
}
...
...
library/src/main/java/com/ym/library/utils/MyPhoneUtils.kt
0 → 100644
View file @
26c7abff
package
com.ym.library.utils
import
android.text.TextUtils
import
com.ym.commen.module.VideoEntity
import
com.ym.library.module.NewsEntity
import
com.ym.library.module.NovelEntity
/**
* @author (wangXuewei)
* @datetime 2020-12-11 15:41 GMT+8
* @detail :
*/
object
MyPhoneUtils
{
fun
replaceUrl
(
url
:
String
,
entity
:
NewsEntity
):
String
{
var
data
:
String
=
url
.
replace
(
"__SLOT_WIDTH__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
ad_width
))
"-999"
else
entity
.
ad_width
?:
"-999"
)
.
replace
(
"__SLOT_HEIGHT__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
ad_width
))
"-999"
else
entity
.
ad_width
?:
"-999"
)
.
replace
(
"__RE_DOWN_X__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickViewDownX
))
"-999"
else
entity
.
clickViewDownX
?:
"-999"
)
.
replace
(
"__RE_DOWN_Y__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickViewDownY
))
"-999"
else
entity
.
clickViewDownY
?:
"-999"
)
.
replace
(
"__RE_UP_X__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickViewUpX
))
"-999"
else
entity
.
clickViewUpX
?:
"-999"
)
.
replace
(
"__RE_UP_Y__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickViewUpY
))
"-999"
else
entity
.
clickViewUpY
?:
"-999"
)
.
replace
(
"__DOWN_X__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickDownX
))
"-999"
else
entity
.
clickDownX
?:
"-999"
)
.
replace
(
"__DOWN_Y__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickDownY
))
"-999"
else
entity
.
clickDownY
?:
"-999"
)
.
replace
(
"__UP_X__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickUpX
))
"-999"
else
entity
.
clickUpX
?:
"-999"
)
.
replace
(
"__UP_Y__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickUpY
))
"-999"
else
entity
.
clickUpY
?:
"-999"
)
.
replace
(
"__LAT__"
,
"-999"
?:
"-999"
)
.
replace
(
"__LON__"
,
"-999"
?:
"-999"
)
.
replace
(
"__SLOT_HEIGHT__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
ad_height
))
"-999"
else
entity
.
ad_height
?:
"-999"
)
.
replace
(
"__UTC_TS__"
,
System
.
currentTimeMillis
().
toString
())
.
replace
(
"__CLICK_ID__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickId
))
"-999"
else
entity
.
clickId
?:
"-999"
)
return
data
}
fun
replaceUrl
(
url
:
String
,
entity
:
NovelEntity
):
String
{
var
data
:
String
=
url
.
replace
(
"__SLOT_WIDTH__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
ad_width
))
"-999"
else
entity
.
ad_width
?:
"-999"
)
.
replace
(
"__SLOT_HEIGHT__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
ad_width
))
"-999"
else
entity
.
ad_width
?:
"-999"
)
.
replace
(
"__RE_DOWN_X__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickViewDownX
))
"-999"
else
entity
.
clickViewDownX
?:
"-999"
)
.
replace
(
"__RE_DOWN_Y__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickViewDownY
))
"-999"
else
entity
.
clickViewDownY
?:
"-999"
)
.
replace
(
"__RE_UP_X__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickViewUpX
))
"-999"
else
entity
.
clickViewUpX
?:
"-999"
)
.
replace
(
"__RE_UP_Y__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickViewUpY
))
"-999"
else
entity
.
clickViewUpY
?:
"-999"
)
.
replace
(
"__DOWN_X__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickDownX
))
"-999"
else
entity
.
clickDownX
?:
"-999"
)
.
replace
(
"__DOWN_Y__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickDownY
))
"-999"
else
entity
.
clickDownY
?:
"-999"
)
.
replace
(
"__UP_X__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickUpX
))
"-999"
else
entity
.
clickUpX
?:
"-999"
)
.
replace
(
"__UP_Y__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickUpY
))
"-999"
else
entity
.
clickUpY
?:
"-999"
)
.
replace
(
"__LAT__"
,
"-999"
?:
"-999"
)
.
replace
(
"__LON__"
,
"-999"
?:
"-999"
)
.
replace
(
"__SLOT_HEIGHT__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
ad_height
))
"-999"
else
entity
.
ad_height
?:
"-999"
)
.
replace
(
"__UTC_TS__"
,
System
.
currentTimeMillis
().
toString
())
.
replace
(
"__CLICK_ID__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickId
))
"-999"
else
entity
.
clickId
?:
"-999"
)
return
data
}
fun
replaceUrl
(
url
:
String
,
entity
:
VideoEntity
):
String
{
var
data
:
String
=
url
.
replace
(
"__SLOT_WIDTH__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
ad_width
))
"-999"
else
entity
.
ad_width
?:
"-999"
)
.
replace
(
"__SLOT_HEIGHT__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
ad_width
))
"-999"
else
entity
.
ad_width
?:
"-999"
)
.
replace
(
"__RE_DOWN_X__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickViewDownX
))
"-999"
else
entity
.
clickViewDownX
?:
"-999"
)
.
replace
(
"__RE_DOWN_Y__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickViewDownY
))
"-999"
else
entity
.
clickViewDownY
?:
"-999"
)
.
replace
(
"__RE_UP_X__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickViewUpX
))
"-999"
else
entity
.
clickViewUpX
?:
"-999"
)
.
replace
(
"__RE_UP_Y__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickViewUpY
))
"-999"
else
entity
.
clickViewUpY
?:
"-999"
)
.
replace
(
"__DOWN_X__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickDownX
))
"-999"
else
entity
.
clickDownX
?:
"-999"
)
.
replace
(
"__DOWN_Y__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickDownY
))
"-999"
else
entity
.
clickDownY
?:
"-999"
)
.
replace
(
"__UP_X__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickUpX
))
"-999"
else
entity
.
clickUpX
?:
"-999"
)
.
replace
(
"__UP_Y__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickUpY
))
"-999"
else
entity
.
clickUpY
?:
"-999"
)
.
replace
(
"__LAT__"
,
"-999"
?:
"-999"
)
.
replace
(
"__LON__"
,
"-999"
?:
"-999"
)
.
replace
(
"__SLOT_HEIGHT__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
ad_height
))
"-999"
else
entity
.
ad_height
?:
"-999"
)
.
replace
(
"__UTC_TS__"
,
System
.
currentTimeMillis
().
toString
())
.
replace
(
"__CLICK_ID__"
,
if
(
TextUtils
.
isEmpty
(
entity
.
clickId
))
"-999"
else
entity
.
clickId
?:
"-999"
)
return
data
}
}
\ No newline at end of file
library/src/main/java/com/ym/library/utils/OpenFiles.kt
View file @
26c7abff
...
...
@@ -5,7 +5,7 @@ import android.net.Uri
import
android.os.Build
import
android.text.TextUtils
import
androidx.core.content.FileProvider
import
com.ym.library.Constant
import
com.ym.library.
My
Constant
import
com.ym.library.R
import
com.ym.modulecommon.AppliContext
import
java.io.File
...
...
@@ -30,7 +30,7 @@ object OpenFiles {
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
var
uri
:
Uri
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
{
//24
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
My
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
intent
.
addFlags
(
Intent
.
FLAG_GRANT_READ_URI_PERMISSION
)
}
else
{
uri
=
Uri
.
fromFile
(
file
)
...
...
@@ -46,7 +46,7 @@ object OpenFiles {
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
var
uri
:
Uri
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
{
//24
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
My
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
intent
.
addFlags
(
Intent
.
FLAG_GRANT_READ_URI_PERMISSION
)
}
else
{
uri
=
Uri
.
fromFile
(
file
)
...
...
@@ -62,7 +62,7 @@ object OpenFiles {
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
var
uri
:
Uri
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
{
//24
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
My
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
intent
.
addFlags
(
Intent
.
FLAG_GRANT_READ_URI_PERMISSION
)
}
else
{
uri
=
Uri
.
fromFile
(
file
)
...
...
@@ -80,7 +80,7 @@ object OpenFiles {
intent
.
putExtra
(
"configchange"
,
0
)
var
uri
:
Uri
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
{
//24
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
My
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
intent
.
addFlags
(
Intent
.
FLAG_GRANT_READ_URI_PERMISSION
)
}
else
{
uri
=
Uri
.
fromFile
(
file
)
...
...
@@ -97,7 +97,7 @@ object OpenFiles {
intent
.
putExtra
(
"configchange"
,
0
)
var
uri
:
Uri
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
{
//24
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
My
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
intent
.
addFlags
(
Intent
.
FLAG_GRANT_READ_URI_PERMISSION
)
}
else
{
uri
=
Uri
.
fromFile
(
file
)
...
...
@@ -113,7 +113,7 @@ object OpenFiles {
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
var
uri
:
Uri
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
{
//24
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
My
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
intent
.
addFlags
(
Intent
.
FLAG_GRANT_READ_URI_PERMISSION
)
}
else
{
uri
=
Uri
.
fromFile
(
file
)
...
...
@@ -130,7 +130,7 @@ object OpenFiles {
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
var
uri
:
Uri
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
{
//24
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
My
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
intent
.
addFlags
(
Intent
.
FLAG_GRANT_READ_URI_PERMISSION
)
}
else
{
uri
=
Uri
.
fromFile
(
file
)
...
...
@@ -146,7 +146,7 @@ object OpenFiles {
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
var
uri
:
Uri
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
{
//24
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
My
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
intent
.
addFlags
(
Intent
.
FLAG_GRANT_READ_URI_PERMISSION
)
}
else
{
uri
=
Uri
.
fromFile
(
file
)
...
...
@@ -162,7 +162,7 @@ object OpenFiles {
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
var
uri
:
Uri
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
{
//24
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
My
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
intent
.
addFlags
(
Intent
.
FLAG_GRANT_READ_URI_PERMISSION
)
}
else
{
uri
=
Uri
.
fromFile
(
file
)
...
...
@@ -178,7 +178,7 @@ object OpenFiles {
intent
.
action
=
Intent
.
ACTION_VIEW
var
uri
:
Uri
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
{
//24
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
uri
=
FileProvider
.
getUriForFile
(
AppliContext
.
get
(),
My
Constant
.
Param
.
mPacketName
+
".fileprovider"
,
file
)
intent
.
addFlags
(
Intent
.
FLAG_GRANT_READ_URI_PERMISSION
)
}
else
{
uri
=
Uri
.
fromFile
(
file
)
...
...
library/src/main/java/com/ym/library/utils/PhoneUtils.kt
deleted
100644 → 0
View file @
c8b17f94
This diff is collapsed.
Click to expand it.
library/src/main/java/com/ym/library/utils/SettingPreference.java
View file @
26c7abff
This diff is collapsed.
Click to expand it.
library/src/main/java/com/ym/library/utils/Utils.java
View file @
26c7abff
...
...
@@ -38,6 +38,7 @@ import androidx.core.content.ContextCompat;
import
com.google.gson.Gson
;
import
com.ym.modulecommon.AppliContext
;
import
com.ym.modulecommon.utils.AdPreference
;
import
java.io.BufferedReader
;
import
java.io.File
;
...
...
@@ -879,7 +880,7 @@ public class Utils {
public
static
boolean
isLogin
()
{
String
token
=
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getToken
();
String
token
=
Ad
Preference
.
getToken
();
if
(
TextUtils
.
isEmpty
(
token
))
{
return
false
;
}
...
...
library/src/main/java/com/ym/library/utils/WxImplUtils.java
View file @
26c7abff
...
...
@@ -9,7 +9,8 @@ import com.umeng.socialize.UMAuthListener;
import
com.umeng.socialize.UMShareAPI
;
import
com.umeng.socialize.UMShareConfig
;
import
com.umeng.socialize.bean.SHARE_MEDIA
;
import
com.ym.library.Constant
;
import
com.ym.ddhy.UserInfoEntity
;
import
com.ym.library.MyConstant
;
import
com.ym.library.R
;
import
com.ym.library.module.WxBindEntity
;
import
com.ym.library.net.ApiClient
;
...
...
@@ -17,7 +18,7 @@ import com.ym.library.net.BaseObserver;
import
com.ym.library.net.RxSchedulers
;
import
com.ym.library.widget.LoadingDialog
;
import
com.ym.modulecommon.AppliContext
;
import
com.ym.modulecommon.
module.UserInfoEntity
;
import
com.ym.modulecommon.
utils.AdPreference
;
import
java.util.Map
;
...
...
@@ -80,7 +81,7 @@ public class WxImplUtils implements UMAuthListener {
public
void
onSuccess
(
WxBindEntity
result
)
{
Log
.
i
(
TAG
,
"onSuccess: "
+
result
.
getFlushToken
());
if
(
result
.
getFlushToken
()
!=
null
&&
!
""
.
equals
(
result
.
getFlushToken
()))
{
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
setToken
(
result
.
getFlushToken
());
Ad
Preference
.
setToken
(
result
.
getFlushToken
());
UserInfoEntity
user
=
SettingPreference
.
getUserInfoData
();
if
(
user
!=
null
)
{
...
...
@@ -88,7 +89,7 @@ public class WxImplUtils implements UMAuthListener {
user
.
setHeadimgurl
(
data
.
get
(
"iconurl"
));
user
.
setNickname
(
data
.
get
(
"screen_name"
));
}
com
.
ym
.
modulecommon
.
utils
.
SettingPreference
.
saveUserInfo
(
user
);
SettingPreference
.
saveUserInfo
(
user
);
SettingPreference
.
saveUserInfoName
(
data
.
get
(
"screen_name"
));
mCallback
.
onWxSuccess
(
data
.
get
(
"access_token"
),
data
.
get
(
"openid"
));
}
else
{
...
...
@@ -108,10 +109,10 @@ public class WxImplUtils implements UMAuthListener {
// mCallback.onWxFail(errorMsg);
}
else
if
(
TextUtils
.
equals
(
"106"
,
code
))
{
str
=
errorMsg
;
Constant
.
Param
.
uid
=
""
;
Constant
.
Param
.
token
=
""
;
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
setToken
(
""
);
com
.
ym
.
modulecommon
.
utils
.
SettingPreference
.
saveUserInfo
(
null
);
My
Constant
.
Param
.
uid
=
""
;
My
Constant
.
Param
.
token
=
""
;
Ad
Preference
.
setToken
(
""
);
SettingPreference
.
saveUserInfo
(
null
);
mLoading
.
setResult
(
false
,
str
,
1000
);
mLoading
.
dismiss
();
// mCallback.onWxFail(errorMsg);
...
...
library/src/main/java/com/ym/library/utils/ZxDownLoadServices.java
View file @
26c7abff
...
...
@@ -12,6 +12,7 @@ import android.util.Log;
import
com.ym.library.module.NewsEntity
;
import
com.ym.library.net.AdUpload
;
import
com.ym.modulecommon.AppliContext
;
import
com.ym.modulecommon.utils.PhoneUtils
;
/**
...
...
library/src/main/java/com/ym/library/wechat/IUserInfoApi.kt
View file @
26c7abff
package
com.ym.library.wechat
import
com.ym.ddhy.UserInfoEntity
import
com.ym.library.module.*
import
com.ym.library.net.NetConfig
import
com.ym.library.net.Response
import
com.ym.modulecommon.module.UserInfoEntity
import
io.reactivex.Observable
import
okhttp3.ResponseBody
import
retrofit2.http.*
...
...
library/src/main/java/com/ym/library/wechat/UserApiClient.kt
View file @
26c7abff
package
com.ym.library.wechat
import
android.text.TextUtils
import
com.ym.library.Constant
import
com.ym.library.net.NetConfig
import
com.ym.library.utils.PhoneUtils
import
com.ym.library.utils.SettingPreference
import
com.ym.library.MyConstant
import
com.ym.modulecommon.utils.AdPreference
import
okhttp3.*
import
okhttp3.logging.HttpLoggingInterceptor
import
retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
...
...
@@ -32,12 +30,12 @@ object UserApiClient {
private
val
headInterceptor
=
Interceptor
{
chain
->
val
request
=
chain
.
request
()
val
builder
=
request
.
newBuilder
()
builder
.
addHeader
(
Constant
.
aid
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getAndroidId
())
builder
.
addHeader
(
Constant
.
Device
.
env
,
Constant
.
Param
.
env
)
if
(!
TextUtils
.
isEmpty
(
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUserAgent
()))
{
builder
.
addHeader
(
"web-user-agent"
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUserAgent
())
builder
.
addHeader
(
MyConstant
.
aid
,
Ad
Preference
.
getAndroidId
())
builder
.
addHeader
(
MyConstant
.
Device
.
env
,
My
Constant
.
Param
.
env
)
if
(!
TextUtils
.
isEmpty
(
Ad
Preference
.
getUserAgent
()))
{
builder
.
addHeader
(
"web-user-agent"
,
Ad
Preference
.
getUserAgent
())
builder
.
removeHeader
(
"User-Agent"
)
builder
.
addHeader
(
"User-Agent"
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUserAgent
())
builder
.
addHeader
(
"User-Agent"
,
Ad
Preference
.
getUserAgent
())
}
val
headers
:
Request
=
builder
.
build
()
chain
.
proceed
(
headers
)
...
...
library/src/main/java/com/ym/library/widget/NavigationBottomView.java
View file @
26c7abff
...
...
@@ -4,7 +4,7 @@ import android.content.Context;
import
android.util.AttributeSet
;
import
android.widget.LinearLayout
;
import
com.ym.library.Constant
;
import
com.ym.library.
My
Constant
;
import
com.ym.library.R
;
public
class
NavigationBottomView
extends
LinearLayout
{
...
...
@@ -32,7 +32,7 @@ public class NavigationBottomView extends LinearLayout {
private
void
createItemView
()
{
BottomNavigationHelper
.
bindTabWithData
(
this
,
new
BottomNavigationItem
(
0
,
""
,
R
.
drawable
.
welfare_tab
,
R
.
drawable
.
welfare_tab
,
R
.
drawable
.
welfare_tab
,
false
));
if
(
Constant
.
ISENTERTAINMENT
==
1
)
{
if
(
My
Constant
.
ISENTERTAINMENT
==
1
)
{
BottomNavigationHelper
.
bindTabWithData
(
this
,
new
BottomNavigationItem
(
1
,
""
,
R
.
drawable
.
happyplaytab
,
R
.
drawable
.
happyplaytab
,
R
.
drawable
.
happyplaytab
,
false
));
}
BottomNavigationHelper
.
bindTabWithData
(
this
,
new
BottomNavigationItem
(
3
,
""
,
R
.
drawable
.
signin_withdraw_tab
,
R
.
drawable
.
signin_withdraw_tab
,
R
.
drawable
.
signin_withdraw_tab
,
false
));
...
...
userinfo/src/main/java/com/ym/userinfo/module/activity/SettingActivity.kt
View file @
26c7abff
...
...
@@ -3,23 +3,19 @@ package com.ym.userinfo.module.activity
import
android.content.ClipData
import
android.content.ClipboardManager
import
android.content.Context
import
android.util.Log
import
android.widget.CompoundButton
import
com.bytedance.sdk.openadsdk.TTNativeExpressAd
import
com.qq.e.ads.nativ.NativeExpressADView
import
com.umeng.analytics.MobclickAgent
import
com.ym.admodule.config.AdManager
import
com.ym.admodule.config.ZXADSizeConfig
import
com.ym.library.Constant
import
com.ym.library.
My
Constant
import
com.ym.library.down.UpdateVersionManager
import
com.ym.library.module.NewsEntity
import
com.ym.library.net.BaseActivity
import
com.ym.library.net.MyBaseActivity
import
com.ym.library.utils.*
import
com.ym.module.userinfo.R
import
com.ym.modulecommon.utils.PhoneUtils
import
kotlinx.android.synthetic.main.activity_setting.*
import
kotlinx.android.synthetic.main.layout_user_toolbar.*
class
SettingActivity
:
BaseActivity
()
{
class
SettingActivity
:
My
BaseActivity
()
{
override
fun
layoutID
():
Int
=
R
.
layout
.
activity_setting
override
fun
before
()
{
...
...
@@ -32,8 +28,8 @@ class SettingActivity : BaseActivity() {
if
(
SettingPreference
.
getUserInfoData
()
!=
null
)
{
id_tv_id
.
text
=
"ID: ${SettingPreference.getUserInfoData().uid}"
}
if
(
Constant
.
qq
!=
0
)
{
id_tv_qq
.
text
=
"官方QQ群: ${Constant.qq}"
if
(
My
Constant
.
qq
!=
0
)
{
id_tv_qq
.
text
=
"官方QQ群: ${
My
Constant.qq}"
}
else
{
id_tv_qq
.
text
=
""
}
...
...
@@ -60,15 +56,15 @@ class SettingActivity : BaseActivity() {
// tv_user_toolbar_title.text = "设置"
//用户协议
tv_setting_user_agreement
.
setOnClickListener
{
JumpUtils
.
h5Jump
(
"用户协议"
,
Constant
.
Param
.
USER
,
true
,
this
)
JumpUtils
.
h5Jump
(
"用户协议"
,
My
Constant
.
Param
.
USER
,
true
,
this
)
}
//隐私条款
tv_setting_privacy_policy
.
setOnClickListener
{
JumpUtils
.
h5Jump
(
"隐私条款"
,
Constant
.
Param
.
PRIVACY
,
true
,
this
)
JumpUtils
.
h5Jump
(
"隐私条款"
,
My
Constant
.
Param
.
PRIVACY
,
true
,
this
)
}
//关于我们
tv_setting_about_us
.
setOnClickListener
{
JumpUtils
.
h5Jump
(
"关于我们"
,
Constant
.
Param
.
ABOUTUS
,
true
,
this
)
JumpUtils
.
h5Jump
(
"关于我们"
,
My
Constant
.
Param
.
ABOUTUS
,
true
,
this
)
}
//版本升级
id_setting_update_version
.
setOnClickListener
{
...
...
userinfo/src/main/java/com/ym/userinfo/module/activity/WithdrawalsRecordActivity.kt
View file @
26c7abff
...
...
@@ -4,7 +4,7 @@ import android.view.View
import
androidx.recyclerview.widget.LinearLayoutManager
import
com.umeng.analytics.MobclickAgent
import
com.ym.library.module.WithdrawEntity
import
com.ym.library.net.BaseActivity
import
com.ym.library.net.
My
BaseActivity
import
com.ym.library.utils.StatusBarUtil
import
com.ym.module.userinfo.R
import
com.ym.userinfo.module.adapter.WithdrawalsRecordAdapter
...
...
@@ -13,7 +13,7 @@ import com.ym.userinfo.module.presenter.WithdrawalsRecordPresenter
import
kotlinx.android.synthetic.main.activity_withdrawals_record.*
import
kotlinx.android.synthetic.main.layout_user_toolbar.*
class
WithdrawalsRecordActivity
:
BaseActivity
(),
WithdrawalsRecordContract
.
View
{
class
WithdrawalsRecordActivity
:
My
BaseActivity
(),
WithdrawalsRecordContract
.
View
{
private
var
adapter
:
WithdrawalsRecordAdapter
?
=
null
private
var
mPresenter
:
WithdrawalsRecordPresenter
?
=
null
...
...
userinfo/src/main/java/com/ym/userinfo/module/contract/UserContract.kt
View file @
26c7abff
package
com.ym.userinfo.module.contract
import
com.ym.ddhy.UserInfoEntity
import
com.ym.library.module.WithdrawEntity
import
com.ym.modulecommon.module.UserInfoEntity
import
com.ym.userinfo.module.entity.LotteryEntity
/**
...
...
userinfo/src/main/java/com/ym/userinfo/module/net/IUserInfoApi.kt
View file @
26c7abff
package
com.ym.userinfo.module.net
import
com.ym.ddhy.UserInfoEntity
import
com.ym.library.module.*
import
com.ym.library.net.NetConfig
import
com.ym.library.net.Response
import
com.ym.modulecommon.module.UserInfoEntity
import
com.ym.userinfo.module.entity.LotteryEntity
import
io.reactivex.Observable
import
okhttp3.ResponseBody
...
...
userinfo/src/main/java/com/ym/userinfo/module/net/UserApiClient.kt
View file @
26c7abff
package
com.ym.userinfo.module.net
import
android.text.TextUtils
import
com.ym.library.Constant
import
com.ym.library.net.NetConfig
import
com.ym.library.utils.PhoneUtils
import
com.ym.library.utils.SettingPreference
import
com.ym.library.MyConstant
import
com.ym.modulecommon.utils.AdPreference
import
okhttp3.*
import
okhttp3.logging.HttpLoggingInterceptor
import
retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
...
...
@@ -32,12 +30,12 @@ object UserApiClient {
private
val
headInterceptor
=
Interceptor
{
chain
->
val
request
=
chain
.
request
()
val
builder
=
request
.
newBuilder
()
builder
.
addHeader
(
Constant
.
aid
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getAndroidId
())
builder
.
addHeader
(
Constant
.
Device
.
env
,
Constant
.
Param
.
env
)
if
(!
TextUtils
.
isEmpty
(
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUserAgent
()))
{
builder
.
addHeader
(
"web-user-agent"
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUserAgent
())
builder
.
addHeader
(
MyConstant
.
aid
,
Ad
Preference
.
getAndroidId
())
builder
.
addHeader
(
MyConstant
.
Device
.
env
,
My
Constant
.
Param
.
env
)
if
(!
TextUtils
.
isEmpty
(
Ad
Preference
.
getUserAgent
()))
{
builder
.
addHeader
(
"web-user-agent"
,
Ad
Preference
.
getUserAgent
())
builder
.
removeHeader
(
"User-Agent"
)
builder
.
addHeader
(
"User-Agent"
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUserAgent
())
builder
.
addHeader
(
"User-Agent"
,
Ad
Preference
.
getUserAgent
())
}
val
headers
:
Request
=
builder
.
build
()
chain
.
proceed
(
headers
)
...
...
userinfo/src/main/java/com/ym/userinfo/module/presenter/UserPresenter.kt
View file @
26c7abff
package
com.ym.userinfo.module.presenter
import
com.ym.ddhy.UserInfoEntity
import
com.ym.library.module.WithdrawEntity
import
com.ym.library.net.BaseObserver
import
com.ym.library.net.RxSchedulers
import
com.ym.modulecommon.
module.UserInfoEntity
import
com.ym.modulecommon.
utils.AdPreference
import
com.ym.userinfo.module.contract.UserContract
import
com.ym.userinfo.module.entity.LotteryEntity
import
com.ym.userinfo.module.net.UserApiClient
...
...
@@ -84,7 +85,7 @@ class UserPresenter : UserContract.Presenter {
//微信是否绑定
override
fun
requestIsWxBind
()
{
val
token
=
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getToken
()
val
token
=
Ad
Preference
.
getToken
()
UserApiClient
.
userApi
.
getIsBindWithdrawWx
(
token
)
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
UserInfoEntity
>()
{
...
...
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