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
e322a929
Commit
e322a929
authored
Dec 15, 2020
by
maxiaoliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
2821c685
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
730 additions
and
623 deletions
+730
-623
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+16
-3
GameActivity.kt
app/src/main/java/com/ym/msdh/game/GameActivity.kt
+77
-20
SplashActivity.kt
...src/main/java/com/ym/msdh/game/activity/SplashActivity.kt
+3
-17
WxLoginActivity.kt
...rc/main/java/com/ym/msdh/game/activity/WxLoginActivity.kt
+1
-1
WateringTaskAdpater.kt
...main/java/com/ym/msdh/game/adapter/WateringTaskAdpater.kt
+1
-1
BaseApplication.kt
...main/java/com/ym/msdh/game/application/BaseApplication.kt
+2
-2
MainDialog.kt
app/src/main/java/com/ym/msdh/game/view/MainDialog.kt
+33
-13
activity_wx_login.xml
app/src/main/res/layout/activity_wx_login.xml
+6
-6
dialog_get_water_drop.xml
app/src/main/res/layout/dialog_get_water_drop.xml
+5
-5
item_watering_task.xml
app/src/main/res/layout/item_watering_task.xml
+26
-30
icon_login_bg.jpg
app/src/main/res/mipmap-xhdpi/icon_login_bg.jpg
+0
-0
icon_login_bg.png
app/src/main/res/mipmap-xhdpi/icon_login_bg.png
+0
-0
wx_login_btn.png
app/src/main/res/mipmap-xhdpi/wx_login_btn.png
+0
-0
wx_logo_bg.png
app/src/main/res/mipmap-xhdpi/wx_logo_bg.png
+0
-0
build.gradle
library/build.gradle
+1
-1
Constant.java
library/src/main/java/com/ym/library/Constant.java
+1
-1
JavaInterface.kt
...ry/src/main/java/com/ym/library/activity/JavaInterface.kt
+126
-105
XiaoManActivity.kt
.../src/main/java/com/ym/library/activity/XiaoManActivity.kt
+2
-1
VersionClient.kt
library/src/main/java/com/ym/library/down/VersionClient.kt
+3
-2
UserInfoEntity.kt
...ary/src/main/java/com/ym/library/module/UserInfoEntity.kt
+57
-0
ApiClient.kt
library/src/main/java/com/ym/library/net/ApiClient.kt
+5
-5
BaseActivity.java
library/src/main/java/com/ym/library/net/BaseActivity.java
+1
-220
EventApiClient.kt
library/src/main/java/com/ym/library/net/EventApiClient.kt
+2
-1
GameApiClient.kt
library/src/main/java/com/ym/library/net/GameApiClient.kt
+5
-5
IUserApi.kt
library/src/main/java/com/ym/library/net/IUserApi.kt
+0
-1
SplashPresenter.kt
library/src/main/java/com/ym/library/net/SplashPresenter.kt
+26
-19
ZXADClient.kt
library/src/main/java/com/ym/library/net/ZXADClient.kt
+5
-4
RounterApi.kt
library/src/main/java/com/ym/library/router/RounterApi.kt
+3
-0
AdUtils.kt
library/src/main/java/com/ym/library/utils/AdUtils.kt
+4
-0
CenterDialog.kt
library/src/main/java/com/ym/library/utils/CenterDialog.kt
+4
-4
GameDialog.kt
library/src/main/java/com/ym/library/utils/GameDialog.kt
+70
-19
H5Listener.kt
library/src/main/java/com/ym/library/utils/H5Listener.kt
+2
-1
JumpUtils.java
library/src/main/java/com/ym/library/utils/JumpUtils.java
+37
-16
PhoneUtils.kt
library/src/main/java/com/ym/library/utils/PhoneUtils.kt
+66
-65
SettingPreference.java
...src/main/java/com/ym/library/utils/SettingPreference.java
+27
-24
Utils.java
library/src/main/java/com/ym/library/utils/Utils.java
+2
-1
VideoNumberUtils.kt
...ry/src/main/java/com/ym/library/utils/VideoNumberUtils.kt
+1
-1
WxImplUtils.java
library/src/main/java/com/ym/library/utils/WxImplUtils.java
+6
-5
IUserInfoApi.kt
library/src/main/java/com/ym/library/wechat/IUserInfoApi.kt
+7
-8
UserApiClient.kt
library/src/main/java/com/ym/library/wechat/UserApiClient.kt
+5
-4
icon_liji_tixian.png
library/src/main/res/drawable-xhdpi/icon_liji_tixian.png
+0
-0
dialog_layout_get_cash.xml
library/src/main/res/layout/dialog_layout_get_cash.xml
+1
-0
dialog_layout_xinshou_reward.xml
library/src/main/res/layout/dialog_layout_xinshou_reward.xml
+69
-0
UserInfoActivity.kt
.../java/com/ym/userinfo/module/activity/UserInfoActivity.kt
+13
-4
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
+0
-1
UserApiClient.kt
...src/main/java/com/ym/userinfo/module/net/UserApiClient.kt
+5
-4
UserPresenter.kt
...in/java/com/ym/userinfo/module/presenter/UserPresenter.kt
+3
-2
No files found.
app/src/main/AndroidManifest.xml
View file @
e322a929
...
@@ -75,17 +75,30 @@
...
@@ -75,17 +75,30 @@
</activity>
</activity>
<service
android:name=
"com.ym.msdh.game.notif.NotificationService"
/>
<service
android:name=
"com.ym.msdh.game.notif.NotificationService"
/>
<activity
<activity
android:name=
"com.ym.msdh.game.activity.WxLoginActivity"
android:name=
"com.ym.msdh.game.activity.WxLoginActivity"
android:exported=
"true"
/>
android:screenOrientation=
"portrait"
>
<intent-filter>
<action
android:name=
"android.intent.action.VIEW"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
<category
android:name=
"android.intent.category.BROWSABLE"
/>
<data
android:host=
"wxlogin"
android:scheme=
"msdh"
/>
</intent-filter>
</activity>
<!-- <activity-->
<!-- android:name="com.ym.msdh.game.activity.WxLoginActivity"-->
<!-- android:exported="true" />-->
<activity
<activity
android:name=
"com.ym.msdh.game.GameActivity"
android:name=
"com.ym.msdh.game.GameActivity"
android:exported=
"true"
android:exported=
"true"
android:launchMode=
"singleTask"
/>
<!-- 友盟配置 -->
android:launchMode=
"singleTask"
/>
<!-- 友盟配置 -->
<meta-data
<meta-data
android:name=
"UMENG_APPKEY"
android:name=
"UMENG_APPKEY"
android:value=
"5f
9bb48945b2b751a91fb2d5
"
/>
android:value=
"5f
d703f8498d9e0d4d8cc896
"
/>
<meta-data
<meta-data
android:name=
"UMENG_CHANNEL"
android:name=
"UMENG_CHANNEL"
android:value=
"${UMENG_CHANNEL_VALUE}"
/>
<!-- 微信配置 -->
android:value=
"${UMENG_CHANNEL_VALUE}"
/>
<!-- 微信配置 -->
...
...
app/src/main/java/com/ym/msdh/game/GameActivity.kt
View file @
e322a929
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ym/msdh/game/activity/SplashActivity.kt
View file @
e322a929
...
@@ -23,6 +23,7 @@ import com.ym.library.net.SplashPresenter
...
@@ -23,6 +23,7 @@ import com.ym.library.net.SplashPresenter
import
com.ym.library.net.SplashPresenter.Companion.PERMISSIONS
import
com.ym.library.net.SplashPresenter.Companion.PERMISSIONS
import
com.ym.library.utils.*
import
com.ym.library.utils.*
import
com.ym.modulecommon.base.BaseActivity
import
com.ym.modulecommon.base.BaseActivity
import
com.ym.modulecommon.utils.AdPreference
import
com.ym.msdh.R
import
com.ym.msdh.R
class
SplashActivity
:
BaseActivity
(),
SplashContract
.
View
{
class
SplashActivity
:
BaseActivity
(),
SplashContract
.
View
{
...
@@ -65,9 +66,6 @@ class SplashActivity : BaseActivity(), SplashContract.View {
...
@@ -65,9 +66,6 @@ class SplashActivity : BaseActivity(), SplashContract.View {
}
}
override
fun
className
():
String
{
return
SplashActivity
::
class
.
java
.
simpleName
}
override
fun
jumpPage
()
{
override
fun
jumpPage
()
{
if
(!
SettingPreference
.
getIsShowGuide
())
{
if
(!
SettingPreference
.
getIsShowGuide
())
{
...
@@ -102,7 +100,7 @@ class SplashActivity : BaseActivity(), SplashContract.View {
...
@@ -102,7 +100,7 @@ class SplashActivity : BaseActivity(), SplashContract.View {
isClick
=
false
isClick
=
false
startTime
=
System
.
currentTimeMillis
()
startTime
=
System
.
currentTimeMillis
()
// startActivity(Intent(this@SplashActivity, GameActivity::class.java))
// startActivity(Intent(this@SplashActivity, GameActivity::class.java))
val
token
=
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getToken
()
val
token
=
Ad
Preference
.
getToken
()
if
(
token
.
isEmpty
()){
if
(
token
.
isEmpty
()){
EventUtils
.
onEvent
(
"login_token_null"
,
"未登录"
)
EventUtils
.
onEvent
(
"login_token_null"
,
"未登录"
)
startActivity
(
Intent
(
this
@SplashActivity
,
WxLoginActivity
::
class
.
java
))
startActivity
(
Intent
(
this
@SplashActivity
,
WxLoginActivity
::
class
.
java
))
...
@@ -172,23 +170,11 @@ class SplashActivity : BaseActivity(), SplashContract.View {
...
@@ -172,23 +170,11 @@ class SplashActivity : BaseActivity(), SplashContract.View {
}
}
}
}
override
fun
activity
():
Activity
{
return
this
}
override
fun
getDestroyed
():
Boolean
{
override
fun
getDestroyed
():
Boolean
{
return
false
return
false
}
}
override
fun
onResume
()
{
super
.
onResume
()
EventUtils
.
onEvent
(
"page_status"
,
Utils
.
obj2Str
(
ReportEntity
(
Constant
.
ReportSessionId
,
"SplashActivity"
,
"onResume"
)))
MobclickAgent
.
onResume
(
this
)
}
override
fun
onPause
()
{
super
.
onPause
()
EventUtils
.
onEvent
(
"page_status"
,
Utils
.
obj2Str
(
ReportEntity
(
Constant
.
ReportSessionId
,
"SplashActivity"
,
"onPause"
)))
MobclickAgent
.
onPause
(
this
)
}
}
}
\ No newline at end of file
app/src/main/java/com/ym/msdh/game/activity/WxLoginActivity.kt
View file @
e322a929
...
@@ -49,7 +49,7 @@ class WxLoginActivity : BaseActivity(), WxImplUtils.IWxLoginCallback {
...
@@ -49,7 +49,7 @@ class WxLoginActivity : BaseActivity(), WxImplUtils.IWxLoginCallback {
}
}
fun
wxLogin
()
{
fun
wxLogin
()
{
onEvent
(
"
click_login
"
,
"点击微信登录"
)
onEvent
(
"
login_click
"
,
"点击微信登录"
)
WxImplUtils
().
onAuth
(
act
,
this
)
WxImplUtils
().
onAuth
(
act
,
this
)
// WxImplUtils().onAuth(
// WxImplUtils().onAuth(
// act,this
// act,this
...
...
app/src/main/java/com/ym/msdh/game/adapter/WateringTaskAdpater.kt
View file @
e322a929
...
@@ -81,7 +81,7 @@ class WateringTaskAdpater :
...
@@ -81,7 +81,7 @@ class WateringTaskAdpater :
// holder.tvCount.text = "+${data.coins}"
// holder.tvCount.text = "+${data.coins}"
// }
// }
holder
.
imgcoin
.
setImageResource
(
R
.
mipmap
.
icon_popupwater_ico
n
)
holder
.
imgcoin
.
setImageResource
(
R
.
drawable
.
icon_pop_coi
n
)
if
(!
TextUtils
.
isEmpty
(
data
.
description
))
{
if
(!
TextUtils
.
isEmpty
(
data
.
description
))
{
holder
.
btnProgess
.
visibility
=
View
.
GONE
holder
.
btnProgess
.
visibility
=
View
.
GONE
holder
.
tvTitle
.
text
=
data
.
title
+
" (${data.current_nums}/${data.awardLimit})"
holder
.
tvTitle
.
text
=
data
.
title
+
" (${data.current_nums}/${data.awardLimit})"
...
...
app/src/main/java/com/ym/msdh/game/application/BaseApplication.kt
View file @
e322a929
...
@@ -64,7 +64,7 @@ class BaseApplication : BaseApplication() {
...
@@ -64,7 +64,7 @@ class BaseApplication : BaseApplication() {
AdManager
.
init
(
this
,
"b1c85b22f06d1990"
)
AdManager
.
init
(
this
,
"b1c85b22f06d1990"
)
LogUtils
.
getConfig
().
logSwitch
=
true
LogUtils
.
getConfig
().
logSwitch
=
true
UMConfigure
.
setLogEnabled
(
true
)
UMConfigure
.
setLogEnabled
(
true
)
UMConfigure
.
init
(
this
,
"5f
9bb48945b2b751a91fb2d5
"
,
""
,
UMConfigure
.
DEVICE_TYPE_PHONE
,
""
)
UMConfigure
.
init
(
this
,
"5f
d703f8498d9e0d4d8cc896
"
,
""
,
UMConfigure
.
DEVICE_TYPE_PHONE
,
""
)
PlatformConfig
.
setWeixin
(
Constant
.
WX_APPID
,
Constant
.
WX_APPKEY
)
PlatformConfig
.
setWeixin
(
Constant
.
WX_APPID
,
Constant
.
WX_APPKEY
)
var
isDebug
=
true
var
isDebug
=
true
...
@@ -82,7 +82,7 @@ class BaseApplication : BaseApplication() {
...
@@ -82,7 +82,7 @@ class BaseApplication : BaseApplication() {
// 设置是否为上报进程
// 设置是否为上报进程
strategy
.
isUploadProcess
=
processName
==
null
||
processName
==
packageName
strategy
.
isUploadProcess
=
processName
==
null
||
processName
==
packageName
//Bugly初始化
//Bugly初始化
CrashReport
.
initCrashReport
(
this
,
"
262040511a
"
,
isDebug
,
strategy
)
CrashReport
.
initCrashReport
(
this
,
"
d54c4bc8b8
"
,
isDebug
,
strategy
)
//========== Bugly ==========
//========== Bugly ==========
//小满
//小满
...
...
app/src/main/java/com/ym/msdh/game/view/MainDialog.kt
View file @
e322a929
...
@@ -707,25 +707,36 @@ object MainDialog {
...
@@ -707,25 +707,36 @@ object MainDialog {
Gravity
.
CENTER
Gravity
.
CENTER
)
)
EventUtils
.
onEvent
(
"seed_show"
,
"生产弹窗展示"
)
EventUtils
.
onEvent
(
"seed_show"
,
"生产弹窗展示"
)
val
layoutAd
=
mDialogView
?.
findViewById
<
FrameLayout
>(
R
.
id
.
layout_ad
)
val
layout_dialog_root
=
AdUtils
.
showFeedAd
(
activity
,
"seed_not_enough_bigimage"
,
layoutAd
)
mDialogView
?.
findViewById
<
LinearLayout
>(
com
.
ym
.
library
.
R
.
id
.
layout_shengchan_root
)
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
tv_dialog_shengchan_coin
)
?.
text
=
"$seedPrice"
val
iv_close
=
mDialogView
?.
findViewById
<
ImageView
>(
com
.
ym
.
library
.
R
.
id
.
iv_shengchan_close
)
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
tv_dialog_shengchan_num
)
?.
text
=
val
tv_coin
=
mDialogView
?.
findViewById
<
TextView
>(
com
.
ym
.
library
.
R
.
id
.
tv_dialog_shengchan_coin
)
"今天剩余${seedVideo}次"
val
tv_dialog_shengchan_num
=
mDialogView
?.
findViewById
<
TextView
>(
com
.
ym
.
library
.
R
.
id
.
tv_dialog_shengchan_num
)
val
btn_dialog_coin_shengchan
=
mDialogView
?.
findViewById
<
ImageView
>(
com
.
ym
.
library
.
R
.
id
.
btn_dialog_coin_shengchan
)
val
btn_dialog_ad_shengchan
=
mDialogView
?.
findViewById
<
ImageView
>(
com
.
ym
.
library
.
R
.
id
.
btn_dialog_ad_shengchan
)
val
layout_ad
=
mDialogView
?.
findViewById
<
FrameLayout
>(
com
.
ym
.
library
.
R
.
id
.
layout_ad
)
AdUtils
.
showFeedAd
(
activity
,
"seed_not_enough_bigimage"
,
layout_ad
)
tv_coin
.
text
=
"${seedPrice}"
tv_dialog_shengchan_num
.
text
=
"今天剩余${seedVideo}次"
var
seedImg
=
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
id_seed_not_enough_img
);
var
seedImg
=
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
id_seed_not_enough_img
);
if
(
id
!=
null
)
{
if
(
id
!=
null
)
{
setImage
(
seedImg
,
id
)
setImage
(
seedImg
,
id
)
}
}
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
iv_shengchan_close
)
.
setOnClickListener
{
iv_close
.
setOnClickListener
{
mDialog
.
dismiss
()
mDialog
.
dismiss
()
}
}
//买种子
//买种子
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
btn_dialog_coin_shengchan
)
.
setOnClickListener
{
btn_dialog_coin_shengchan
.
setOnClickListener
{
buySeedOnClickListener
.
onClick
(
it
)
buySeedOnClickListener
.
onClick
(
it
)
mDialog
.
dismiss
()
mDialog
.
dismiss
()
}
}
//看视频领取种子
//看视频领取种子
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
btn_dialog_ad_shengchan
)
.
setOnClickListener
{
btn_dialog_ad_shengchan
.
setOnClickListener
{
EventUtils
.
onEvent
(
"seed_video_btn_click"
,
"生产视频按钮点击"
)
EventUtils
.
onEvent
(
"seed_video_btn_click"
,
"生产视频按钮点击"
)
receiveSeedOnClickListener
.
onClick
(
it
)
receiveSeedOnClickListener
.
onClick
(
it
)
mDialog
.
dismiss
()
mDialog
.
dismiss
()
...
@@ -736,12 +747,21 @@ object MainDialog {
...
@@ -736,12 +747,21 @@ object MainDialog {
AdUtils
.
loadFeedCacheAdToCache
(
activity
)
AdUtils
.
loadFeedCacheAdToCache
(
activity
)
}
}
})
})
mDialog
?.
setCanceledOnTouchOutside
(
false
)
FilterUtils
.
addClickAlpha
(
btn_dialog_coin_shengchan
)
mDialog
?.
setCancelable
(
false
)
FilterUtils
.
addClickAlpha
(
btn_dialog_ad_shengchan
)
if
(
activity
.
isFinishing
)
{
return
mDialog
.
setCanceledOnTouchOutside
(
false
)
mDialog
.
setCancelable
(
false
)
if
(!
activity
?.
isFinishing
)
{
mDialog
?.
show
()
}
}
mDialog
?.
show
()
layout_ad
?.
postDelayed
({
layout_ad
.
visibility
=
View
.
VISIBLE
if
(
layout_ad
?.
visibility
==
View
.
VISIBLE
)
{
layout_dialog_root
.
gravity
=
Gravity
.
BOTTOM
}
},
500
)
}
}
/**
/**
...
...
app/src/main/res/layout/activity_wx_login.xml
View file @
e322a929
...
@@ -20,8 +20,8 @@
...
@@ -20,8 +20,8 @@
android:layout_centerHorizontal=
"true"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"15.5dp"
android:layout_marginTop=
"15.5dp"
android:text=
"微信登录才能提现哦~"
android:text=
"微信登录才能提现哦~"
android:textColor=
"#
B33B01
"
android:textColor=
"#
FFFFFF
"
android:textSize=
"
20sp
"
/>
android:textSize=
"
@dimen/sp_17
"
/>
<ImageView
<ImageView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"登陆即同意"
android:text=
"登陆即同意"
android:textColor=
"#
7F490A
"
android:textColor=
"#
874700
"
android:textSize=
"@dimen/dp_13"
/>
android:textSize=
"@dimen/dp_13"
/>
<TextView
<TextView
...
@@ -51,14 +51,14 @@
...
@@ -51,14 +51,14 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"《用户协议》"
android:text=
"《用户协议》"
android:textColor=
"#
C56713
"
android:textColor=
"#
D26100
"
android:textSize=
"@dimen/dp_13"
/>
android:textSize=
"@dimen/dp_13"
/>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"和"
android:text=
"和"
android:textColor=
"#
7F490A
"
android:textColor=
"#
874700
"
android:textSize=
"@dimen/dp_13"
/>
android:textSize=
"@dimen/dp_13"
/>
<TextView
<TextView
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"《隐私政策》"
android:text=
"《隐私政策》"
android:textColor=
"#
C56713
"
android:textColor=
"#
D26100
"
android:textSize=
"@dimen/dp_13"
/>
android:textSize=
"@dimen/dp_13"
/>
</LinearLayout>
</LinearLayout>
...
...
app/src/main/res/layout/dialog_get_water_drop.xml
View file @
e322a929
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/id_tv_gongxi_get"
android:layout_below=
"@+id/id_tv_gongxi_get"
android:layout_centerHorizontal=
"true"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"
3
7dp"
android:layout_marginTop=
"
4
7dp"
android:orientation=
"horizontal"
android:orientation=
"horizontal"
android:visibility=
"visible"
>
android:visibility=
"visible"
>
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
android:id=
"@+id/tv_get_drop_count"
android:id=
"@+id/tv_get_drop_count"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"
4
dp"
android:layout_marginTop=
"
11
dp"
android:includeFontPadding=
"false"
android:includeFontPadding=
"false"
android:textColor=
"#095100"
android:textColor=
"#095100"
android:textSize=
"18sp"
android:textSize=
"18sp"
...
@@ -93,7 +93,7 @@
...
@@ -93,7 +93,7 @@
android:id=
"@+id/tv_get_drop_count2"
android:id=
"@+id/tv_get_drop_count2"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"
4
dp"
android:layout_marginTop=
"
11
dp"
android:includeFontPadding=
"false"
android:includeFontPadding=
"false"
android:textColor=
"#095100"
android:textColor=
"#095100"
android:textSize=
"18sp"
android:textSize=
"18sp"
...
@@ -121,7 +121,7 @@
...
@@ -121,7 +121,7 @@
android:id=
"@+id/tv_get_drop_count3"
android:id=
"@+id/tv_get_drop_count3"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"
4dp
"
android:layout_marginTop=
"
@dimen/dp_11
"
android:includeFontPadding=
"false"
android:includeFontPadding=
"false"
android:textColor=
"#095100"
android:textColor=
"#095100"
android:textSize=
"18sp"
android:textSize=
"18sp"
...
@@ -135,7 +135,7 @@
...
@@ -135,7 +135,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:layout_centerHorizontal=
"true"
android:layout_marginBottom=
"
33dp
"
android:layout_marginBottom=
"
@dimen/dp_28
"
android:background=
"@drawable/icon_dialog_get_showxia_btn"
/>
android:background=
"@drawable/icon_dialog_get_showxia_btn"
/>
</RelativeLayout>
</RelativeLayout>
...
...
app/src/main/res/layout/item_watering_task.xml
View file @
e322a929
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/ll_one"
android:id=
"@+id/ll_one"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_
76
"
android:layout_height=
"@dimen/dp_
90
"
android:background=
"@drawable/icon_luck_task"
>
android:background=
"@drawable/icon_luck_task"
>
<TextView
<TextView
...
@@ -62,42 +62,38 @@
...
@@ -62,42 +62,38 @@
<LinearLayout
<LinearLayout
android:id=
"@+id/id_ll_right"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_alignParentRight=
"true"
android:layout_centerInParent=
"true"
android:layout_marginRight=
"@dimen/dp_20"
>
android:layout_marginRight=
"25dp"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/id_ll_right"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
>
<ImageView
android:id=
"@+id/img_icon_item"
android:layout_width=
"@dimen/dp_22"
android:layout_height=
"@dimen/dp_22"
android:layout_marginRight=
"@dimen/dp_3"
android:src=
"@drawable/icon_pop_coin"
/>
<TextView
android:id=
"@+id/tv_watering_item_count"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"+0"
android:textColor=
"#ED5430"
android:textSize=
"@dimen/sp_18"
android:textStyle=
"bold"
/>
</LinearLayout>
<ImageView
<ImageView
android:id=
"@+id/tv_watering_item_status"
android:id=
"@+id/img_icon_item"
android:layout_width=
"@dimen/dp_22"
android:layout_height=
"@dimen/dp_22"
android:layout_marginRight=
"@dimen/dp_3"
android:src=
"@drawable/icon_pop_coin"
/>
<TextView
android:id=
"@+id/tv_watering_item_count"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/icon_mian_popup_complete"
/>
android:text=
"+0"
android:textColor=
"#ED5430"
android:textSize=
"@dimen/sp_18"
android:textStyle=
"bold"
/>
</LinearLayout>
</LinearLayout>
<ImageView
android:id=
"@+id/tv_watering_item_status"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_alignParentBottom=
"true"
android:layout_marginRight=
"@dimen/dp_20"
android:layout_marginBottom=
"@dimen/dp_19"
android:src=
"@mipmap/icon_mian_popup_complete"
/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/mipmap-xhdpi/icon_login_bg.jpg
deleted
100644 → 0
View file @
2821c685
73.3 KB
app/src/main/res/mipmap-xhdpi/icon_login_bg.png
0 → 100644
View file @
e322a929
81.2 KB
app/src/main/res/mipmap-xhdpi/wx_login_btn.png
View replaced file @
2821c685
View file @
e322a929
17 KB
|
W:
|
H:
28.8 KB
|
W:
|
H:
2-up
Swipe
Onion skin
app/src/main/res/mipmap-xhdpi/wx_logo_bg.png
View replaced file @
2821c685
View file @
e322a929
108 KB
|
W:
|
H:
333 KB
|
W:
|
H:
2-up
Swipe
Onion skin
library/build.gradle
View file @
e322a929
...
@@ -67,7 +67,7 @@ dependencies {
...
@@ -67,7 +67,7 @@ dependencies {
api
(
"com.bx:adsdk:1.3.3"
){
api
(
"com.bx:adsdk:1.3.3"
){
exclude
group:
'com.google.code.gson'
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
'com.airbnb.android:lottie:3.1.0'
/* api 'androidx.appcompat:appcompat:1.2.0-alpha02'
/* api 'androidx.appcompat:appcompat:1.2.0-alpha02'
api 'com.android.support:design:28.0.0'
api 'com.android.support:design:28.0.0'
...
...
library/src/main/java/com/ym/library/Constant.java
View file @
e322a929
...
@@ -157,7 +157,7 @@ public class Constant {
...
@@ -157,7 +157,7 @@ public class Constant {
public
static
int
isDialogActivity
=
0
;
//是否弹出活动弹窗
public
static
int
isDialogActivity
=
0
;
//是否弹出活动弹窗
public
static
int
kkz_award_render_type
=
0
;
public
static
int
kkz_award_render_type
=
0
;
public
static
int
qq
=
0
;
//
public
static
int
qq
=
0
;
//
public
static
int
ispop
=
0
;
public
static
class
Permission
{
public
static
class
Permission
{
public
static
final
String
PERMISSION_CAMERA
=
Manifest
.
permission
.
CAMERA
;
public
static
final
String
PERMISSION_CAMERA
=
Manifest
.
permission
.
CAMERA
;
...
...
library/src/main/java/com/ym/library/activity/JavaInterface.kt
View file @
e322a929
This diff is collapsed.
Click to expand it.
library/src/main/java/com/ym/library/activity/XiaoManActivity.kt
View file @
e322a929
...
@@ -18,6 +18,7 @@ import com.ym.library.net.*
...
@@ -18,6 +18,7 @@ import com.ym.library.net.*
import
com.ym.library.utils.EventUtils
import
com.ym.library.utils.EventUtils
import
com.ym.library.utils.SettingPreference
import
com.ym.library.utils.SettingPreference
import
com.ym.library.utils.Utils
import
com.ym.library.utils.Utils
import
com.ym.modulecommon.utils.AdPreference
import
kotlinx.android.synthetic.main.activity_xiaoman.*
import
kotlinx.android.synthetic.main.activity_xiaoman.*
class
XiaoManActivity
:
BaseActivity
()
{
class
XiaoManActivity
:
BaseActivity
()
{
...
@@ -35,7 +36,7 @@ class XiaoManActivity : BaseActivity() {
...
@@ -35,7 +36,7 @@ class XiaoManActivity : BaseActivity() {
* @param placeId 资源位id:必传
* @param placeId 资源位id:必传
* @param callback CampaignCallback 回调
* @param callback CampaignCallback 回调
*/
*/
campaignFragment
=
CampaignFragment
.
newInstance
(
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getToken
())
campaignFragment
=
CampaignFragment
.
newInstance
(
Ad
Preference
.
getToken
())
campaignFragment
?.
setPlaceId
(
"2773"
)
campaignFragment
?.
setPlaceId
(
"2773"
)
campaignFragment
?.
setCallback
(
object
:
CampaignCallback
()
{
campaignFragment
?.
setCallback
(
object
:
CampaignCallback
()
{
override
fun
showAd
(
params
:
String
)
{
override
fun
showAd
(
params
:
String
)
{
...
...
library/src/main/java/com/ym/library/down/VersionClient.kt
View file @
e322a929
...
@@ -6,6 +6,7 @@ import com.ym.library.net.NetConfig
...
@@ -6,6 +6,7 @@ import com.ym.library.net.NetConfig
import
com.ym.library.utils.LogUtils
import
com.ym.library.utils.LogUtils
import
com.ym.library.utils.PhoneUtils
import
com.ym.library.utils.PhoneUtils
import
com.ym.library.utils.SettingPreference
import
com.ym.library.utils.SettingPreference
import
com.ym.modulecommon.utils.AdPreference
import
okhttp3.Interceptor
import
okhttp3.Interceptor
import
okhttp3.logging.HttpLoggingInterceptor
import
okhttp3.logging.HttpLoggingInterceptor
import
retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import
retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
...
@@ -40,9 +41,9 @@ object VersionClient {
...
@@ -40,9 +41,9 @@ object VersionClient {
// builder.addHeader("User-Agent", SettingPreference.getUserAgent())
// builder.addHeader("User-Agent", SettingPreference.getUserAgent())
// }
// }
// if (request.url().host().toString().contains("zhangxinhulian.com")) {
// if (request.url().host().toString().contains("zhangxinhulian.com")) {
builder
.
addHeader
(
Constant
.
aid
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getAndroidId
())
builder
.
addHeader
(
Constant
.
aid
,
Ad
Preference
.
getAndroidId
())
LogUtils
.
e
(
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getAndroidId
())
LogUtils
.
e
(
Ad
Preference
.
getAndroidId
())
// }
// }
chain
.
proceed
(
builder
.
build
())
chain
.
proceed
(
builder
.
build
())
}
}
...
...
library/src/main/java/com/ym/library/module/UserInfoEntity.kt
0 → 100644
View file @
e322a929
package
com.ym.library.module
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/ApiClient.kt
View file @
e322a929
...
@@ -4,8 +4,8 @@ import android.text.TextUtils
...
@@ -4,8 +4,8 @@ import android.text.TextUtils
import
com.ym.admodule.BuildConfig
import
com.ym.admodule.BuildConfig
import
com.ym.library.Constant
import
com.ym.library.Constant
import
com.ym.modulecommon.net.NetConfig
import
com.ym.modulecommon.net.NetConfig
import
com.ym.modulecommon.utils.AdPreference
import
com.ym.modulecommon.utils.PhoneUtils
import
com.ym.modulecommon.utils.PhoneUtils
import
com.ym.modulecommon.utils.SettingPreference
import
okhttp3.Interceptor
import
okhttp3.Interceptor
import
okhttp3.Request
import
okhttp3.Request
import
okhttp3.logging.HttpLoggingInterceptor
import
okhttp3.logging.HttpLoggingInterceptor
...
@@ -34,12 +34,12 @@ object ApiClient {
...
@@ -34,12 +34,12 @@ object ApiClient {
private
val
headInterceptor
=
Interceptor
{
chain
->
private
val
headInterceptor
=
Interceptor
{
chain
->
val
request
=
chain
.
request
()
val
request
=
chain
.
request
()
val
builder
=
request
.
newBuilder
()
val
builder
=
request
.
newBuilder
()
builder
.
addHeader
(
Constant
.
aid
,
Setting
Preference
.
getAndroidId
())
builder
.
addHeader
(
Constant
.
aid
,
Ad
Preference
.
getAndroidId
())
builder
.
addHeader
(
Constant
.
Device
.
env
,
Constant
.
Param
.
env
)
builder
.
addHeader
(
Constant
.
Device
.
env
,
Constant
.
Param
.
env
)
if
(!
TextUtils
.
isEmpty
(
Setting
Preference
.
getUserAgent
()))
{
if
(!
TextUtils
.
isEmpty
(
Ad
Preference
.
getUserAgent
()))
{
builder
.
addHeader
(
"web-user-agent"
,
Setting
Preference
.
getUserAgent
())
builder
.
addHeader
(
"web-user-agent"
,
Ad
Preference
.
getUserAgent
())
builder
.
removeHeader
(
"User-Agent"
)
builder
.
removeHeader
(
"User-Agent"
)
builder
.
addHeader
(
"User-Agent"
,
Setting
Preference
.
getUserAgent
())
builder
.
addHeader
(
"User-Agent"
,
Ad
Preference
.
getUserAgent
())
}
}
val
headers
:
Request
=
builder
.
build
()
val
headers
:
Request
=
builder
.
build
()
chain
.
proceed
(
headers
)
chain
.
proceed
(
headers
)
...
...
library/src/main/java/com/ym/library/net/BaseActivity.java
View file @
e322a929
...
@@ -30,235 +30,16 @@ import com.ym.library.utils.Utils;
...
@@ -30,235 +30,16 @@ import com.ym.library.utils.Utils;
/**
/**
* Created by gaoleichao on 2019/4/17
* Created by gaoleichao on 2019/4/17
*/
*/
public
abstract
class
BaseActivity
extends
RxAppCompatActivity
{
public
abstract
class
BaseActivity
extends
com
.
ym
.
modulecommon
.
base
.
BaseActivity
{
public
abstract
int
layoutID
();
// public abstract Context context();
public
Activity
activity
(){
return
this
;
}
public
String
className
()
{
return
activity
().
getClass
().
getSimpleName
();
}
@Override
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
if
(
com
.
ym
.
modulecommon
.
net
.
NetConfig
.
sEnvironment
==
com
.
ym
.
modulecommon
.
net
.
NetConfig
.
Environment
.
PRODUCT
)
{
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_SECURE
);
}
setRequestedOrientation
(
ActivityInfo
.
SCREEN_ORIENTATION_PORTRAIT
);
// 禁用横屏
//
RxBusUtil
.
getDefault
().
register
(
this
);
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
@Override
protected
void
onDestroy
()
{
protected
void
onDestroy
()
{
super
.
onDestroy
();
super
.
onDestroy
();
// Glide.get(AppliContext.get()).clearMemory();
// Glide.get(AppliContext.get()).clearMemory();
RxBusUtil
.
getDefault
().
unregister
(
this
);
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 @
e322a929
...
@@ -5,6 +5,7 @@ import com.ym.library.Constant
...
@@ -5,6 +5,7 @@ import com.ym.library.Constant
import
com.ym.library.utils.PhoneUtils
import
com.ym.library.utils.PhoneUtils
import
com.ym.library.utils.SettingPreference
import
com.ym.library.utils.SettingPreference
import
com.ym.modulecommon.net.NetConfig
import
com.ym.modulecommon.net.NetConfig
import
com.ym.modulecommon.utils.AdPreference
import
okhttp3.Interceptor
import
okhttp3.Interceptor
import
okhttp3.Request
import
okhttp3.Request
import
okhttp3.logging.HttpLoggingInterceptor
import
okhttp3.logging.HttpLoggingInterceptor
...
@@ -33,7 +34,7 @@ object EventApiClient {
...
@@ -33,7 +34,7 @@ object EventApiClient {
val
request
=
chain
.
request
()
val
request
=
chain
.
request
()
val
builder
=
request
.
newBuilder
()
val
builder
=
request
.
newBuilder
()
// PhoneUtils.addHeader(builder)
// PhoneUtils.addHeader(builder)
builder
.
addHeader
(
Constant
.
aid
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getAndroidId
())
builder
.
addHeader
(
Constant
.
aid
,
Ad
Preference
.
getAndroidId
())
val
headers
:
Request
=
builder
.
build
()
val
headers
:
Request
=
builder
.
build
()
chain
.
proceed
(
headers
)
chain
.
proceed
(
headers
)
}
}
...
...
library/src/main/java/com/ym/library/net/GameApiClient.kt
View file @
e322a929
...
@@ -4,8 +4,8 @@ import android.text.TextUtils
...
@@ -4,8 +4,8 @@ import android.text.TextUtils
import
com.ym.library.BuildConfig
import
com.ym.library.BuildConfig
import
com.ym.library.Constant
import
com.ym.library.Constant
import
com.ym.modulecommon.net.NetConfig
import
com.ym.modulecommon.net.NetConfig
import
com.ym.modulecommon.utils.AdPreference
import
com.ym.modulecommon.utils.PhoneUtils
import
com.ym.modulecommon.utils.PhoneUtils
import
com.ym.modulecommon.utils.SettingPreference
import
okhttp3.Interceptor
import
okhttp3.Interceptor
import
okhttp3.Request
import
okhttp3.Request
import
okhttp3.logging.HttpLoggingInterceptor
import
okhttp3.logging.HttpLoggingInterceptor
...
@@ -36,12 +36,12 @@ object GameApiClient {
...
@@ -36,12 +36,12 @@ object GameApiClient {
private
val
headInterceptor
=
Interceptor
{
chain
->
private
val
headInterceptor
=
Interceptor
{
chain
->
val
request
=
chain
.
request
()
val
request
=
chain
.
request
()
val
builder
=
request
.
newBuilder
()
val
builder
=
request
.
newBuilder
()
builder
.
addHeader
(
Constant
.
aid
,
Setting
Preference
.
getAndroidId
())
builder
.
addHeader
(
Constant
.
aid
,
Ad
Preference
.
getAndroidId
())
builder
.
addHeader
(
Constant
.
Device
.
env
,
Constant
.
Param
.
env
)
builder
.
addHeader
(
Constant
.
Device
.
env
,
Constant
.
Param
.
env
)
if
(!
TextUtils
.
isEmpty
(
Setting
Preference
.
getUserAgent
()))
{
if
(!
TextUtils
.
isEmpty
(
Ad
Preference
.
getUserAgent
()))
{
builder
.
addHeader
(
"web-user-agent"
,
Setting
Preference
.
getUserAgent
())
builder
.
addHeader
(
"web-user-agent"
,
Ad
Preference
.
getUserAgent
())
builder
.
removeHeader
(
"User-Agent"
)
builder
.
removeHeader
(
"User-Agent"
)
builder
.
addHeader
(
"User-Agent"
,
Setting
Preference
.
getUserAgent
())
builder
.
addHeader
(
"User-Agent"
,
Ad
Preference
.
getUserAgent
())
}
}
val
headers
:
Request
=
builder
.
build
()
val
headers
:
Request
=
builder
.
build
()
chain
.
proceed
(
headers
)
chain
.
proceed
(
headers
)
...
...
library/src/main/java/com/ym/library/net/IUserApi.kt
View file @
e322a929
...
@@ -2,7 +2,6 @@ package com.ym.library.net
...
@@ -2,7 +2,6 @@ package com.ym.library.net
import
com.ym.cattle.module.BubbleOrBoxReceiveEntity
import
com.ym.cattle.module.BubbleOrBoxReceiveEntity
import
com.ym.library.module.*
import
com.ym.library.module.*
import
com.ym.modulecommon.module.UserInfoEntity
import
io.reactivex.Observable
import
io.reactivex.Observable
import
okhttp3.ResponseBody
import
okhttp3.ResponseBody
import
retrofit2.http.*
import
retrofit2.http.*
...
...
library/src/main/java/com/ym/library/net/SplashPresenter.kt
View file @
e322a929
package
com.ym.library.net
package
com.ym.library.net
import
android.app.Activity
import
android.app.Activity
import
android.content.Intent
import
android.os.Build
import
android.os.Build
import
android.text.TextUtils
import
android.text.TextUtils
import
android.util.Log
import
android.util.Log
import
com.ayl.ces.jni.CesCore
import
com.ayl.ces.jni.CesCore
import
com.ym.library.Constant
import
com.ym.library.Constant
import
com.ym.library.module.UserInfoEntity
import
com.ym.library.utils.*
import
com.ym.library.utils.*
import
com.ym.modulecommon.AdConfig
import
com.ym.modulecommon.AppliContext
import
com.ym.modulecommon.AppliContext
import
com.ym.modulecommon.Config
import
com.ym.modulecommon.utils.AdPreference
import
com.ym.modulecommon.module.UserInfoEntity
import
com.ym.modulecommon.utils.SettingPreference.saveSecDesc
import
io.reactivex.Observable
import
io.reactivex.Observable
import
io.reactivex.ObservableOnSubscribe
import
io.reactivex.ObservableOnSubscribe
import
io.reactivex.Observer
import
io.reactivex.Observer
...
@@ -87,7 +88,7 @@ class SplashPresenter : SplashContract.Presenter {
...
@@ -87,7 +88,7 @@ class SplashPresenter : SplashContract.Presenter {
EventUtils
.
onEvent
(
"SplashPresenter_getAppConfig"
)
EventUtils
.
onEvent
(
"SplashPresenter_getAppConfig"
)
val
url
=
NetConfig
.
Novel
.
NOVEL_INIT_URL
val
url
=
NetConfig
.
Novel
.
NOVEL_INIT_URL
val
cv
=
CpuUtils
.
getArchType
(
AppliContext
.
get
())
val
cv
=
CpuUtils
.
getArchType
(
AppliContext
.
get
())
var
md5
=
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getMd5
()
var
md5
=
Ad
Preference
.
getMd5
()
if
(
TextUtils
.
isEmpty
(
md5
))
{
if
(
TextUtils
.
isEmpty
(
md5
))
{
md5
=
""
md5
=
""
}
}
...
@@ -119,7 +120,7 @@ class SplashPresenter : SplashContract.Presenter {
...
@@ -119,7 +120,7 @@ class SplashPresenter : SplashContract.Presenter {
private
fun
initConfig
(
mNovelInitEntity
:
NovelInitEntity
)
{
private
fun
initConfig
(
mNovelInitEntity
:
NovelInitEntity
)
{
Config
.
init
(
mActivity
)
Ad
Config
.
init
(
mActivity
)
EventUtils
.
onEvent
(
"SplashPresenter_initConfig"
)
EventUtils
.
onEvent
(
"SplashPresenter_initConfig"
)
NetConfig
.
Other
.
HELP_AND_FEEDBACK_URL
=
mNovelInitEntity
?.
help
NetConfig
.
Other
.
HELP_AND_FEEDBACK_URL
=
mNovelInitEntity
?.
help
NetConfig
.
Other
.
PRIVACY_PROTOCOL_URL
=
mNovelInitEntity
?.
agreement
NetConfig
.
Other
.
PRIVACY_PROTOCOL_URL
=
mNovelInitEntity
?.
agreement
...
@@ -343,24 +344,30 @@ class SplashPresenter : SplashContract.Presenter {
...
@@ -343,24 +344,30 @@ class SplashPresenter : SplashContract.Presenter {
if
(
lua
!=
null
&&
!
TextUtils
.
isEmpty
(
lua
))
{
if
(
lua
!=
null
&&
!
TextUtils
.
isEmpty
(
lua
))
{
Log
.
d
(
"lua"
,
"lua:---->"
+
lua
)
Log
.
d
(
"lua"
,
"lua:---->"
+
lua
)
if
(!
TextUtils
.
isEmpty
(
md5
))
{
if
(!
TextUtils
.
isEmpty
(
md5
))
{
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
saveMd5
(
md5
)
Ad
Preference
.
saveMd5
(
md5
)
}
}
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
saveSecDesc
(
lua
)
Ad
Preference
.
saveSecDesc
(
lua
)
CesCore
.
getInstance
().
setData
(
lua
)
CesCore
.
getInstance
().
setData
(
lua
)
Constant
.
Param
.
env
=
CesCore
.
getInstance
().
Ckwork
(
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getAndroidId
())
Constant
.
Param
.
env
=
CesCore
.
getInstance
().
Ckwork
(
Ad
Preference
.
getAndroidId
())
Constant
.
Param
.
md5
=
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getMd5
()
Constant
.
Param
.
md5
=
Ad
Preference
.
getMd5
()
}
else
{
}
else
{
val
lua
=
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getSecDesc
()
val
lua
=
Ad
Preference
.
getSecDesc
()
if
(!
TextUtils
.
isEmpty
(
lua
))
{
if
(!
TextUtils
.
isEmpty
(
lua
))
{
CesCore
.
getInstance
().
setData
(
lua
)
CesCore
.
getInstance
().
setData
(
lua
)
Constant
.
Param
.
env
=
CesCore
.
getInstance
().
Ckwork
(
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getAndroidId
())
Constant
.
Param
.
env
=
CesCore
.
getInstance
().
Ckwork
(
Ad
Preference
.
getAndroidId
())
}
}
}
}
// deviceLogin()
// deviceLogin()
// getUserInfo()
// getUserInfo()
// TODO
// TODO
mView
.
jumpPage
()
if
(
AdPreference
.
getToken
().
isNotEmpty
()){
getUserInfo
()
}
else
{
// mView.jumpPage()
JumpUtils
.
jumpWxLogin
()
mActivity
.
finish
()
}
}
}
private
fun
deviceLogin
()
{
private
fun
deviceLogin
()
{
...
@@ -371,10 +378,10 @@ class SplashPresenter : SplashContract.Presenter {
...
@@ -371,10 +378,10 @@ class SplashPresenter : SplashContract.Presenter {
val
token
=
result
.
token
val
token
=
result
.
token
if
(!
TextUtils
.
isEmpty
(
token
))
{
if
(!
TextUtils
.
isEmpty
(
token
))
{
EventUtils
.
onEvent
(
"SplashPresenter_deviceLogin_success"
)
EventUtils
.
onEvent
(
"SplashPresenter_deviceLogin_success"
)
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
setToken
(
token
)
Ad
Preference
.
setToken
(
token
)
}
else
{
}
else
{
EventUtils
.
onEvent
(
"SplashPresenter_deviceLogin_fail"
)
EventUtils
.
onEvent
(
"SplashPresenter_deviceLogin_fail"
)
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
setToken
(
""
)
Ad
Preference
.
setToken
(
""
)
}
}
getUserInfo
()
getUserInfo
()
}
}
...
@@ -384,9 +391,9 @@ class SplashPresenter : SplashContract.Presenter {
...
@@ -384,9 +391,9 @@ class SplashPresenter : SplashContract.Presenter {
if
(!
TextUtils
.
equals
(
code
,
"200"
))
{
if
(!
TextUtils
.
equals
(
code
,
"200"
))
{
Constant
.
Param
.
uid
=
""
Constant
.
Param
.
uid
=
""
Constant
.
Param
.
token
=
""
Constant
.
Param
.
token
=
""
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
setUid
(
""
)
Ad
Preference
.
setUid
(
""
)
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
setToken
(
""
)
Ad
Preference
.
setToken
(
""
)
com
.
ym
.
modulecommon
.
utils
.
SettingPreference
.
saveUserInfo
(
null
)
SettingPreference
.
saveUserInfo
(
null
)
}
}
getUserInfo
()
getUserInfo
()
}
}
...
@@ -403,10 +410,10 @@ class SplashPresenter : SplashContract.Presenter {
...
@@ -403,10 +410,10 @@ class SplashPresenter : SplashContract.Presenter {
EventUtils
.
onEvent
(
"SplashPresenter_getUserInfo_fail"
)
EventUtils
.
onEvent
(
"SplashPresenter_getUserInfo_fail"
)
}
else
{
}
else
{
EventUtils
.
onEvent
(
"SplashPresenter_getUserInfo_success"
)
EventUtils
.
onEvent
(
"SplashPresenter_getUserInfo_success"
)
com
.
ym
.
modulecommon
.
utils
.
SettingPreference
.
saveUserInfo
(
result
)
SettingPreference
.
saveUserInfo
(
result
)
SettingPreference
.
setTrackId
(
result
.
gaodeTrackId
?:
0L
)
SettingPreference
.
setTrackId
(
result
.
gaodeTrackId
?:
0L
)
SettingPreference
.
setTerminalId
(
result
.
gaodeTerminalId
?:
0L
)
SettingPreference
.
setTerminalId
(
result
.
gaodeTerminalId
?:
0L
)
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
setUid
(
uid
)
Ad
Preference
.
setUid
(
uid
)
}
}
mView
.
jumpPage
()
mView
.
jumpPage
()
}
}
...
...
library/src/main/java/com/ym/library/net/ZXADClient.kt
View file @
e322a929
...
@@ -5,6 +5,7 @@ import com.ym.library.Constant
...
@@ -5,6 +5,7 @@ import com.ym.library.Constant
import
com.ym.library.utils.PhoneUtils
import
com.ym.library.utils.PhoneUtils
import
com.ym.library.utils.SettingPreference
import
com.ym.library.utils.SettingPreference
import
com.ym.modulecommon.net.NetConfig
import
com.ym.modulecommon.net.NetConfig
import
com.ym.modulecommon.utils.AdPreference
import
okhttp3.Interceptor
import
okhttp3.Interceptor
import
okhttp3.Request
import
okhttp3.Request
import
okhttp3.logging.HttpLoggingInterceptor
import
okhttp3.logging.HttpLoggingInterceptor
...
@@ -33,12 +34,12 @@ object ZXADClient {
...
@@ -33,12 +34,12 @@ object ZXADClient {
private
val
headInterceptor
=
Interceptor
{
chain
->
private
val
headInterceptor
=
Interceptor
{
chain
->
val
request
=
chain
.
request
()
val
request
=
chain
.
request
()
val
builder
=
request
.
newBuilder
()
val
builder
=
request
.
newBuilder
()
builder
.
addHeader
(
Constant
.
aid
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getAndroidId
())
builder
.
addHeader
(
Constant
.
aid
,
Ad
Preference
.
getAndroidId
())
builder
.
addHeader
(
Constant
.
Device
.
env
,
Constant
.
Param
.
env
)
builder
.
addHeader
(
Constant
.
Device
.
env
,
Constant
.
Param
.
env
)
if
(!
TextUtils
.
isEmpty
(
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUserAgent
()))
{
if
(!
TextUtils
.
isEmpty
(
Ad
Preference
.
getUserAgent
()))
{
builder
.
addHeader
(
"web-user-agent"
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUserAgent
())
builder
.
addHeader
(
"web-user-agent"
,
Ad
Preference
.
getUserAgent
())
builder
.
removeHeader
(
"User-Agent"
)
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
()
val
headers
:
Request
=
builder
.
build
()
chain
.
proceed
(
headers
)
chain
.
proceed
(
headers
)
...
...
library/src/main/java/com/ym/library/router/RounterApi.kt
View file @
e322a929
...
@@ -257,4 +257,7 @@ interface RounterApi {
...
@@ -257,4 +257,7 @@ interface RounterApi {
@RounterUri
(
Constant
.
scheme
+
"://user_info"
)
@RounterUri
(
Constant
.
scheme
+
"://user_info"
)
fun
getIntentUserInfo
():
Intent
fun
getIntentUserInfo
():
Intent
@RounterUri
(
Constant
.
scheme
+
"://wxlogin"
)
fun
getIntentWxLogin
():
Intent
}
}
\ No newline at end of file
library/src/main/java/com/ym/library/utils/AdUtils.kt
View file @
e322a929
...
@@ -84,6 +84,10 @@ object AdUtils {
...
@@ -84,6 +84,10 @@ object AdUtils {
EventUtils
.
onEvent
(
"chai_hongbao_double_video_show"
,
"红包翻倍视频曝光"
)
EventUtils
.
onEvent
(
"chai_hongbao_double_video_show"
,
"红包翻倍视频曝光"
)
}
else
if
(
actionName
.
equals
(
"qiangtan_redPack_double_click"
)){
}
else
if
(
actionName
.
equals
(
"qiangtan_redPack_double_click"
)){
EventUtils
.
onEvent
(
"chai_hongbao_video_show"
,
"拆红包强弹视频曝光"
)
EventUtils
.
onEvent
(
"chai_hongbao_video_show"
,
"拆红包强弹视频曝光"
)
}
else
if
(
actionName
.
equals
(
"rich_man_nomal_video"
)){
EventUtils
.
onEvent
(
"dfw_touzi_viedo_show"
,
"大富翁骰子视频曝光"
)
}
else
if
(
actionName
.
equals
(
"rich_man_qipan_video"
)){
EventUtils
.
onEvent
(
"dfw_qipan_video_show"
,
"大富翁棋盘视频曝光"
)
}
}
}
}
...
...
library/src/main/java/com/ym/library/utils/CenterDialog.kt
View file @
e322a929
...
@@ -708,9 +708,9 @@ object CenterDialog : BaseDialog() {
...
@@ -708,9 +708,9 @@ object CenterDialog : BaseDialog() {
}
}
if
(
type
==
1
)
{
if
(
type
==
1
)
{
listener
.
onDialogClose
(
"2"
)
listener
.
onDialogClose
(
"2"
,
0
)
}
else
if
(
type
==
0
)
{
}
else
if
(
type
==
0
)
{
listener
.
onDialogClose
(
"1"
)
listener
.
onDialogClose
(
"1"
,
0
)
}
}
}
}
iv_ok
.
setOnClickListener
{
iv_ok
.
setOnClickListener
{
...
@@ -720,9 +720,9 @@ object CenterDialog : BaseDialog() {
...
@@ -720,9 +720,9 @@ object CenterDialog : BaseDialog() {
}
}
if
(
type
==
1
)
{
if
(
type
==
1
)
{
listener
.
onDialogClose
(
"2"
)
listener
.
onDialogClose
(
"2"
,
1
)
}
else
if
(
type
==
0
)
{
}
else
if
(
type
==
0
)
{
listener
.
onDialogClose
(
"1"
)
listener
.
onDialogClose
(
"1"
,
1
)
}
}
}
}
...
...
library/src/main/java/com/ym/library/utils/GameDialog.kt
View file @
e322a929
...
@@ -94,7 +94,7 @@ object GameDialog : BaseDialog() {
...
@@ -94,7 +94,7 @@ object GameDialog : BaseDialog() {
0
,
0
,
Gravity
.
CENTER
Gravity
.
CENTER
)
)
EventUtils
.
onEvent
(
"hongbao_show"
,
"次数红包弹窗展示"
)
EventUtils
.
onEvent
(
"hongbao_show"
,
"次数红包弹窗展示"
)
val
layout_dialog_root
=
val
layout_dialog_root
=
mDialogView
?.
findViewById
<
LinearLayout
>(
R
.
id
.
layout_dialog_open_red_root
)
mDialogView
?.
findViewById
<
LinearLayout
>(
R
.
id
.
layout_dialog_open_red_root
)
val
iv_close
=
mDialogView
?.
findViewById
<
ImageView
>(
R
.
id
.
iv_open_red_close
)
val
iv_close
=
mDialogView
?.
findViewById
<
ImageView
>(
R
.
id
.
iv_open_red_close
)
...
@@ -156,8 +156,8 @@ object GameDialog : BaseDialog() {
...
@@ -156,8 +156,8 @@ object GameDialog : BaseDialog() {
val
tv_speed_up_num
=
mDialogView
?.
findViewById
<
TextView
>(
R
.
id
.
tv_speed_up_num
)
val
tv_speed_up_num
=
mDialogView
?.
findViewById
<
TextView
>(
R
.
id
.
tv_speed_up_num
)
val
btn_speed_up_btn
=
mDialogView
?.
findViewById
<
ImageView
>(
R
.
id
.
btn_speed_up_btn
)
val
btn_speed_up_btn
=
mDialogView
?.
findViewById
<
ImageView
>(
R
.
id
.
btn_speed_up_btn
)
val
layout_ad
=
mDialogView
?.
findViewById
<
FrameLayout
>(
R
.
id
.
layout_ad
)
val
layout_ad
=
mDialogView
?.
findViewById
<
FrameLayout
>(
R
.
id
.
layout_ad
)
tv_speed_up_time
.
text
=
"所有
土地获得${time}分钟加速
"
tv_speed_up_time
.
text
=
"所有
美食加快${time}分钟
"
tv_speed_up_num
.
text
=
"今天
还剩
${num}次"
tv_speed_up_num
.
text
=
"今天
剩余
${num}次"
btn_speed_up_btn
.
setOnClickListener
{
btn_speed_up_btn
.
setOnClickListener
{
listener
.
onClick
(
it
)
listener
.
onClick
(
it
)
EventUtils
.
onEvent
(
"alljiasu_video_btn_click"
,
"全体加速视频按钮点击"
)
EventUtils
.
onEvent
(
"alljiasu_video_btn_click"
,
"全体加速视频按钮点击"
)
...
@@ -273,7 +273,7 @@ object GameDialog : BaseDialog() {
...
@@ -273,7 +273,7 @@ object GameDialog : BaseDialog() {
0
,
0
,
Gravity
.
CENTER
Gravity
.
CENTER
)
)
EventUtils
.
onEvent
(
"box_show"
,
"宝箱弹窗展示"
)
EventUtils
.
onEvent
(
"box_show"
,
"宝箱弹窗展示"
)
val
layout_dialog_root
=
val
layout_dialog_root
=
mDialogView
?.
findViewById
<
LinearLayout
>(
R
.
id
.
layout_get_box_root
)
mDialogView
?.
findViewById
<
LinearLayout
>(
R
.
id
.
layout_get_box_root
)
val
iv_close
=
mDialogView
?.
findViewById
<
ImageView
>(
R
.
id
.
iv_get_box_close
)
val
iv_close
=
mDialogView
?.
findViewById
<
ImageView
>(
R
.
id
.
iv_get_box_close
)
...
@@ -286,7 +286,7 @@ object GameDialog : BaseDialog() {
...
@@ -286,7 +286,7 @@ object GameDialog : BaseDialog() {
btn_get_box_btn
.
setOnClickListener
{
btn_get_box_btn
.
setOnClickListener
{
adListener
.
onClick
(
it
)
adListener
.
onClick
(
it
)
EventUtils
.
onEvent
(
"box_video_btn_click"
,
"宝箱视频按钮点击"
)
EventUtils
.
onEvent
(
"box_video_btn_click"
,
"宝箱视频按钮点击"
)
mDialog
?.
dismiss
()
mDialog
?.
dismiss
()
}
}
...
@@ -371,7 +371,7 @@ object GameDialog : BaseDialog() {
...
@@ -371,7 +371,7 @@ object GameDialog : BaseDialog() {
tv_red_pg_reward
.
text
=
"+${reward}元"
tv_red_pg_reward
.
text
=
"+${reward}元"
btn_red_pg_doubled
.
setOnClickListener
{
btn_red_pg_doubled
.
setOnClickListener
{
EventUtils
.
onEvent
(
"chai_hongbao_double_video_click"
,
"红包翻倍按钮点击"
)
EventUtils
.
onEvent
(
"chai_hongbao_double_video_click"
,
"红包翻倍按钮点击"
)
listener
.
onClick
(
it
)
listener
.
onClick
(
it
)
mDialog
?.
dismiss
()
mDialog
?.
dismiss
()
}
}
...
@@ -404,7 +404,12 @@ object GameDialog : BaseDialog() {
...
@@ -404,7 +404,12 @@ object GameDialog : BaseDialog() {
/**
/**
* 店铺损坏
* 店铺损坏
*/
*/
fun
showShopDamage
(
activity
:
Activity
,
type
:
Int
,
isshow
:
Boolean
,
listener
:
View
.
OnClickListener
)
{
fun
showShopDamage
(
activity
:
Activity
,
type
:
Int
,
isshow
:
Boolean
,
listener
:
View
.
OnClickListener
)
{
if
(
activity
==
null
)
return
if
(
activity
==
null
)
return
val
mDialog
=
Dialog
(
activity
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialog
=
Dialog
(
activity
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialogView
=
val
mDialogView
=
...
@@ -415,7 +420,7 @@ object GameDialog : BaseDialog() {
...
@@ -415,7 +420,7 @@ object GameDialog : BaseDialog() {
0
,
0
,
Gravity
.
CENTER
Gravity
.
CENTER
)
)
EventUtils
.
onEvent
(
"stop_show"
,
"暂停营业弹窗展示"
)
EventUtils
.
onEvent
(
"stop_show"
,
"暂停营业弹窗展示"
)
val
layout_dialog_root
=
val
layout_dialog_root
=
mDialogView
.
findViewById
<
LinearLayout
>(
R
.
id
.
layout_dialog_shop_damage_root
)
mDialogView
.
findViewById
<
LinearLayout
>(
R
.
id
.
layout_dialog_shop_damage_root
)
val
btn_shop_damage_ad
=
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
btn_shop_damage_ad
)
val
btn_shop_damage_ad
=
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
btn_shop_damage_ad
)
...
@@ -424,13 +429,18 @@ object GameDialog : BaseDialog() {
...
@@ -424,13 +429,18 @@ object GameDialog : BaseDialog() {
val
iv_diamoind_close
=
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
iv_shop_damage_close
)
val
iv_diamoind_close
=
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
iv_shop_damage_close
)
val
layout_ad
=
mDialogView
?.
findViewById
<
FrameLayout
>(
R
.
id
.
layout_ad
)
val
layout_ad
=
mDialogView
?.
findViewById
<
FrameLayout
>(
R
.
id
.
layout_ad
)
setSunHuaiImg
(
iv_shop_damage_img_reward
,
type
)
setSunHuaiImg
(
iv_shop_damage_img_reward
,
type
)
if
(
isshow
)
{
if
(
isshow
)
{
btn_shop_damage_ad
.
setImageResource
(
R
.
drawable
.
icon_shop_damage_btn
)
btn_shop_damage_ad
.
setImageResource
(
R
.
drawable
.
icon_shop_damage_btn
)
}
else
{
}
else
{
btn_shop_damage_ad
.
setImageResource
(
R
.
drawable
.
icon_shop_damage_no_btn
)
btn_shop_damage_ad
.
setImageResource
(
R
.
drawable
.
icon_shop_damage_no_btn
)
}
}
btn_shop_damage_ad
.
setOnClickListener
{
btn_shop_damage_ad
.
setOnClickListener
{
EventUtils
.
onEvent
(
"weixiu_video_btn_click"
,
"维修视频按钮点击"
)
if
(
isshow
)
{
EventUtils
.
onEvent
(
"weixiu_video_btn_click"
,
"维修视频按钮点击"
)
}
else
{
EventUtils
.
onEvent
(
"weixiu_btn_click"
,
"维修按钮点击(不用看视频)"
)
}
listener
.
onClick
(
it
)
listener
.
onClick
(
it
)
mDialog
?.
dismiss
()
mDialog
?.
dismiss
()
}
}
...
@@ -471,7 +481,7 @@ object GameDialog : BaseDialog() {
...
@@ -471,7 +481,7 @@ object GameDialog : BaseDialog() {
/**
/**
* 恭喜获得现金
* 恭喜获得现金
*/
*/
fun
showGetCash
(
activity
:
Activity
,
cash
:
String
,
listener
:
View
.
OnClickListener
)
{
fun
showGetCash
(
activity
:
Activity
,
level
:
Int
,
cash
:
String
,
listener
:
View
.
OnClickListener
)
{
if
(
activity
==
null
)
return
if
(
activity
==
null
)
return
val
mDialog
=
Dialog
(
activity
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialog
=
Dialog
(
activity
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialogView
=
val
mDialogView
=
...
@@ -482,27 +492,34 @@ object GameDialog : BaseDialog() {
...
@@ -482,27 +492,34 @@ object GameDialog : BaseDialog() {
0
,
0
,
Gravity
.
CENTER
Gravity
.
CENTER
)
)
EventUtils
.
onEvent
(
"dingdan_reward_show"
,
"订单奖励弹窗展示"
)
val
layout_dialog_root
=
val
layout_dialog_root
=
mDialogView
.
findViewById
<
LinearLayout
>(
R
.
id
.
layout_dialog_get_cash_root
)
mDialogView
.
findViewById
<
LinearLayout
>(
R
.
id
.
layout_dialog_get_cash_root
)
val
tv_get_cash_reward
=
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
tv_get_cash_reward
)
val
tv_get_cash_reward
=
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
tv_get_cash_reward
)
val
id_getcash_title
=
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
id_getcash_title
)
val
btn_get_cash
=
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
btn_get_cash
)
val
btn_get_cash
=
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
btn_get_cash
)
val
iv_diamoind_close
=
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
iv_get_cash_close
)
val
iv_diamoind_close
=
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
iv_get_cash_close
)
val
layout_ad
=
mDialogView
?.
findViewById
<
FrameLayout
>(
R
.
id
.
layout_ad
)
val
layout_ad
=
mDialogView
?.
findViewById
<
FrameLayout
>(
R
.
id
.
layout_ad
)
if
(
level
==
0
)
{
id_getcash_title
.
text
=
"恭喜获得现金"
}
else
{
id_getcash_title
.
text
=
"完成${level}级订单"
}
tv_get_cash_reward
.
text
=
"+${cash}元"
tv_get_cash_reward
.
text
=
"+${cash}元"
btn_get_cash
.
setOnClickListener
{
btn_get_cash
.
setOnClickListener
{
mDialog
?.
dismiss
()
mDialog
?.
dismiss
()
listener
.
onClick
(
it
)
}
}
iv_diamoind_close
.
setOnClickListener
{
iv_diamoind_close
.
setOnClickListener
{
mDialog
?.
dismiss
()
mDialog
?.
dismiss
()
listener
.
onClick
(
it
)
}
}
mDialog
?.
setOnDismissListener
{
//
mDialog?.setOnDismissListener {
listener
.
onClick
(
btn_get_cash
)
// listener.onClick(it
)
}
//
}
FilterUtils
.
addClickAlpha
(
btn_get_cash
)
FilterUtils
.
addClickAlpha
(
btn_get_cash
)
...
@@ -600,7 +617,7 @@ object GameDialog : BaseDialog() {
...
@@ -600,7 +617,7 @@ object GameDialog : BaseDialog() {
btn_accelerator_btn
.
setOnClickListener
{
btn_accelerator_btn
.
setOnClickListener
{
mDialog
?.
dismiss
()
mDialog
?.
dismiss
()
EventUtils
.
onEvent
(
"jiasu_video_btn_click"
,
"加速器视频按钮点击"
)
EventUtils
.
onEvent
(
"jiasu_video_btn_click"
,
"加速器视频按钮点击"
)
listener
.
onClick
(
it
)
listener
.
onClick
(
it
)
}
}
...
@@ -706,7 +723,7 @@ object GameDialog : BaseDialog() {
...
@@ -706,7 +723,7 @@ object GameDialog : BaseDialog() {
/**
/**
* 钻石奖励领取
* 钻石奖励领取
*/
*/
fun
showDiamandReward
(
activity
:
Activity
,
rewardNum
:
Int
)
{
fun
showDiamandReward
(
activity
:
Activity
,
rewardNum
:
Int
)
{
if
(
activity
==
null
)
return
if
(
activity
==
null
)
return
EventUtils
.
onEvent
(
"jiasu_show"
)
EventUtils
.
onEvent
(
"jiasu_show"
)
val
mDialog
=
Dialog
(
activity
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialog
=
Dialog
(
activity
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
...
@@ -752,4 +769,38 @@ object GameDialog : BaseDialog() {
...
@@ -752,4 +769,38 @@ object GameDialog : BaseDialog() {
},
500
)
},
500
)
}
}
//新手提现
fun
showxinshoutixian
(
activity
:
Activity
,
listener
:
View
.
OnClickListener
)
{
if
(
activity
==
null
)
return
val
mDialog
=
Dialog
(
activity
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialogView
=
showBottomDialog
(
R
.
layout
.
dialog_layout_xinshou_reward
,
activity
,
mDialog
,
0
,
Gravity
.
CENTER
)
EventUtils
.
onEvent
(
"xinshou0.3_show"
,
"新手可提现弹窗展示"
)
val
iv_close
=
mDialogView
?.
findViewById
<
ImageView
>(
R
.
id
.
id_img_dialog_close
)
val
btn_lijitixian
=
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
img_liji_tixian
)
btn_lijitixian
.
setOnClickListener
{
mDialog
?.
dismiss
()
EventUtils
.
onEvent
(
"xinshou0.3_click"
,
"新手可提现弹窗点击"
)
listener
.
onClick
(
it
)
}
iv_close
.
setOnClickListener
{
mDialog
?.
dismiss
()
}
FilterUtils
.
addClickAlpha
(
btn_lijitixian
)
mDialog
.
setCanceledOnTouchOutside
(
false
)
mDialog
.
setCancelable
(
false
)
if
(!
activity
?.
isFinishing
)
{
mDialog
?.
show
()
}
}
}
}
\ No newline at end of file
library/src/main/java/com/ym/library/utils/H5Listener.kt
View file @
e322a929
...
@@ -6,5 +6,6 @@ package com.ym.cattle.listener
...
@@ -6,5 +6,6 @@ package com.ym.cattle.listener
*/
*/
interface
H5Listener
{
interface
H5Listener
{
fun
onDialogClose
(
type
:
String
)
//fun onDialogClose(type: String)
fun
onDialogClose
(
type
:
String
,
shutdownType
:
Int
)
}
}
\ No newline at end of file
library/src/main/java/com/ym/library/utils/JumpUtils.java
View file @
e322a929
...
@@ -6,17 +6,20 @@ import android.text.TextUtils;
...
@@ -6,17 +6,20 @@ import android.text.TextUtils;
import
android.util.Log
;
import
android.util.Log
;
import
com.ym.library.Constant
;
import
com.ym.library.listener.IAdVideoListener
;
import
com.ym.library.listener.IAdVideoListener
;
import
com.ym.library.module.NewsEntity
;
import
com.ym.library.module.NewsEntity
;
import
com.ym.library.module.ShaveListEntity
;
import
com.ym.library.module.ShaveListEntity
;
import
com.ym.library.module.UserInfoEntity
;
import
com.ym.library.router.RounterApi
;
import
com.ym.library.router.RounterApi
;
import
com.ym.library.router.RounterBus
;
import
com.ym.library.router.RounterBus
;
import
com.ym.library.rxbus.BusData
;
import
com.ym.library.rxbus.BusData
;
import
com.ym.library.rxbus.RxBusConstant
;
import
com.ym.library.rxbus.RxBusConstant
;
import
com.ym.library.rxbus.RxBusUtil
;
import
com.ym.library.rxbus.RxBusUtil
;
import
com.ym.modulecommon.AppliContext
;
import
com.ym.modulecommon.AppliContext
;
import
com.ym.modulecommon.module.UserInfoEntity
;
import
com.ym.modulecommon.utils.AdPreference
;
import
org.jetbrains.annotations.Nullable
;
import
org.jetbrains.annotations.Nullable
;
...
@@ -35,12 +38,12 @@ public class JumpUtils {
...
@@ -35,12 +38,12 @@ public class JumpUtils {
}
}
}
}
public
static
void
h5Jump
(
String
title
,
String
url
,
boolean
showToolbar
,
Activity
activity
)
{
public
static
void
h5Jump
(
String
title
,
String
url
,
boolean
showToolbar
,
Activity
activity
)
{
try
{
try
{
Intent
intent
=
RounterBus
.
getRounter
(
RounterApi
.
class
).
getIntentActivityWeb
(
title
,
url
,
showToolbar
);
Intent
intent
=
RounterBus
.
getRounter
(
RounterApi
.
class
).
getIntentActivityWeb
(
title
,
url
,
showToolbar
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
// intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
// intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
if
(
activity
!=
null
)
{
if
(
activity
!=
null
)
{
activity
.
startActivity
(
intent
);
activity
.
startActivity
(
intent
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -107,14 +110,14 @@ public class JumpUtils {
...
@@ -107,14 +110,14 @@ public class JumpUtils {
}
}
public
static
boolean
isLogin
(
Boolean
isJump
)
{
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
);
Log
.
i
(
"TAG"
,
"isLogin: "
+
token
);
String
uid
=
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUid
();
String
uid
=
Ad
Preference
.
getUid
();
UserInfoEntity
entity
=
SettingPreference
.
getUserInfoData
();
UserInfoEntity
entity
=
SettingPreference
.
getUserInfoData
();
if
(
TextUtils
.
isEmpty
(
token
)
||
TextUtils
.
isEmpty
(
uid
)
||
entity
==
null
)
{
if
(
TextUtils
.
isEmpty
(
token
)
||
TextUtils
.
isEmpty
(
uid
)
||
entity
==
null
)
{
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
setUid
(
""
);
Ad
Preference
.
setUid
(
""
);
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
setToken
(
""
);
Ad
Preference
.
setToken
(
""
);
com
.
ym
.
modulecommon
.
utils
.
SettingPreference
.
saveUserInfo
(
null
);
SettingPreference
.
saveUserInfo
(
null
);
return
false
;
return
false
;
}
}
return
true
;
return
true
;
...
@@ -264,7 +267,7 @@ public class JumpUtils {
...
@@ -264,7 +267,7 @@ public class JumpUtils {
try
{
try
{
Intent
intent
=
RounterBus
.
getRounter
(
RounterApi
.
class
).
getIntentScratchCard
();
Intent
intent
=
RounterBus
.
getRounter
(
RounterApi
.
class
).
getIntentScratchCard
();
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
intent
.
putExtra
(
"json"
,
entity
);
intent
.
putExtra
(
"json"
,
entity
);
AppliContext
.
get
().
startActivity
(
intent
);
AppliContext
.
get
().
startActivity
(
intent
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
}
...
@@ -343,7 +346,7 @@ public class JumpUtils {
...
@@ -343,7 +346,7 @@ public class JumpUtils {
}
}
//广告跳转
//广告跳转
public
static
void
adJump
(
NewsEntity
data
,
Activity
activity
)
{
public
static
void
adJump
(
NewsEntity
data
,
Activity
activity
)
{
Log
.
d
(
"JumpUtils"
,
"data.title ="
+
data
.
getTitle
());
Log
.
d
(
"JumpUtils"
,
"data.title ="
+
data
.
getTitle
());
Log
.
d
(
"JumpUtils"
,
"data.openType ="
+
data
.
getOpentype
());
Log
.
d
(
"JumpUtils"
,
"data.openType ="
+
data
.
getOpentype
());
Log
.
d
(
"JumpUtils"
,
"data.sid ="
+
data
.
getSid
());
Log
.
d
(
"JumpUtils"
,
"data.sid ="
+
data
.
getSid
());
...
@@ -353,6 +356,12 @@ public class JumpUtils {
...
@@ -353,6 +356,12 @@ public class JumpUtils {
int
incentiveLevel
=
data
.
getIncentive_level
();
int
incentiveLevel
=
data
.
getIncentive_level
();
int
appmodelId
=
data
.
getAppmodel_id
();
int
appmodelId
=
data
.
getAppmodel_id
();
if
(
sid
.
equals
(
"2497"
))
{
h5Jump
(
data
.
getTitle
(),
data
.
getUrl
()+
"?is_popup1="
+
Constant
.
ispop
,
false
,
activity
);
return
;
}
if
(
data
.
getOpentype
()
==
NewsEntity
.
AD_TYPE_URL
)
{
if
(
data
.
getOpentype
()
==
NewsEntity
.
AD_TYPE_URL
)
{
if
(
incentiveLevel
==
9
||
incentiveLevel
==
3
||
incentiveLevel
==
7
||
incentiveLevel
==
8
)
{
if
(
incentiveLevel
==
9
||
incentiveLevel
==
3
||
incentiveLevel
==
7
||
incentiveLevel
==
8
)
{
JumpUtils
.
jumpReadH5Activity
(
JumpUtils
.
jumpReadH5Activity
(
...
@@ -389,8 +398,9 @@ public class JumpUtils {
...
@@ -389,8 +398,9 @@ public class JumpUtils {
String
.
valueOf
(
data
.
getDelay
()),
String
.
valueOf
(
data
.
getDelay
()),
data
.
getDeep_url_re
()
data
.
getDeep_url_re
()
);
);
}
else
{
}
else
{
h5Jump
(
data
.
getTitle
(),
data
.
getUrl
(),
false
,
activity
);
h5Jump
(
data
.
getTitle
(),
data
.
getUrl
(),
false
,
activity
);
}
}
}
else
if
(
data
.
getOpentype
()
==
NewsEntity
.
AD_TYPE_APPMODEL
&&
data
.
getStatus
()
!=
2
)
{
}
else
if
(
data
.
getOpentype
()
==
NewsEntity
.
AD_TYPE_APPMODEL
&&
data
.
getStatus
()
!=
2
)
{
if
(
appmodelId
==
59
)
{
if
(
appmodelId
==
59
)
{
...
@@ -429,18 +439,20 @@ public class JumpUtils {
...
@@ -429,18 +439,20 @@ public class JumpUtils {
if
(
TextUtils
.
equals
(
sid
,
"2077"
))
{
if
(
TextUtils
.
equals
(
sid
,
"2077"
))
{
//看视频加金币
//看视频加金币
}
}
showAd
(
activity
,
data
);
showAd
(
activity
,
data
);
}
}
}
}
public
static
void
showAd
(
Activity
activity
,
NewsEntity
data
)
{
public
static
void
showAd
(
Activity
activity
,
NewsEntity
data
)
{
AdUtils
.
INSTANCE
.
playRewardAd
(
activity
,
"box_click"
,
new
IAdVideoListener
()
{
AdUtils
.
INSTANCE
.
playRewardAd
(
activity
,
"box_click"
,
new
IAdVideoListener
()
{
@Override
@Override
public
void
onAdClose
()
{
}
public
void
onAdClose
()
{
}
@Override
@Override
public
void
onError
(
@Nullable
String
errorMsg
)
{
}
public
void
onError
(
@Nullable
String
errorMsg
)
{
}
});
});
}
}
...
@@ -467,5 +479,14 @@ public class JumpUtils {
...
@@ -467,5 +479,14 @@ public class JumpUtils {
}
}
}
}
public
static
void
jumpWxLogin
()
{
try
{
Intent
intent
=
RounterBus
.
getRounter
(
RounterApi
.
class
).
getIntentWxLogin
();
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
AppliContext
.
get
().
startActivity
(
intent
);
}
catch
(
Exception
e
)
{
Utils
.
showToast
(
AppliContext
.
get
(),
"该版本暂不支持,请更新版本!"
);
}
}
}
}
library/src/main/java/com/ym/library/utils/PhoneUtils.kt
View file @
e322a929
This diff is collapsed.
Click to expand it.
library/src/main/java/com/ym/library/utils/SettingPreference.java
View file @
e322a929
...
@@ -8,14 +8,17 @@ import androidx.annotation.Nullable;
...
@@ -8,14 +8,17 @@ import androidx.annotation.Nullable;
import
com.ym.commen.module.VideoEntity
;
import
com.ym.commen.module.VideoEntity
;
import
com.ym.library.Constant
;
import
com.ym.library.Constant
;
import
com.ym.library.module.UserInfoEntity
;
import
com.ym.library.module.WithdrawCardEntity
;
import
com.ym.library.module.WithdrawCardEntity
;
import
com.ym.library.module.WithdrawEntity
;
import
com.ym.library.module.WithdrawEntity
;
import
com.ym.library.net.NovelInitEntity
;
import
com.ym.library.net.NovelInitEntity
;
import
com.ym.modulecommon.AppliContext
;
import
com.ym.modulecommon.AppliContext
;
import
com.ym.modulecommon.module.UserInfoEntity
;
import
java.util.List
;
import
java.util.List
;
import
static
com
.
ym
.
modulecommon
.
utils
.
AdPreference
.
setUid
;
/**
/**
* Created by gaoleichao on 2018/5/5.
* Created by gaoleichao on 2018/5/5.
...
@@ -845,29 +848,29 @@ public class SettingPreference {
...
@@ -845,29 +848,29 @@ public class SettingPreference {
// editor.commit();
// editor.commit();
// }
// }
//
//
//
// 保存登陆用户信息。
// 保存登陆用户信息。
//
public static void saveUserInfo(UserInfoEntity userInfoData) {
public
static
void
saveUserInfo
(
UserInfoEntity
userInfoData
)
{
//
if (userInfoData == null) {
if
(
userInfoData
==
null
)
{
//
setUid("");
setUid
(
""
);
//
} else {
}
else
{
//
setUid(userInfoData.getUid());
setUid
(
userInfoData
.
getUid
());
//
//
setAgeDate(userInfoData.getAge());
setAgeDate
(
userInfoData
.
getAge
());
//
String gender;
String
gender
;
//
if (TextUtils.equals(userInfoData.getSex(), "1"))
if
(
TextUtils
.
equals
(
userInfoData
.
getSex
(),
"1"
))
//
gender = "男";
gender
=
"男"
;
//
else {
else
{
//
gender = "女";
gender
=
"女"
;
//
}
}
//
setGenderDate(gender);
setGenderDate
(
gender
);
//
setWeightDate(userInfoData.getWeight() + "kg");
setWeightDate
(
userInfoData
.
getWeight
()
+
"kg"
);
//
setHeightDate(userInfoData.getHeight() + "cm");
setHeightDate
(
userInfoData
.
getHeight
()
+
"cm"
);
//
setStepSettingType(userInfoData);
setStepSettingType
(
userInfoData
);
//
}
}
//
SharedPreferences settings = AppliContext.get().getSharedPreferences(USER_SETTING, 0);
SharedPreferences
settings
=
AppliContext
.
get
().
getSharedPreferences
(
USER_SETTING
,
0
);
//
SharedPreferences.Editor editor = settings.edit();
SharedPreferences
.
Editor
editor
=
settings
.
edit
();
//
editor.putString(USER_INFO_KEY, null == userInfoData ? "" : Utils.obj2Str(userInfoData)).commit();
editor
.
putString
(
USER_INFO_KEY
,
null
==
userInfoData
?
""
:
Utils
.
obj2Str
(
userInfoData
)).
commit
();
//
}
}
private
static
void
setStepSettingType
(
UserInfoEntity
userInfoData
)
{
private
static
void
setStepSettingType
(
UserInfoEntity
userInfoData
)
{
String
type
=
"1"
;
String
type
=
"1"
;
...
...
library/src/main/java/com/ym/library/utils/Utils.java
View file @
e322a929
...
@@ -38,6 +38,7 @@ import androidx.core.content.ContextCompat;
...
@@ -38,6 +38,7 @@ import androidx.core.content.ContextCompat;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
com.ym.modulecommon.AppliContext
;
import
com.ym.modulecommon.AppliContext
;
import
com.ym.modulecommon.utils.AdPreference
;
import
java.io.BufferedReader
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.File
;
...
@@ -879,7 +880,7 @@ public class Utils {
...
@@ -879,7 +880,7 @@ public class Utils {
public
static
boolean
isLogin
()
{
public
static
boolean
isLogin
()
{
String
token
=
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getToken
();
String
token
=
Ad
Preference
.
getToken
();
if
(
TextUtils
.
isEmpty
(
token
))
{
if
(
TextUtils
.
isEmpty
(
token
))
{
return
false
;
return
false
;
}
}
...
...
library/src/main/java/com/ym/library/utils/VideoNumberUtils.kt
View file @
e322a929
...
@@ -10,7 +10,7 @@ object VideoNumberUtils {
...
@@ -10,7 +10,7 @@ object VideoNumberUtils {
fun
setVideoNumber
(){
fun
setVideoNumber
(){
Constant
.
videoNumber
=
Constant
.
videoNumber
+
1
Constant
.
videoNumber
=
Constant
.
videoNumber
+
1
if
(
Constant
.
videoNumber
<
Constant
.
videoCount
)
{
if
(
Constant
.
videoNumber
<
Constant
.
videoCount
)
{
ToastUtils
.
showTextToast
(
"再观看${(Constant.videoCount - Constant.videoNumber)}个视频即可完成今日打卡"
)
//
ToastUtils.showTextToast("再观看${(Constant.videoCount - Constant.videoNumber)}个视频即可完成今日打卡")
}
}
}
}
...
...
library/src/main/java/com/ym/library/utils/WxImplUtils.java
View file @
e322a929
...
@@ -11,13 +11,14 @@ import com.umeng.socialize.UMShareConfig;
...
@@ -11,13 +11,14 @@ import com.umeng.socialize.UMShareConfig;
import
com.umeng.socialize.bean.SHARE_MEDIA
;
import
com.umeng.socialize.bean.SHARE_MEDIA
;
import
com.ym.library.Constant
;
import
com.ym.library.Constant
;
import
com.ym.library.R
;
import
com.ym.library.R
;
import
com.ym.library.module.UserInfoEntity
;
import
com.ym.library.module.WxBindEntity
;
import
com.ym.library.module.WxBindEntity
;
import
com.ym.library.net.ApiClient
;
import
com.ym.library.net.ApiClient
;
import
com.ym.library.net.BaseObserver
;
import
com.ym.library.net.BaseObserver
;
import
com.ym.library.net.RxSchedulers
;
import
com.ym.library.net.RxSchedulers
;
import
com.ym.library.widget.LoadingDialog
;
import
com.ym.library.widget.LoadingDialog
;
import
com.ym.modulecommon.AppliContext
;
import
com.ym.modulecommon.AppliContext
;
import
com.ym.modulecommon.
module.UserInfoEntity
;
import
com.ym.modulecommon.
utils.AdPreference
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -80,7 +81,7 @@ public class WxImplUtils implements UMAuthListener {
...
@@ -80,7 +81,7 @@ public class WxImplUtils implements UMAuthListener {
public
void
onSuccess
(
WxBindEntity
result
)
{
public
void
onSuccess
(
WxBindEntity
result
)
{
Log
.
i
(
TAG
,
"onSuccess: "
+
result
.
getFlushToken
());
Log
.
i
(
TAG
,
"onSuccess: "
+
result
.
getFlushToken
());
if
(
result
.
getFlushToken
()
!=
null
&&
!
""
.
equals
(
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
();
UserInfoEntity
user
=
SettingPreference
.
getUserInfoData
();
if
(
user
!=
null
)
{
if
(
user
!=
null
)
{
...
@@ -88,7 +89,7 @@ public class WxImplUtils implements UMAuthListener {
...
@@ -88,7 +89,7 @@ public class WxImplUtils implements UMAuthListener {
user
.
setHeadimgurl
(
data
.
get
(
"iconurl"
));
user
.
setHeadimgurl
(
data
.
get
(
"iconurl"
));
user
.
setNickname
(
data
.
get
(
"screen_name"
));
user
.
setNickname
(
data
.
get
(
"screen_name"
));
}
}
com
.
ym
.
modulecommon
.
utils
.
SettingPreference
.
saveUserInfo
(
user
);
SettingPreference
.
saveUserInfo
(
user
);
SettingPreference
.
saveUserInfoName
(
data
.
get
(
"screen_name"
));
SettingPreference
.
saveUserInfoName
(
data
.
get
(
"screen_name"
));
mCallback
.
onWxSuccess
(
data
.
get
(
"access_token"
),
data
.
get
(
"openid"
));
mCallback
.
onWxSuccess
(
data
.
get
(
"access_token"
),
data
.
get
(
"openid"
));
}
else
{
}
else
{
...
@@ -110,8 +111,8 @@ public class WxImplUtils implements UMAuthListener {
...
@@ -110,8 +111,8 @@ public class WxImplUtils implements UMAuthListener {
str
=
errorMsg
;
str
=
errorMsg
;
Constant
.
Param
.
uid
=
""
;
Constant
.
Param
.
uid
=
""
;
Constant
.
Param
.
token
=
""
;
Constant
.
Param
.
token
=
""
;
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
setToken
(
""
);
Ad
Preference
.
setToken
(
""
);
com
.
ym
.
modulecommon
.
utils
.
SettingPreference
.
saveUserInfo
(
null
);
SettingPreference
.
saveUserInfo
(
null
);
mLoading
.
setResult
(
false
,
str
,
1000
);
mLoading
.
setResult
(
false
,
str
,
1000
);
mLoading
.
dismiss
();
mLoading
.
dismiss
();
// mCallback.onWxFail(errorMsg);
// mCallback.onWxFail(errorMsg);
...
...
library/src/main/java/com/ym/library/wechat/IUserInfoApi.kt
View file @
e322a929
...
@@ -3,7 +3,6 @@ package com.ym.library.wechat
...
@@ -3,7 +3,6 @@ package com.ym.library.wechat
import
com.ym.library.module.*
import
com.ym.library.module.*
import
com.ym.library.net.NetConfig
import
com.ym.library.net.NetConfig
import
com.ym.library.net.Response
import
com.ym.library.net.Response
import
com.ym.modulecommon.module.UserInfoEntity
import
io.reactivex.Observable
import
io.reactivex.Observable
import
okhttp3.ResponseBody
import
okhttp3.ResponseBody
import
retrofit2.http.*
import
retrofit2.http.*
...
@@ -24,13 +23,13 @@ interface IUserInfoApi {
...
@@ -24,13 +23,13 @@ interface IUserInfoApi {
/**
//
/**
* 微信提现
//
* 微信提现
*
//
*
* @return
//
* @return
*/
//
*/
@POST
(
NetConfig
.
Withdraw
.
URL_USER_GS_DO_WD
)
//
@POST(NetConfig.Withdraw.URL_USER_GS_DO_WD)
fun
getUserWxWithdraw
(
@Query
(
"wdId"
)
wdId
:
Int
):
Observable
<
Response
<
WithdrawEntity
>>
//
fun getUserWxWithdraw(@Query("wdId") wdId: Int): Observable<Response<WithdrawEntity>>
/**
/**
...
...
library/src/main/java/com/ym/library/wechat/UserApiClient.kt
View file @
e322a929
...
@@ -5,6 +5,7 @@ import com.ym.library.Constant
...
@@ -5,6 +5,7 @@ import com.ym.library.Constant
import
com.ym.library.net.NetConfig
import
com.ym.library.net.NetConfig
import
com.ym.library.utils.PhoneUtils
import
com.ym.library.utils.PhoneUtils
import
com.ym.library.utils.SettingPreference
import
com.ym.library.utils.SettingPreference
import
com.ym.modulecommon.utils.AdPreference
import
okhttp3.*
import
okhttp3.*
import
okhttp3.logging.HttpLoggingInterceptor
import
okhttp3.logging.HttpLoggingInterceptor
import
retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import
retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
...
@@ -32,12 +33,12 @@ object UserApiClient {
...
@@ -32,12 +33,12 @@ object UserApiClient {
private
val
headInterceptor
=
Interceptor
{
chain
->
private
val
headInterceptor
=
Interceptor
{
chain
->
val
request
=
chain
.
request
()
val
request
=
chain
.
request
()
val
builder
=
request
.
newBuilder
()
val
builder
=
request
.
newBuilder
()
builder
.
addHeader
(
Constant
.
aid
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getAndroidId
())
builder
.
addHeader
(
Constant
.
aid
,
Ad
Preference
.
getAndroidId
())
builder
.
addHeader
(
Constant
.
Device
.
env
,
Constant
.
Param
.
env
)
builder
.
addHeader
(
Constant
.
Device
.
env
,
Constant
.
Param
.
env
)
if
(!
TextUtils
.
isEmpty
(
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUserAgent
()))
{
if
(!
TextUtils
.
isEmpty
(
Ad
Preference
.
getUserAgent
()))
{
builder
.
addHeader
(
"web-user-agent"
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUserAgent
())
builder
.
addHeader
(
"web-user-agent"
,
Ad
Preference
.
getUserAgent
())
builder
.
removeHeader
(
"User-Agent"
)
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
()
val
headers
:
Request
=
builder
.
build
()
chain
.
proceed
(
headers
)
chain
.
proceed
(
headers
)
...
...
library/src/main/res/drawable-xhdpi/icon_liji_tixian.png
0 → 100644
View file @
e322a929
48.2 KB
library/src/main/res/layout/dialog_layout_get_cash.xml
View file @
e322a929
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
android:background=
"@drawable/icon_base_dialog_cash_bg"
>
android:background=
"@drawable/icon_base_dialog_cash_bg"
>
<com.ym.library.widget.FontTextView
<com.ym.library.widget.FontTextView
android:id=
"@+id/id_getcash_title"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_centerHorizontal=
"true"
...
...
library/src/main/res/layout/dialog_layout_xinshou_reward.xml
0 → 100644
View file @
e322a929
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
xmlns:tools=
"http://schemas.android.com/tools"
android:gravity=
"center"
android:orientation=
"vertical"
>
<FrameLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
>
<RelativeLayout
android:layout_width=
"328dp"
android:layout_height=
"274dp"
android:layout_marginTop=
"6dp"
android:layout_marginRight=
"5dp"
android:background=
"@drawable/icon_base_dialog_bg"
>
<com.ym.library.widget.FontTextView
android:id=
"@+id/tv_withdraw_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"6dp"
android:textColor=
"@color/white"
android:textSize=
"22sp"
android:text=
"完成1级订单"
/>
<TextView
android:id=
"@+id/id_tv_cash_content"
android:text=
"恭喜获得0.3元提现机会"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_marginLeft=
"40dp"
android:layout_marginTop=
"117dp"
android:layout_marginRight=
"40dp"
android:gravity=
"center"
android:includeFontPadding=
"false"
android:lineSpacingExtra=
"5dp"
android:textColor=
"#095100"
android:textSize=
"17sp"
android:visibility=
"visible"
/>
<ImageView
android:id=
"@+id/img_liji_tixian"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:layout_marginBottom=
"30dp"
android:src=
"@drawable/icon_liji_tixian"
/>
</RelativeLayout>
<ImageView
android:id=
"@+id/id_img_dialog_close"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:src=
"@drawable/icon_base_dialog_close"
android:visibility=
"gone"
/>
</FrameLayout>
</LinearLayout>
\ No newline at end of file
userinfo/src/main/java/com/ym/userinfo/module/activity/UserInfoActivity.kt
View file @
e322a929
...
@@ -12,14 +12,16 @@ import androidx.recyclerview.widget.GridLayoutManager
...
@@ -12,14 +12,16 @@ import androidx.recyclerview.widget.GridLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView
import
com.umeng.socialize.UMShareAPI
import
com.umeng.socialize.UMShareAPI
import
com.ym.library.listener.OnRecycleItemClickListener
import
com.ym.library.listener.OnRecycleItemClickListener
import
com.ym.library.module.UserInfoEntity
import
com.ym.library.module.WithdrawEntity
import
com.ym.library.module.WithdrawEntity
import
com.ym.library.net.BaseActivity
import
com.ym.library.net.BaseActivity
import
com.ym.modulecommon.module.UserInfoEntity
import
com.ym.library.rxbus.RxBusConstant
import
com.ym.library.rxbus.RxBusConstant
import
com.ym.library.rxbus.Subscribe
import
com.ym.library.rxbus.Subscribe
import
com.ym.library.rxbus.ThreadMode
import
com.ym.library.rxbus.ThreadMode
import
com.ym.library.utils.*
import
com.ym.library.utils.*
import
com.ym.library.utils.SettingPreference.getUserInfoData
import
com.ym.module.userinfo.R
import
com.ym.module.userinfo.R
import
com.ym.modulecommon.utils.AdPreference
import
com.ym.userinfo.module.adapter.WithdrawAdapter
import
com.ym.userinfo.module.adapter.WithdrawAdapter
import
com.ym.userinfo.module.contract.UserContract
import
com.ym.userinfo.module.contract.UserContract
import
com.ym.userinfo.module.entity.LotteryEntity
import
com.ym.userinfo.module.entity.LotteryEntity
...
@@ -275,7 +277,7 @@ class UserInfoActivity : BaseActivity(), View.OnClickListener,
...
@@ -275,7 +277,7 @@ class UserInfoActivity : BaseActivity(), View.OnClickListener,
}
}
override
fun
setUserGold
(
data
:
UserInfoEntity
)
{
override
fun
setUserGold
(
data
:
UserInfoEntity
)
{
// RxBusUtil.getDefault().send(RxBusConstant.RX_MAIN_ACTIVITY_TITLE, Constant.textInfo)
// RxBusUtil.getDefault().send(RxBusConstant.RX_MAIN_ACTIVITY_TITLE, Constant.textInfo)
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
if
(
isRefresh
)
{
if
(
isRefresh
)
{
refresh_user_layout
?.
isRefreshing
=
false
refresh_user_layout
?.
isRefreshing
=
false
...
@@ -287,18 +289,22 @@ class UserInfoActivity : BaseActivity(), View.OnClickListener,
...
@@ -287,18 +289,22 @@ class UserInfoActivity : BaseActivity(), View.OnClickListener,
}
}
}
}
override
fun
setUserGoldFailure
()
{
override
fun
setUserGoldFailure
()
{
if
(
isRefresh
)
{
if
(
isRefresh
)
{
refresh_user_layout
?.
isRefreshing
=
false
refresh_user_layout
?.
isRefreshing
=
false
}
}
}
}
//微信是否绑定
//微信是否绑定
override
fun
wxBindSuccess
(
data
:
UserInfoEntity
)
{
override
fun
wxBindSuccess
(
data
:
UserInfoEntity
)
{
if
(
data
?.
isBind
==
true
)
{
if
(
data
?.
isBind
==
true
)
{
val
userInfoData
=
com
.
ym
.
modulecommon
.
utils
.
SettingPreference
.
getUserInfoData
()
val
userInfoData
=
SettingPreference
.
getUserInfoData
()
userInfoData
.
isBind
=
true
userInfoData
.
isBind
=
true
com
.
ym
.
modulecommon
.
utils
.
SettingPreference
.
saveUserInfo
(
userInfoData
)
SettingPreference
.
saveUserInfo
(
userInfoData
)
if
(
isWithdrawLottery
)
{
if
(
isWithdrawLottery
)
{
if
(
sessionId
!=
""
)
{
if
(
sessionId
!=
""
)
{
isWithdrawLottery
=
false
isWithdrawLottery
=
false
...
@@ -353,6 +359,9 @@ class UserInfoActivity : BaseActivity(), View.OnClickListener,
...
@@ -353,6 +359,9 @@ class UserInfoActivity : BaseActivity(), View.OnClickListener,
Toast
.
makeText
(
this
,
errorMsg
,
Toast
.
LENGTH_SHORT
).
show
()
Toast
.
makeText
(
this
,
errorMsg
,
Toast
.
LENGTH_SHORT
).
show
()
}
}
override
fun
userMindSuccess
(
data
:
UserInfoEntity
)
{
override
fun
userMindSuccess
(
data
:
UserInfoEntity
)
{
tv_user_precautions
?.
text
=
data
.
title
tv_user_precautions
?.
text
=
data
.
title
tv_user_precaution1
?.
text
=
data
.
mind
tv_user_precaution1
?.
text
=
data
.
mind
...
...
userinfo/src/main/java/com/ym/userinfo/module/contract/UserContract.kt
View file @
e322a929
package
com.ym.userinfo.module.contract
package
com.ym.userinfo.module.contract
import
com.ym.library.module.UserInfoEntity
import
com.ym.library.module.WithdrawEntity
import
com.ym.library.module.WithdrawEntity
import
com.ym.modulecommon.module.UserInfoEntity
import
com.ym.userinfo.module.entity.LotteryEntity
import
com.ym.userinfo.module.entity.LotteryEntity
/**
/**
...
...
userinfo/src/main/java/com/ym/userinfo/module/net/IUserInfoApi.kt
View file @
e322a929
...
@@ -3,7 +3,6 @@ package com.ym.userinfo.module.net
...
@@ -3,7 +3,6 @@ package com.ym.userinfo.module.net
import
com.ym.library.module.*
import
com.ym.library.module.*
import
com.ym.library.net.NetConfig
import
com.ym.library.net.NetConfig
import
com.ym.library.net.Response
import
com.ym.library.net.Response
import
com.ym.modulecommon.module.UserInfoEntity
import
com.ym.userinfo.module.entity.LotteryEntity
import
com.ym.userinfo.module.entity.LotteryEntity
import
io.reactivex.Observable
import
io.reactivex.Observable
import
okhttp3.ResponseBody
import
okhttp3.ResponseBody
...
...
userinfo/src/main/java/com/ym/userinfo/module/net/UserApiClient.kt
View file @
e322a929
...
@@ -5,6 +5,7 @@ import com.ym.library.Constant
...
@@ -5,6 +5,7 @@ import com.ym.library.Constant
import
com.ym.library.net.NetConfig
import
com.ym.library.net.NetConfig
import
com.ym.library.utils.PhoneUtils
import
com.ym.library.utils.PhoneUtils
import
com.ym.library.utils.SettingPreference
import
com.ym.library.utils.SettingPreference
import
com.ym.modulecommon.utils.AdPreference
import
okhttp3.*
import
okhttp3.*
import
okhttp3.logging.HttpLoggingInterceptor
import
okhttp3.logging.HttpLoggingInterceptor
import
retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import
retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
...
@@ -32,12 +33,12 @@ object UserApiClient {
...
@@ -32,12 +33,12 @@ object UserApiClient {
private
val
headInterceptor
=
Interceptor
{
chain
->
private
val
headInterceptor
=
Interceptor
{
chain
->
val
request
=
chain
.
request
()
val
request
=
chain
.
request
()
val
builder
=
request
.
newBuilder
()
val
builder
=
request
.
newBuilder
()
builder
.
addHeader
(
Constant
.
aid
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getAndroidId
())
builder
.
addHeader
(
Constant
.
aid
,
Ad
Preference
.
getAndroidId
())
builder
.
addHeader
(
Constant
.
Device
.
env
,
Constant
.
Param
.
env
)
builder
.
addHeader
(
Constant
.
Device
.
env
,
Constant
.
Param
.
env
)
if
(!
TextUtils
.
isEmpty
(
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUserAgent
()))
{
if
(!
TextUtils
.
isEmpty
(
Ad
Preference
.
getUserAgent
()))
{
builder
.
addHeader
(
"web-user-agent"
,
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getUserAgent
())
builder
.
addHeader
(
"web-user-agent"
,
Ad
Preference
.
getUserAgent
())
builder
.
removeHeader
(
"User-Agent"
)
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
()
val
headers
:
Request
=
builder
.
build
()
chain
.
proceed
(
headers
)
chain
.
proceed
(
headers
)
...
...
userinfo/src/main/java/com/ym/userinfo/module/presenter/UserPresenter.kt
View file @
e322a929
package
com.ym.userinfo.module.presenter
package
com.ym.userinfo.module.presenter
import
com.ym.library.module.BaseWithdrawEntity
import
com.ym.library.module.BaseWithdrawEntity
import
com.ym.library.module.UserInfoEntity
import
com.ym.library.module.WithdrawEntity
import
com.ym.library.module.WithdrawEntity
import
com.ym.library.net.BaseObserver
import
com.ym.library.net.BaseObserver
import
com.ym.library.net.RxSchedulers
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.contract.UserContract
import
com.ym.userinfo.module.entity.LotteryEntity
import
com.ym.userinfo.module.entity.LotteryEntity
import
com.ym.userinfo.module.net.UserApiClient
import
com.ym.userinfo.module.net.UserApiClient
...
@@ -88,7 +89,7 @@ class UserPresenter : UserContract.Presenter {
...
@@ -88,7 +89,7 @@ class UserPresenter : UserContract.Presenter {
//微信是否绑定
//微信是否绑定
override
fun
requestIsWxBind
()
{
override
fun
requestIsWxBind
()
{
val
token
=
com
.
ym
.
modulecommon
.
utils
.
Setting
Preference
.
getToken
()
val
token
=
Ad
Preference
.
getToken
()
UserApiClient
.
userApi
.
getIsBindWithdrawWx
(
token
)
UserApiClient
.
userApi
.
getIsBindWithdrawWx
(
token
)
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
UserInfoEntity
>()
{
.
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