Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
X
xxsq
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
王雪伟
xxsq
Commits
ddb653e1
Commit
ddb653e1
authored
May 21, 2022
by
王雪伟
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
d7dde877
093226cf
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
1410 additions
and
3 deletions
+1410
-3
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+1
-1
file_paths.xml
app/src/main/res/xml/file_paths.xml
+2
-2
logo.png
cms/src/main/res/drawable-xhdpi/logo.png
+0
-0
splash_bg.png
cms/src/main/res/drawable-xhdpi/splash_bg.png
+0
-0
AndroidManifest.xml
moduleMain/src/main/AndroidManifest.xml
+36
-0
LoginActivity.kt
...c/main/java/com/zxbw/modulemain/activity/LoginActivity.kt
+311
-0
SplashActivity.kt
.../main/java/com/zxbw/modulemain/activity/SplashActivity.kt
+149
-0
LoginContract.kt
...c/main/java/com/zxbw/modulemain/contract/LoginContract.kt
+29
-0
SplashContract.kt
.../main/java/com/zxbw/modulemain/contract/SplashContract.kt
+25
-0
LoginPresenter.kt
...main/java/com/zxbw/modulemain/presenter/LoginPresenter.kt
+143
-0
SplashPresenter.kt
...ain/java/com/zxbw/modulemain/presenter/SplashPresenter.kt
+233
-0
icon_close_login.png
moduleMain/src/main/res/drawable-xhdpi/icon_close_login.png
+0
-0
login_top_bg.png
moduleMain/src/main/res/drawable-xhdpi/login_top_bg.png
+0
-0
shape_333333_r20.xml
moduleMain/src/main/res/drawable/shape_333333_r20.xml
+8
-0
shape_b287a17_r15_stoke.xml
moduleMain/src/main/res/drawable/shape_b287a17_r15_stoke.xml
+10
-0
shape_ffffff_r10.xml
moduleMain/src/main/res/drawable/shape_ffffff_r10.xml
+11
-0
activity_login.xml
moduleMain/src/main/res/layout/activity_login.xml
+414
-0
activity_splash.xml
moduleMain/src/main/res/layout/activity_splash.xml
+38
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
ddb653e1
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
<activity
android:name=
".activity.MainActivity"
>
<activity
android:name=
".activity.MainActivity"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</intent-filter>
...
...
app/src/main/res/xml/file_paths.xml
View file @
ddb653e1
...
@@ -2,11 +2,11 @@
...
@@ -2,11 +2,11 @@
<paths
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<paths
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<external-path
<external-path
name=
"cache"
name=
"cache"
path=
"Android/data/com.zxbw.x
ymh
/"
/>
path=
"Android/data/com.zxbw.x
xsq
/"
/>
<external-path
<external-path
name=
"downloadfile"
name=
"downloadfile"
path=
"com.zxbw.x
ymh
/"
/>
path=
"com.zxbw.x
xsq
/"
/>
<!--项目中用到的-->
<!--项目中用到的-->
<external-path
<external-path
name=
"beta_external_files_path"
name=
"beta_external_files_path"
...
...
cms/src/main/res/drawable-xhdpi/logo.png
View replaced file @
d7dde877
View file @
ddb653e1
27 KB
|
W:
|
H:
8.48 KB
|
W:
|
H:
2-up
Swipe
Onion skin
cms/src/main/res/drawable-xhdpi/splash_bg.png
View replaced file @
d7dde877
View file @
ddb653e1
151 KB
|
W:
|
H:
553 KB
|
W:
|
H:
2-up
Swipe
Onion skin
moduleMain/src/main/AndroidManifest.xml
View file @
ddb653e1
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.zxbw.modulemain"
>
package=
"com.zxbw.modulemain"
>
<application>
<activity
android:name=
".activity.SplashActivity"
android:screenOrientation=
"portrait"
android:theme=
"@style/Theme"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
<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=
"splash"
android:scheme=
"xxsq"
/>
</intent-filter>
</activity>
<activity
android:name=
".activity.LoginActivity"
>
<intent-filter>
<action
android:name=
"android.intent.action.VIEW"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
<data
android:host=
"login"
android:scheme=
"xxsq"
/>
</intent-filter>
</activity>
</application>
</manifest>
</manifest>
\ No newline at end of file
moduleMain/src/main/java/com/zxbw/modulemain/activity/LoginActivity.kt
0 → 100644
View file @
ddb653e1
This diff is collapsed.
Click to expand it.
moduleMain/src/main/java/com/zxbw/modulemain/activity/SplashActivity.kt
0 → 100644
View file @
ddb653e1
package
com.zxbw.modulemain.activity
import
android.content.Intent
import
android.text.TextUtils
import
android.util.Log
import
android.view.View
import
androidx.core.app.ActivityCompat
import
com.umeng.analytics.MobclickAgent
import
com.zxbw.modulemain.R
import
com.zxbw.modulemain.contract.SplashContract
import
com.zxbw.modulemain.presenter.SplashPresenter
import
com.zxhl.cms.common.Config
import
com.zxhl.cms.common.Constant
import
com.zxhl.cms.common.base.BaseActivity
import
com.zxhl.cms.net.ApiClient
import
com.zxhl.cms.net.RxSchedulers
import
com.zxhl.cms.net.SettingPreference
import
com.zxhl.cms.net.callback.BaseObserver
import
com.zxhl.cms.router.RounterApi
import
com.zxhl.cms.router.RounterBus
import
com.zxhl.cms.utils.EventUtils
import
com.zxhl.cms.utils.JumpUtils
import
com.zxhl.cms.utils.Utils
import
com.zxhl.cms.widget.CenterDialog
/**
* Created by gaoleichao on 2018/12/26
*/
class
SplashActivity
:
BaseActivity
(),
SplashContract
.
View
{
override
fun
onClick
(
v
:
View
?)
{
}
override
fun
layoutID
():
Int
=
R
.
layout
.
activity_splash
private
var
mPresenter
:
SplashContract
.
Presenter
?
=
null
override
fun
init
()
{
if
(!
isTaskRoot
)
{
finish
()
return
}
EventUtils
.
onEvent
(
"app_start"
)
if
(
SettingPreference
.
getFirstApp
())
{
CenterDialog
.
showPrivacyProtocol
(
this
,
object
:
View
.
OnClickListener
{
override
fun
onClick
(
p0
:
View
?)
{
SettingPreference
.
setFirstApp
()
mPresenter
=
SplashPresenter
(
this
@SplashActivity
,
this
@SplashActivity
)
initListener
()
}
})
}
else
{
mPresenter
=
SplashPresenter
(
this
@SplashActivity
,
this
@SplashActivity
)
initListener
()
}
}
private
fun
initListener
()
{
jumpMainPage
()
// id_activity_splash_skip?.setOnClickListener {
// jumpMainPage()
// }
}
override
fun
jumpMainPage
()
{
val
user
=
SettingPreference
.
getUserInfoData
()
val
token
=
SettingPreference
.
getUserToken
()
if
(
user
==
null
&&
TextUtils
.
isEmpty
(
token
))
{
// if (TextUtils.equals(Utils.getChannel(this), "baichuan")) {
// JumpUtils.loginJump()
// } else {
// mPresenter?.checkLogin()
// }
JumpUtils
.
loginJump
()
}
else
{
// openApp()
JumpUtils
.
activityJump
(
RounterBus
.
getRounter
(
RounterApi
::
class
.
java
).
getIntentActivityMain
()
)
}
finish
()
}
// override fun jumpPermissionsPage() {
// val intent = Intent(this, PermissionsActivity::class.java)
// intent.putExtra(PermissionsActivity.EXTRA_PERMISSIONS, SplashPresenter.PERMISSIONS)
// ActivityCompat.startActivityForResult(
// this,
// intent,
// Constant.REQUEST_CODE_ASK_PERMISSIONS,
// null
// )
// }
//
// override fun getDestroyed(): Boolean {
// return isDestroyed
// }
// override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
// super.onActivityResult(requestCode, resultCode, data)
// if (requestCode == Constant.REQUEST_CODE_ASK_PERMISSIONS && resultCode == PermissionsActivity.PERMISSIONS_DENIED) {
//// finish()
// mPresenter?.checkLogin()
// } else {
// Config.init(this)
// mPresenter?.checkLogin()
// }
// }
private
var
isPause
=
false
// override fun setToutiaoView(view: View) {
// isPause = true
// id_activity_splash_ad_layout?.removeAllViews()
// id_activity_splash_ad_layout?.addView(view)
// }
override
fun
onResume
()
{
super
.
onResume
()
MobclickAgent
.
onResume
(
this
)
}
override
fun
onPause
()
{
super
.
onPause
()
MobclickAgent
.
onPause
(
this
)
}
fun
openApp
()
{
ApiClient
.
homeApi
.
openApp
()
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
Any
>()
{
override
fun
onSuccess
(
result
:
Any
?)
{
Log
.
e
(
"MXL"
,
"进入app上报"
)
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
}
})
}
}
\ No newline at end of file
moduleMain/src/main/java/com/zxbw/modulemain/contract/LoginContract.kt
0 → 100644
View file @
ddb653e1
package
com.zxbw.modulemain.contract
/**
* Created by gaoleichao on 2018/6/20.
*/
class
LoginContract
{
interface
View
{
fun
loginFaild
(
msg
:
String
)
fun
smsCodeFaild
(
msg
:
String
)
fun
loginSuc
()
fun
smsCodeSuccess
()
}
interface
Presenter
{
fun
requestCode
(
phone
:
String
)
fun
codeLogin
(
phone
:
String
,
code
:
String
)
fun
getUserInfo
()
fun
phoneLogin
(
phone
:
String
)
}
}
\ No newline at end of file
moduleMain/src/main/java/com/zxbw/modulemain/contract/SplashContract.kt
0 → 100644
View file @
ddb653e1
package
com.zxbw.modulemain.contract
import
android.view.View
/**
* Created by gaoleichao on 2019/3/16
*/
class
SplashContract
{
interface
View
{
//fun getDestroyed():Boolean
// fun jumpPermissionsPage()
fun
jumpMainPage
()
// fun setToutiaoView(view: android.view.View)
}
interface
Presenter
{
fun
checkLogin
()
}
}
\ No newline at end of file
moduleMain/src/main/java/com/zxbw/modulemain/presenter/LoginPresenter.kt
0 → 100644
View file @
ddb653e1
package
com.zxbw.modulemain.presenter
import
android.content.Context
import
android.text.TextUtils
import
android.util.Log
import
com.zxbw.modulemain.contract.LoginContract
import
com.zxhl.cms.net.ApiClient
import
com.zxhl.cms.net.RxSchedulers
import
com.zxhl.cms.net.SettingPreference
import
com.zxhl.cms.net.callback.BaseObserver
import
com.zxhl.cms.net.model.uc.UserInfo
import
com.zxhl.cms.utils.EventUtils
import
com.zxhl.cms.utils.UserDataUtils
/**
* Created by gaoleichao on 2018/6/20.
*/
class
LoginPresenter
:
LoginContract
.
Presenter
{
private
val
mView
:
LoginContract
.
View
constructor
(
mView
:
LoginContract
.
View
)
{
this
.
mView
=
mView
}
override
fun
requestCode
(
phone
:
String
)
{
ApiClient
.
homeApi
.
requestCode
(
phone
).
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
Any
>()
{
override
fun
onSuccess
(
result
:
Any
?)
{
mView
.
smsCodeSuccess
()
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
var
str
:
String
if
(
TextUtils
.
equals
(
"105"
,
code
))
{
str
=
errorMsg
?:
""
}
else
{
str
=
"发送失败"
}
mView
.
smsCodeFaild
(
str
)
}
})
}
override
fun
codeLogin
(
phone
:
String
,
code
:
String
)
{
ApiClient
.
homeApi
.
requestCodeLogin
(
phone
,
code
).
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
UserInfo
>()
{
override
fun
onSuccess
(
result
:
UserInfo
)
{
if
(
result
!=
null
){
val
token
=
result
.
token
if
(
TextUtils
.
isEmpty
(
token
))
{
EventUtils
.
onEvent
(
"login_fail"
,
"codeLogin:"
+
"token为空"
)
mView
.
loginFaild
(
"登录失败"
)
}
else
{
EventUtils
.
onEvent
(
"login_suc"
,
"codeLogin"
)
// Constant.newAwardFlag = result.newAwardFlag
SettingPreference
.
saveToken
(
token
)
UserDataUtils
.
updateUserInfo
(
null
)
mView
.
loginSuc
()
// getUserInfo()
}
}
else
{
Log
.
e
(
"MXL"
,
"失败"
)
}
}
override
fun
onFailure
(
e
:
Throwable
,
code
:
String
,
errorMsg
:
String
)
{
EventUtils
.
onEvent
(
"login_fail"
,
"codeLogin:"
+
errorMsg
)
val
str
:
String
if
(
TextUtils
.
equals
(
"105"
,
code
))
{
str
=
errorMsg
}
else
{
str
=
"登录失败"
}
mView
.
loginFaild
(
str
)
}
})
}
override
fun
getUserInfo
()
{
ApiClient
.
userInfoAPi
.
getUserInfo
().
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
UserInfo
>()
{
override
fun
onSuccess
(
result
:
UserInfo
)
{
val
uid
=
result
.
uid
if
(
TextUtils
.
isEmpty
(
uid
))
{
EventUtils
.
onEvent
(
"login_fail"
,
"getUserInfo:"
+
"uid为空"
)
mView
.
loginFaild
(
"登录失败"
)
}
else
{
SettingPreference
.
saveUserInfo
(
result
)
// SettingPreference.setTrackId(result.gaodeTrackId?:0L)
// SettingPreference.setTerminalId(result.gaodeTerminalId?:0L)
mView
.
loginSuc
()
EventUtils
.
onEvent
(
"login_suc"
,
"getUserInfo"
)
}
}
override
fun
onFailure
(
e
:
Throwable
,
code
:
String
,
errorMsg
:
String
)
{
EventUtils
.
onEvent
(
"login_fail"
,
"getUserInfo:"
+
errorMsg
)
val
str
:
String
if
(
TextUtils
.
equals
(
"105"
,
code
))
{
str
=
errorMsg
}
else
{
str
=
"登录失败"
}
mView
.
loginFaild
(
str
)
}
})
}
override
fun
phoneLogin
(
phone
:
String
)
{
// ApiClient.userApi.requestPhoneLogin(Constant.SHANYAN_KEY,phone).compose(RxSchedulers.observableIO2Main())
// .subscribe(object : BaseObserver<UserInfoEntity>() {
// override fun onSuccess(result: UserInfoEntity) {
// val token = result.token
// Constant.successMsg = result?.successMsg
// if (TextUtils.isEmpty(token)) {
// EventUtils.onEvent("login_fail", "codeLogin:" + "token为空")
// mView.loginFaild("登录失败")
// } else {
// EventUtils.onEvent("login_suc", "codeLogin")
// Constant.newAwardFlag = result.newAwardFlag
// SettingPreference.setToken(token)
// getUserInfo()
// }
// }
//
// override fun onFailure(e: Throwable, code: String, errorMsg: String) {
// EventUtils.onEvent("login_fail", "codeLogin:" + errorMsg)
// val str: String
// if (TextUtils.equals("105", code)) {
// str = errorMsg
// } else {
// str = "登录失败"
// }
// mView.loginFaild(str)
// }
// })
}
}
\ No newline at end of file
moduleMain/src/main/java/com/zxbw/modulemain/presenter/SplashPresenter.kt
0 → 100644
View file @
ddb653e1
package
com.zxbw.modulemain.presenter
import
android.app.Activity
import
android.os.Build
import
android.text.TextUtils
import
android.view.View
import
com.bytedance.sdk.openadsdk.AdSlot
import
com.bytedance.sdk.openadsdk.TTAdNative
import
com.bytedance.sdk.openadsdk.TTAdSdk
import
com.bytedance.sdk.openadsdk.TTSplashAd
import
com.zxbw.modulemain.contract.SplashContract
import
com.zxhl.cms.AppContext
import
com.zxhl.cms.ad.upload.Utils.AdUpload
import
com.zxhl.cms.ad.upload.model.NewsEntity
import
com.zxhl.cms.common.Constant
import
com.zxhl.cms.net.ApiClient
import
com.zxhl.cms.net.RxSchedulers
import
com.zxhl.cms.net.SettingPreference
import
com.zxhl.cms.net.callback.BaseObserver
import
com.zxhl.cms.net.model.box.AppInEntity
import
com.zxhl.cms.net.model.other.IsWeChatLoginEntity
import
com.zxhl.cms.net.model.uc.UserInfo
import
com.zxhl.cms.utils.*
import
io.reactivex.Observable
import
io.reactivex.ObservableOnSubscribe
import
io.reactivex.Observer
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.disposables.Disposable
import
io.reactivex.schedulers.Schedulers
/**
* Created by gaoleichao on 2019/3/16
*/
class
SplashPresenter
:
SplashContract
.
Presenter
{
private
val
mView
:
SplashContract
.
View
private
val
mActivity
:
Activity
constructor
(
mView
:
SplashContract
.
View
,
mActivity
:
Activity
)
{
this
.
mView
=
mView
this
.
mActivity
=
mActivity
checkPermissions
()
}
companion
object
{
val
PERMISSIONS
=
arrayOf
(
// Constant.Permission.PERMISSION_READ_STORAGE,
Constant
.
Permission
.
PERMISSION_PHONE
// Constant.Permission.PERMISSION_COARSE_LOCATION,
// Constant.Permission.PERMISSION_FINE_LOCATION
// , Constant.Permission.PERMISSION_CAMERA
)
}
private
var
mDisposablePermissions
:
Disposable
?
=
null
fun
checkPermissions
()
{
// Observable.create(ObservableOnSubscribe<Boolean> { e ->
// val flag = Utils.needPermissions(*PERMISSIONS)
// e?.onNext(flag)
// e?.onComplete()
// }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
// .subscribe(object : Observer<Boolean> {
// override fun onSubscribe(d: Disposable) {
// mDisposablePermissions = d
// }
//
// override fun onNext(aBoolean: Boolean) {
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && mView.getDestroyed()) {
// return
// }
// // 缺少权限时, 进入权限配置页面
// if (aBoolean) {
// mView.jumpPermissionsPage()
// } else {
// checkLogin()
// }
// }
//
// override fun onError(e: Throwable) {
//
// }
//
// override fun onComplete() {
// if (mDisposablePermissions != null && mDisposablePermissions?.isDisposed == false) {
// mDisposablePermissions?.dispose()
// }
// }
// })
}
override
fun
checkLogin
()
{
val
user
=
SettingPreference
.
getUserInfoData
()
val
token
=
SettingPreference
.
getUserToken
()
if
(
user
==
null
&&
TextUtils
.
isEmpty
(
token
))
{
if
(
TextUtils
.
equals
(
Utils
.
getChannel
(
AppContext
.
get
()),
"baichuan"
))
{
// deviceLogin()
getAds
()
}
else
{
deviceLogin
()
}
}
else
{
UserDataUtils
.
updateUserInfo
(
null
)
getAds
()
}
}
private
fun
deviceLogin
()
{
ApiClient
.
userInfoAPi
.
deviceLogin
().
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
UserInfo
>()
{
override
fun
onSuccess
(
result
:
UserInfo
)
{
val
token
=
result
.
token
SettingPreference
.
saveToken
(
token
)
UserDataUtils
.
updateUserInfo
(
null
)
// mView?.jumpMainPage()
getAds
()
}
override
fun
onFailure
(
e
:
Throwable
,
code
:
String
,
errorMsg
:
String
)
{
SettingPreference
.
saveToken
(
""
)
SettingPreference
.
saveUserInfo
(
null
)
getAds
()
}
})
}
private
fun
getAds
()
{
checkLoginIsBind
()
ApiClient
.
adApi
.
getAds
(
"splash"
)
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
List
<
NewsEntity
>>()
{
override
fun
onSuccess
(
result
:
List
<
NewsEntity
>)
{
if
(
result
!=
null
&&
result
?.
size
>
0
)
{
val
data
=
result
[
0
]
if
(
TextUtils
.
equals
(
data
.
adPlatform
,
"chuanshanjia"
))
{
loadToutiao
(
data
,
0
,
"splash"
)
}
}
else
{
mView
.
jumpMainPage
()
}
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
mView
.
jumpMainPage
()
}
})
}
private
var
mTTAdNative
:
TTAdNative
?
=
null
private
fun
loadToutiao
(
data
:
NewsEntity
,
count
:
Int
,
slotNameL
:
String
)
{
mTTAdNative
=
TTAdSdk
.
getAdManager
().
createAdNative
(
mActivity
)
//baseContext建议为activity
val
adSlot
=
AdSlot
.
Builder
()
.
setCodeId
(
data
?.
codeId
)
.
setSupportDeepLink
(
true
)
.
setImageAcceptedSize
(
PhoneUtils
.
getScreenWidth
(
AppContext
.
get
()),
PhoneUtils
.
getScreenHeight
(
AppContext
.
get
())
)
.
build
()
mTTAdNative
?.
loadSplashAd
(
adSlot
,
object
:
TTAdNative
.
SplashAdListener
{
override
fun
onError
(
i
:
Int
,
s
:
String
)
{
mView
.
jumpMainPage
()
}
override
fun
onTimeout
()
{
mView
.
jumpMainPage
()
}
override
fun
onSplashAdLoad
(
ad
:
TTSplashAd
)
{
val
view
=
ad
.
splashView
// mView?.setToutiaoView(view)
ad
.
setSplashInteractionListener
(
object
:
TTSplashAd
.
AdInteractionListener
{
override
fun
onAdClicked
(
view
:
View
,
i
:
Int
)
{
EventUtils
.
onEvent
(
"splash_click"
)
AdUpload
.
onAdClick
(
data
)
}
override
fun
onAdShow
(
view
:
View
,
i
:
Int
)
{
EventUtils
.
onEvent
(
"splash_show"
)
AdUpload
.
onAdImpression
(
data
)
}
override
fun
onAdSkip
()
{
mView
.
jumpMainPage
()
}
override
fun
onAdTimeOver
()
{
mView
.
jumpMainPage
()
}
})
}
},
5000
)
}
private
fun
checkLoginIsBind
()
{
ApiClient
.
homeApi
.
isWxLogin
().
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
IsWeChatLoginEntity
>()
{
override
fun
onSuccess
(
result
:
IsWeChatLoginEntity
?)
{
Constant
.
Switch
.
isBindLogin
=
result
?.
status
.
equals
(
"1"
)
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
}
})
getAppInfo
()
}
private
fun
getAppInfo
()
{
ApiClient
.
homeApi
.
getAppInfo
()
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
AppInEntity
>()
{
override
fun
onSuccess
(
result
:
AppInEntity
?)
{
Constant
.
Switch
.
isOpenLogin
=
result
?.
login
.
equals
(
"1"
)
Constant
.
Switch
.
isOpenPayTips
=
result
?.
risk_open
.
equals
(
"1"
)
SettingPreference
.
saveConfig
(
result
)
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
}
})
}
}
\ No newline at end of file
moduleMain/src/main/res/drawable-xhdpi/icon_close_login.png
0 → 100644
View file @
ddb653e1
1.93 KB
moduleMain/src/main/res/drawable-xhdpi/login_top_bg.png
0 → 100644
View file @
ddb653e1
16.9 KB
moduleMain/src/main/res/drawable/shape_333333_r20.xml
0 → 100644
View file @
ddb653e1
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#ff333333"
/>
<corners
android:radius=
"25dp"
/>
</shape>
\ No newline at end of file
moduleMain/src/main/res/drawable/shape_b287a17_r15_stoke.xml
0 → 100644
View file @
ddb653e1
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<stroke
android:width=
"1dp"
android:color=
"#ffb28a17"
/>
<corners
android:radius=
"15dp"
/>
</shape>
\ No newline at end of file
moduleMain/src/main/res/drawable/shape_ffffff_r10.xml
0 → 100644
View file @
ddb653e1
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#ffffffff"
/>
<corners
android:bottomLeftRadius=
"0dp"
android:bottomRightRadius=
"0dp"
android:topLeftRadius=
"20dp"
android:topRightRadius=
"20dp"
/>
</shape>
\ No newline at end of file
moduleMain/src/main/res/layout/activity_login.xml
0 → 100644
View file @
ddb653e1
This diff is collapsed.
Click to expand it.
moduleMain/src/main/res/layout/activity_splash.xml
0 → 100644
View file @
ddb653e1
<?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=
"@drawable/splash_bg"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"150dp"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/logo"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"小象省钱黑钻卡"
android:textColor=
"#D9C5A7"
android:layout_marginTop=
"15dp"
android:textSize=
"23sp"
android:textStyle=
"bold"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"2dp"
android:text=
"一 张 巨 省 钱 的 黑 钻 卡"
android:textSize=
"10sp"
android:textColor=
"#D7CDC1"
/>
</LinearLayout>
</RelativeLayout>
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