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
3008cb15
Commit
3008cb15
authored
Oct 23, 2020
by
wangxuewei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[提交人]:王雪伟
[提交简述] :幸福农场 [实现方案] :添加登录页面
parent
ad52538d
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
399 additions
and
228 deletions
+399
-228
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+3
-0
GameActivity.kt
app/src/main/java/com/ym/game/GameActivity.kt
+213
-214
SplashActivity.kt
app/src/main/java/com/ym/game/activity/SplashActivity.kt
+31
-11
WxLoginActivity.kt
app/src/main/java/com/ym/game/activity/WxLoginActivity.kt
+93
-0
BaseApplication.kt
app/src/main/java/com/ym/game/application/BaseApplication.kt
+1
-1
activity_wx_login.xml
app/src/main/res/layout/activity_wx_login.xml
+56
-0
wx_logo_bg.png
app/src/main/res/mipmap-xhdpi/wx_logo_bg.png
+0
-0
wx_logo_btn.png
app/src/main/res/mipmap-xhdpi/wx_logo_btn.png
+0
-0
version.properties
app/version.properties
+2
-2
No files found.
app/src/main/AndroidManifest.xml
View file @
3008cb15
...
@@ -52,6 +52,9 @@
...
@@ -52,6 +52,9 @@
<activity
<activity
android:name=
"com.ym.game.view.OrderListActivity"
android:name=
"com.ym.game.view.OrderListActivity"
android:exported=
"true"
/>
android:exported=
"true"
/>
<activity
android:name=
"com.ym.game.activity.WxLoginActivity"
android:exported=
"true"
/>
<activity
<activity
android:name=
"com.ym.game.GameActivity"
android:name=
"com.ym.game.GameActivity"
android:exported=
"true"
/>
android:exported=
"true"
/>
...
...
app/src/main/java/com/ym/game/GameActivity.kt
View file @
3008cb15
...
@@ -39,7 +39,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback, NetStateCh
...
@@ -39,7 +39,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback, NetStateCh
if
(
SettingPreference
.
getIsShowGuide
())
{
if
(
SettingPreference
.
getIsShowGuide
())
{
SettingPreference
.
setIsShowGuide
(
false
)
SettingPreference
.
setIsShowGuide
(
false
)
}
}
EventUtils
.
onEvent
(
"tab_imp"
,
"幸运农场"
)
EventUtils
.
onEvent
(
"tab_imp"
,
"幸运农场"
)
NetStateChangeReceiver
.
registerReceiver
(
this
);
NetStateChangeReceiver
.
registerReceiver
(
this
);
mLoading
=
LoadingDialog
.
getLoadingDialog
(
mLoading
=
LoadingDialog
.
getLoadingDialog
(
mContext
,
""
,
mContext
,
""
,
...
@@ -508,102 +508,65 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback, NetStateCh
...
@@ -508,102 +508,65 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback, NetStateCh
//看视频领取种子
//看视频领取种子
var
videoSeedClick
=
true
var
videoSeedClick
=
true
fun
getVideoSeedReceive
(
callback
:
IUnitySendMessageCallback
?,
id
:
Int
)
{
fun
getVideoSeedReceive
(
callback
:
IUnitySendMessageCallback
?,
id
:
Int
)
{
// if (videoSeedClick) {
if
(
videoSeedClick
)
{
// videoSeedClick = false
videoSeedClick
=
false
//
// AdManager.loadRewardVideoAd(
AdManager
.
loadRewardVideoAd
(
// ADConfig.AD_REWARD_VIDIO,
ADConfig
.
AD_REWARD_VIDIO
,
// this,
this
,
// object : ZXADVideoListener {
object
:
ZXADVideoListener
{
// override fun onFail() {
override
fun
onFail
()
{
// videoSeedClick = true
videoSeedClick
=
true
// }
}
//
// override fun onSuccess() {
override
fun
onSuccess
()
{
// videoSeedClick = true
videoSeedClick
=
true
// }
}
//
// override fun onError() {
override
fun
onError
()
{
// videoSeedClick = true
videoSeedClick
=
true
// }
}
//
// override fun onRewardVideoCached() {
// videoSeedClick = true
// }
//
// override fun setRewardAdInteractionListener() {
// videoSeedClick = true
// }
//
// override fun onRewardVerify() {
// videoSeedClick = true
// }
//
// override fun onVideoError() {
//// showToponWaterVideo()
// videoSeedClick = true
//
// }
//
// override fun onRewardVideoAdLoad() {
// videoSeedClick = true
// }
//
// override fun onRewardVideoAdLoad(entity: NewsEntity) {
// videoSeedClick = true
// }
//
// override fun onAdShow() {
// videoSeedClick = true
// }
//
// override fun onAdVideoBarClick(newsEntity: NewsEntity) {
// videoSeedClick = true
// }
//
// override fun onAdClose() {
// videoSeedClick = true
// //看视频上报
// getVideoAcceleratorsReceive();
// GameApiClient.gameApi.getVideoSeedReceive(id)
// .compose(RxSchedulers.observableIO2Main())
// .subscribe(object : BaseObserver<StatusEntity>() {
// override fun onSuccess(result: StatusEntity?) {
// result?.id = id
// Log.d("wxw", "看视频领取种子" + Utils.obj2Str(result))
// callback?.onIncrVideoSeedSuccess(true, Utils.obj2Str(result))
// }
//
// override fun onFailure(
// e: Throwable?,
// code: String?,
// errorMsg: String?
// ) {
// Log.d("wxw", "看视频领取种子 error")
// callback?.onIncrVideoSeedSuccess(false, errorMsg + "")
// }
// })
// }
//
// override fun onVideoComplete() {
// videoSeedClick = true
// }
//
// override fun onSkippedVideo() {
// videoSeedClick = true
// }
//
// override fun onFullScreenVideoCached() {
// videoSeedClick = true
// }
//
// override fun onLoadVideoAd(rewardVideoAD: ZXADRewardVideo) {
// videoSeedClick = true
// }
// })
// }
GameApiClient
.
gameApi
.
getVideoSeedReceive
(
id
).
compose
(
RxSchedulers
.
observableIO2Main
())
override
fun
onRewardVideoCached
()
{
videoSeedClick
=
true
}
override
fun
setRewardAdInteractionListener
()
{
videoSeedClick
=
true
}
override
fun
onRewardVerify
()
{
videoSeedClick
=
true
}
override
fun
onVideoError
()
{
// showToponWaterVideo()
videoSeedClick
=
true
}
override
fun
onRewardVideoAdLoad
()
{
videoSeedClick
=
true
}
override
fun
onRewardVideoAdLoad
(
entity
:
NewsEntity
)
{
videoSeedClick
=
true
}
override
fun
onAdShow
()
{
videoSeedClick
=
true
}
override
fun
onAdVideoBarClick
(
newsEntity
:
NewsEntity
)
{
videoSeedClick
=
true
}
override
fun
onAdClose
()
{
videoSeedClick
=
true
//看视频上报
getVideoAcceleratorsReceive
();
GameApiClient
.
gameApi
.
getVideoSeedReceive
(
id
)
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
StatusEntity
>()
{
.
subscribe
(
object
:
BaseObserver
<
StatusEntity
>()
{
override
fun
onSuccess
(
result
:
StatusEntity
?)
{
override
fun
onSuccess
(
result
:
StatusEntity
?)
{
result
?.
id
=
id
result
?.
id
=
id
...
@@ -611,125 +574,162 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback, NetStateCh
...
@@ -611,125 +574,162 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback, NetStateCh
callback
?.
onIncrVideoSeedSuccess
(
true
,
Utils
.
obj2Str
(
result
))
callback
?.
onIncrVideoSeedSuccess
(
true
,
Utils
.
obj2Str
(
result
))
}
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?
)
{
Log
.
d
(
"wxw"
,
"看视频领取种子 error"
)
Log
.
d
(
"wxw"
,
"看视频领取种子 error"
)
callback
?.
onIncrVideoSeedSuccess
(
false
,
errorMsg
+
""
)
callback
?.
onIncrVideoSeedSuccess
(
false
,
errorMsg
+
""
)
}
}
})
})
}
}
var
videoJiasuClick
=
true
override
fun
onVideoComplete
()
{
videoSeedClick
=
true
}
//看视频领取加速剂
override
fun
onSkippedVideo
()
{
fun
getVideoAcceleratorsReceive
(
callback
:
IUnitySendMessageCallback
?,
id
:
Int
)
{
videoSeedClick
=
true
// if (videoJiasuClick) {
}
// videoJiasuClick = false
// AdManager.loadRewardVideoAd(
override
fun
onFullScreenVideoCached
()
{
// ADConfig.AD_REWARD_VIDIO,
videoSeedClick
=
true
// this,
}
// object : ZXADVideoListener {
// override fun onFail() {
override
fun
onLoadVideoAd
(
rewardVideoAD
:
ZXADRewardVideo
)
{
// videoJiasuClick = true
videoSeedClick
=
true
// }
}
//
})
// override fun onSuccess() {
}
// videoJiasuClick = true
// }
// GameApiClient.gameApi.getVideoSeedReceive(id).compose(RxSchedulers.observableIO2Main())
//
// override fun onError() {
// videoJiasuClick = true
// }
//
// override fun onRewardVideoCached() {
// videoJiasuClick = true
// }
//
// override fun setRewardAdInteractionListener() {
// videoJiasuClick = true
// }
//
// override fun onRewardVerify() {
// videoJiasuClick = true
// }
//
// override fun onVideoError() {
//// showToponWaterVideo()
// videoJiasuClick = true
// }
//
// override fun onRewardVideoAdLoad() {
// videoJiasuClick = true
// }
//
// override fun onRewardVideoAdLoad(entity: NewsEntity) {
// videoJiasuClick = true
// }
//
// override fun onAdShow() {
// videoJiasuClick = true
// }
//
// override fun onAdVideoBarClick(newsEntity: NewsEntity) {
// videoJiasuClick = true
// }
//
// override fun onAdClose() {
// videoJiasuClick = true
// //看视频上报
// getVideoAcceleratorsReceive();
// GameApiClient.gameApi.getVideoAcceleratorsReceive(id)
// .compose(RxSchedulers.observableIO2Main())
// .subscribe(object : BaseObserver<StatusEntity>() {
// .subscribe(object : BaseObserver<StatusEntity>() {
// override fun onSuccess(result: StatusEntity?) {
// override fun onSuccess(result: StatusEntity?) {
// Log.d("wxw", "看视频领取加速剂" + Utils.obj2Str(result))
// result?.id = id
// callback?.onIncrVideoAcceleratorsSuccess(
// Log.d("wxw", "看视频领取种子" + Utils.obj2Str(result))
// true,
// callback?.onIncrVideoSeedSuccess(true, Utils.obj2Str(result))
// Utils.obj2Str(result)
// )
// }
//
// override fun onFailure(
// e: Throwable?,
// code: String?,
// errorMsg: String?
// ) {
// Log.d("wxw", "看视频领取加速剂 error")
// callback?.onIncrVideoAcceleratorsSuccess(false, errorMsg + "")
// }
// })
// }
//
// override fun onVideoComplete() {
// videoJiasuClick = true
// }
//
// override fun onSkippedVideo() {
// videoJiasuClick = true
// }
//
// override fun onFullScreenVideoCached() {
// videoJiasuClick = true
// }
// }
//
//
// override fun onLoadVideoAd(rewardVideoAD: ZXADRewardVideo) {
// override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
// videoJiasuClick = true
// Log.d("wxw", "看视频领取种子 error")
// callback?.onIncrVideoSeedSuccess(false, errorMsg + "")
// }
// }
// })
// })
// }
}
var
videoJiasuClick
=
true
//看视频领取加速剂
fun
getVideoAcceleratorsReceive
(
callback
:
IUnitySendMessageCallback
?,
id
:
Int
)
{
if
(
videoJiasuClick
)
{
videoJiasuClick
=
false
AdManager
.
loadRewardVideoAd
(
ADConfig
.
AD_REWARD_VIDIO
,
this
,
object
:
ZXADVideoListener
{
override
fun
onFail
()
{
videoJiasuClick
=
true
}
override
fun
onSuccess
()
{
videoJiasuClick
=
true
}
override
fun
onError
()
{
videoJiasuClick
=
true
}
override
fun
onRewardVideoCached
()
{
videoJiasuClick
=
true
}
override
fun
setRewardAdInteractionListener
()
{
videoJiasuClick
=
true
}
override
fun
onRewardVerify
()
{
videoJiasuClick
=
true
}
override
fun
onVideoError
()
{
// showToponWaterVideo()
videoJiasuClick
=
true
}
override
fun
onRewardVideoAdLoad
()
{
videoJiasuClick
=
true
}
override
fun
onRewardVideoAdLoad
(
entity
:
NewsEntity
)
{
videoJiasuClick
=
true
}
override
fun
onAdShow
()
{
videoJiasuClick
=
true
}
override
fun
onAdVideoBarClick
(
newsEntity
:
NewsEntity
)
{
videoJiasuClick
=
true
}
override
fun
onAdClose
()
{
videoJiasuClick
=
true
//看视频上报
getVideoAcceleratorsReceive
();
GameApiClient
.
gameApi
.
getVideoAcceleratorsReceive
(
id
)
GameApiClient
.
gameApi
.
getVideoAcceleratorsReceive
(
id
)
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
StatusEntity
>()
{
.
subscribe
(
object
:
BaseObserver
<
StatusEntity
>()
{
override
fun
onSuccess
(
result
:
StatusEntity
?)
{
override
fun
onSuccess
(
result
:
StatusEntity
?)
{
Log
.
d
(
"wxw"
,
"看视频领取加速剂"
+
Utils
.
obj2Str
(
result
))
Log
.
d
(
"wxw"
,
"看视频领取加速剂"
+
Utils
.
obj2Str
(
result
))
callback
?.
onIncrVideoAcceleratorsSuccess
(
true
,
Utils
.
obj2Str
(
result
))
callback
?.
onIncrVideoAcceleratorsSuccess
(
true
,
Utils
.
obj2Str
(
result
)
)
}
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?
)
{
Log
.
d
(
"wxw"
,
"看视频领取加速剂 error"
)
Log
.
d
(
"wxw"
,
"看视频领取加速剂 error"
)
callback
?.
onIncrVideoAcceleratorsSuccess
(
false
,
errorMsg
+
""
)
callback
?.
onIncrVideoAcceleratorsSuccess
(
false
,
errorMsg
+
""
)
}
}
})
})
}
override
fun
onVideoComplete
()
{
videoJiasuClick
=
true
}
override
fun
onSkippedVideo
()
{
videoJiasuClick
=
true
}
override
fun
onFullScreenVideoCached
()
{
videoJiasuClick
=
true
}
override
fun
onLoadVideoAd
(
rewardVideoAD
:
ZXADRewardVideo
)
{
videoJiasuClick
=
true
}
})
}
// GameApiClient.gameApi.getVideoAcceleratorsReceive(id)
// .compose(RxSchedulers.observableIO2Main())
// .subscribe(object : BaseObserver<StatusEntity>() {
// override fun onSuccess(result: StatusEntity?) {
// Log.d("wxw", "看视频领取加速剂" + Utils.obj2Str(result))
// callback?.onIncrVideoAcceleratorsSuccess(true, Utils.obj2Str(result))
// }
//
// override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
// Log.d("wxw", "看视频领取加速剂 error")
// callback?.onIncrVideoAcceleratorsSuccess(false, errorMsg + "")
// }
// })
}
}
...
@@ -803,7 +803,6 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback, NetStateCh
...
@@ -803,7 +803,6 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback, NetStateCh
override
fun
onCloseViewSuccess
(
isSuccess
:
Boolean
)
{
override
fun
onCloseViewSuccess
(
isSuccess
:
Boolean
)
{
//关闭view
//关闭view
Log
.
d
(
"wxw"
,
"关闭view"
)
callUnity
(
"TitleView"
,
"getHomeInfo"
,
""
)
callUnity
(
"TitleView"
,
"getHomeInfo"
,
""
)
}
}
...
...
app/src/main/java/com/ym/game/activity/SplashActivity.kt
View file @
3008cb15
...
@@ -10,24 +10,19 @@ import com.bytedance.sdk.openadsdk.TTSplashAd
...
@@ -10,24 +10,19 @@ import com.bytedance.sdk.openadsdk.TTSplashAd
import
com.gyf.immersionbar.BarHide
import
com.gyf.immersionbar.BarHide
import
com.gyf.immersionbar.ImmersionBar
import
com.gyf.immersionbar.ImmersionBar
import
com.umeng.analytics.MobclickAgent
import
com.umeng.analytics.MobclickAgent
import
com.ym.library.utils.ADConfig
import
com.ym.game.GameActivity
import
com.ym.game.GameActivity
import
com.ym.xync.R
import
com.ym.xync.R
import
com.ym.library.Constant
import
com.ym.library.Constant
import
com.ym.library.module.ReportEntity
import
com.ym.library.module.ReportEntity
import
com.ym.library.net.BaseActivity
import
com.ym.library.net.PermissionsActivity
import
com.ym.library.net.SplashContract
import
com.ym.library.net.SplashPresenter
import
com.ym.library.net.SplashPresenter.Companion.PERMISSIONS
import
com.ym.library.net.SplashPresenter.Companion.PERMISSIONS
import
com.ym.library.utils.EventUtils
import
com.ym.library.utils.ReportUtils
import
com.ym.library.utils.SettingPreference
import
com.ym.library.utils.Utils
import
com.ym.game.utils.CenterDialog
import
com.ym.game.utils.CenterDialog
import
com.ym.library.config.AdManager
import
com.ym.library.config.AdManager
import
com.ym.library.listener.ZXADSplashListener
import
com.ym.library.listener.ZXADSplashListener
import
com.ym.library.module.NewsEntity
import
com.ym.library.module.NewsEntity
import
com.ym.library.net.*
import
com.ym.library.utils.*
import
com.ym.library.wechat.UserApiClient
import
org.jetbrains.anko.act
class
SplashActivity
:
BaseActivity
(),
SplashContract
.
View
{
class
SplashActivity
:
BaseActivity
(),
SplashContract
.
View
{
...
@@ -135,8 +130,33 @@ class SplashActivity : BaseActivity(), SplashContract.View {
...
@@ -135,8 +130,33 @@ class SplashActivity : BaseActivity(), SplashContract.View {
if
(
System
.
currentTimeMillis
()
-
startTime
>
2000
&&
isClick
)
{
if
(
System
.
currentTimeMillis
()
-
startTime
>
2000
&&
isClick
)
{
isClick
=
false
isClick
=
false
startTime
=
System
.
currentTimeMillis
()
startTime
=
System
.
currentTimeMillis
()
// startActivity(Intent(this@SplashActivity, GameActivity::class.java))
val
token
=
SettingPreference
.
getToken
()
UserApiClient
.
userApi
.
getIsBindWithdrawWx
(
token
)
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
UserInfoEntity
>()
{
override
fun
onSuccess
(
data
:
UserInfoEntity
)
{
act
?.
runOnUiThread
{
if
(
data
?.
isBind
==
true
)
{
EventUtils
.
onEvent
(
"login_net"
,
"微信已绑定"
)
startActivity
(
Intent
(
this
@SplashActivity
,
GameActivity
::
class
.
java
))
startActivity
(
Intent
(
this
@SplashActivity
,
GameActivity
::
class
.
java
))
finish
()
finish
()
}
else
{
EventUtils
.
onEvent
(
"login_net"
,
"微信未绑定,跳转微信登录页面"
)
startActivity
(
Intent
(
this
@SplashActivity
,
WxLoginActivity
::
class
.
java
))
finish
()
}
}
}
override
fun
onFailure
(
e
:
Throwable
,
code
:
String
,
errorMsg
:
String
?)
{
if
(
null
!=
errorMsg
)
{
EventUtils
.
onEvent
(
"login_net"
,
"接口失败,跳转微信登录页面"
)
// mView.wxBindFailure(errorMsg?:"")
startActivity
(
Intent
(
this
@SplashActivity
,
WxLoginActivity
::
class
.
java
))
finish
()
}
}
})
}
}
}
}
...
...
app/src/main/java/com/ym/game/activity/WxLoginActivity.kt
0 → 100644
View file @
3008cb15
package
com.ym.game.activity
import
android.content.Intent
import
android.util.Log
import
android.view.View
import
com.umeng.analytics.MobclickAgent
import
com.ym.game.GameActivity
import
com.ym.library.net.*
import
com.ym.library.utils.EventUtils.onEvent
import
com.ym.library.utils.JumpUtils
import
com.ym.library.utils.SettingPreference
import
com.ym.library.utils.Utils
import
com.ym.library.utils.WxImplUtils
import
com.ym.library.wechat.UserApiClient
import
com.ym.xync.R
import
kotlinx.android.synthetic.main.activity_wx_login.*
import
org.jetbrains.anko.act
/**
* @author (wangXuewei)
* @datetime 2020-10-23 18:19 GMT+8
* @detail :
*/
class
WxLoginActivity
:
BaseActivity
()
{
override
fun
layoutID
():
Int
{
return
R
.
layout
.
activity_wx_login
}
override
fun
init
()
{
id_btn_wx_login
.
setOnClickListener
(
View
.
OnClickListener
{
wxLogin
();
})
id_tv_User_agreement
.
setOnClickListener
(
View
.
OnClickListener
{
JumpUtils
.
h5Jump
(
"用户协议"
,
NetConfig
.
H5
.
WEB_URL_USER
,
true
)
})
id_tv_privacy_policy
.
setOnClickListener
(
View
.
OnClickListener
{
JumpUtils
.
h5Jump
(
"隐私政策"
,
NetConfig
.
H5
.
WEB_URL_PRIVACY
,
true
)
})
}
override
fun
onResume
()
{
super
.
onResume
()
MobclickAgent
.
onResume
(
this
)
}
override
fun
onPause
()
{
super
.
onPause
()
MobclickAgent
.
onPause
(
this
)
}
fun
wxLogin
(){
onEvent
(
"click_login"
,
"点击微信登录"
)
val
token
=
SettingPreference
.
getToken
()
UserApiClient
.
userApi
.
getIsBindWithdrawWx
(
token
)
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
UserInfoEntity
>()
{
override
fun
onSuccess
(
data
:
UserInfoEntity
)
{
act
?.
runOnUiThread
{
if
(
data
?.
isBind
==
true
)
{
onEvent
(
"login_net"
,
"已绑定微信"
)
startActivity
(
Intent
(
this
@WxLoginActivity
,
GameActivity
::
class
.
java
))
finish
()
}
else
{
onEvent
(
"login_net"
,
"未绑定微信,吊起微信授权"
)
WxImplUtils
().
onAuth
(
act
)
{
token
,
openid
->
Log
.
i
(
"WxImplUtils"
,
"onWxSuccess"
)
Utils
.
showToast
(
act
,
"登录成功"
)
onEvent
(
"login_wx"
,
"登录授权成功"
)
startActivity
(
Intent
(
this
@WxLoginActivity
,
GameActivity
::
class
.
java
)
)
finish
()
}
}
}
}
override
fun
onFailure
(
e
:
Throwable
,
code
:
String
,
errorMsg
:
String
?)
{
if
(
null
!=
errorMsg
)
{
onEvent
(
"login_net"
,
"登录接口失败"
)
// mView.wxBindFailure(errorMsg?:"")
}
}
})
}
}
\ No newline at end of file
app/src/main/java/com/ym/game/application/BaseApplication.kt
View file @
3008cb15
...
@@ -31,7 +31,7 @@ class BaseApplication : MultiDexApplication() {
...
@@ -31,7 +31,7 @@ class BaseApplication : MultiDexApplication() {
//第一步初始化 application
//第一步初始化 application
AppliContext
.
init
(
this
)
AppliContext
.
init
(
this
)
Config
.
init
(
this
)
Config
.
init
(
this
)
NetConfig
.
setBase_Url
(
NetConfig
.
Environment
.
DEV
)
// TODO 上线之后提成成 NetConfig.Environment.PRODUCT
NetConfig
.
setBase_Url
(
NetConfig
.
Environment
.
PRODUCT
)
// TODO 上线之后提成成 NetConfig.Environment.PRODUCT
Constant
.
appLs
=
"a03d5320d905cf3b"
//appls
Constant
.
appLs
=
"a03d5320d905cf3b"
//appls
AdManager
.
init
(
//TODO 替换id
AdManager
.
init
(
//TODO 替换id
...
...
app/src/main/res/layout/activity_wx_login.xml
0 → 100644
View file @
3008cb15
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@mipmap/wx_logo_bg"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/id_btn_wx_login"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
android:src=
"@mipmap/wx_logo_btn"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_marginBottom=
"@dimen/dp_20"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"登陆即同意"
android:textColor=
"#7F490A"
android:textSize=
"@dimen/dp_13"
/>
<TextView
android:id=
"@+id/id_tv_User_agreement"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"《用户协议》"
android:textColor=
"#C56713"
android:textSize=
"@dimen/dp_13"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"和"
android:textColor=
"#7F490A"
android:textSize=
"@dimen/dp_13"
/>
<TextView
android:id=
"@+id/id_tv_privacy_policy"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"《隐私政策》"
android:textColor=
"#C56713"
android:textSize=
"@dimen/dp_13"
/>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/mipmap-xhdpi/wx_logo_bg.png
0 → 100644
View file @
3008cb15
125 KB
app/src/main/res/mipmap-xhdpi/wx_logo_btn.png
0 → 100644
View file @
3008cb15
6.82 KB
app/version.properties
View file @
3008cb15
PACKAGE_NAME
=
com.ym.xync
PACKAGE_NAME
=
com.ym.xync
VERSION_CODE
=
1
VERSION_CODE
=
2
VERSION_NAME
=
1.0.0
VERSION_NAME
=
1.0.1
\ No newline at end of file
\ No newline at end of file
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