Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
fe8ecea6
Commit
fe8ecea6
authored
Jan 14, 2020
by
徐健
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backup
parent
437bc484
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
47 deletions
+18
-47
config.gradle
config.gradle
+1
-1
UserServiceImp.kt
m-user/src/main/java/com/yidianling/user/modular_service/UserServiceImp.kt
+2
-1
RegisterAndLoginActivity.kt
m-user/src/main/java/com/yidianling/user/ui/login/RegisterAndLoginActivity.kt
+0
-37
SecretActivity.kt
m-user/src/main/java/com/yidianling/user/ui/login/SecretActivity.kt
+15
-8
No files found.
config.gradle
View file @
fe8ecea6
...
...
@@ -45,7 +45,7 @@ ext {
"m-confide"
:
"0.0.47"
,
"m-consultant"
:
"0.0.56"
,
"m-fm"
:
"0.0.28"
,
"m-user"
:
"0.0.
47
"
,
"m-user"
:
"0.0.
51
"
,
"m-home"
:
"0.0.18"
,
"m-im"
:
"0.0.11"
,
"m-dynamic"
:
"0.0.5.1"
,
...
...
m-user/src/main/java/com/yidianling/user/modular_service/UserServiceImp.kt
View file @
fe8ecea6
...
...
@@ -123,7 +123,8 @@ public class UserServiceImp : IUserService {
val
lastVersionCode
:
Int
=
UserHelper
.
getUsetSetting
()
?.
lastVersionCode
?:
0
val
currentVersionCode
:
Int
=
RxAppTool
.
getAppVersionCode
(
BaseApp
.
getApp
())
if
(
lastVersionCode
<
currentVersionCode
)
{
UserHelper
.
getUsetSetting
()
?.
lastVersionCode
=
currentVersionCode
// 这行代码放在隐私弹框同意按钮agreeAction中,必须确保注册前置页面是用户看到的第一个功能页面
// UserHelper.getUsetSetting()?.lastVersionCode = currentVersionCode
return
true
}
return
false
...
...
m-user/src/main/java/com/yidianling/user/ui/login/RegisterAndLoginActivity.kt
View file @
fe8ecea6
...
...
@@ -85,8 +85,6 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
private
var
handler
:
Handler
?
=
null
private
var
isFromGuide
=
false
//是否来自启动页
private
var
isActivityStop
:
Boolean
=
false
companion
object
{
private
var
BIND_PHONE
=
"bind_phone"
//用于判断时候是绑定手机号
private
var
IS_FROM_GUIDE
=
"isFromGuide"
//是否来自启动页
...
...
@@ -133,43 +131,8 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
initAuthHelper
()
initView
()
setClickEvent
()
judgeSecretPage
()
}
override
fun
onResume
()
{
super
.
onResume
()
isActivityStop
=
false
}
override
fun
onStop
()
{
super
.
onStop
()
isActivityStop
=
true
}
/**
* 判定是否展示隐私弹窗页面
*/
@SuppressLint
(
"CheckResult"
)
private
fun
judgeSecretPage
()
{
var
hasAgreeSecret
:
String
=
SharedPreferencesEditor
.
getString
(
"hasAgreeSecret"
)
if
(
isFromGuide
&&
hasAgreeSecret
==
""
)
{
UserHttpImpl
.
getInstance
().
getSecretData
()
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
({
if
(
it
.
code
==
0
&&
!
isActivityStop
)
{
if
(
it
.
data
.
is_open
==
1
)
{
SecretActivity
.
startProtocol
(
this
,
it
.
data
.
content
)
}
}
},
{
ToastUtil
.
toastShort
(
R
.
string
.
platform_network_error
)
})
}
}
private
fun
setWindowStatusBarColor
()
{
StatusBarUtils
.
Companion
.
setWindowStatusBarColor
(
this
,
R
.
color
.
platform_color_075b66
)
}
...
...
m-user/src/main/java/com/yidianling/user/ui/login/SecretActivity.kt
View file @
fe8ecea6
package
com.yidianling.user.ui.login
import
android.annotation.SuppressLint
import
android.app.Activity
import
android.content.Context
import
android.content.Intent
import
android.os.Build
import
android.os.Handler
import
android.support.v4.app.ActivityCompat.startActivityForResult
import
android.text.Html
import
android.view.KeyEvent
import
com.ydl.ydlcommon.base.BaseActivity
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.utils.ActivityManager
import
com.ydl.ydlcommon.utils.SharedPreferencesEditor
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.yidianling.common.tools.RxAppTool
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.user.R
import
com.yidianling.user.UserHelper
import
com.yidianling.user.http.UserHttpImpl
import
com.yidianling.user.widget.SecretDialog
import
io.reactivex.android.schedulers.AndroidSchedulers
...
...
@@ -33,11 +38,14 @@ class SecretActivity : BaseActivity() {
companion
object
{
val
SECRET_PROTOCOL
:
String
=
"secret_protocol"
val
SECRET_PAGE_REQUEST_CODE
:
Int
=
40000002
val
SECRET_PAGE_REQUEST_OK_CODE
:
Int
=
40000003
val
SECRET_PAGE_REQUEST_FAILURE_CODE
:
Int
=
40000004
fun
startProtocol
(
context
:
Context
,
secretProtocolString
:
String
)
{
fun
startProtocol
(
context
:
Activity
,
secretProtocolString
:
String
)
{
val
intent
=
Intent
(
context
,
SecretActivity
::
class
.
java
)
intent
.
putExtra
(
SECRET_PROTOCOL
,
secretProtocolString
)
context
.
startActivity
(
intent
)
startActivityForResult
(
context
,
intent
,
SECRET_PAGE_REQUEST_CODE
,
null
)
}
}
...
...
@@ -66,11 +74,7 @@ class SecretActivity : BaseActivity() {
if
(
null
==
secretDialog
)
{
secretDialog
=
SecretDialog
(
this
,
object
:
SecretDialog
.
OnSecretDialogListener
{
override
fun
onCancel
()
{
Handler
().
postDelayed
({
ActivityManager
.
finishAll
()
android
.
os
.
Process
.
killProcess
(
android
.
os
.
Process
.
myPid
())
exitProcess
(
0
)
},
1000
)
setResult
(
SECRET_PAGE_REQUEST_FAILURE_CODE
)
}
override
fun
onSure
()
{
...
...
@@ -111,7 +115,9 @@ class SecretActivity : BaseActivity() {
}
private
fun
agreeAction
()
{
//这行代码是从isFirstStart中取出的,为了确保注册前置功能
UserHelper
.
getUsetSetting
()
?.
lastVersionCode
=
RxAppTool
.
getAppVersionCode
(
BaseApp
.
getApp
())
SharedPreferencesEditor
.
putString
(
"hasAgreeSecret"
,
"true"
)
finish
(
)
setResult
(
SECRET_PAGE_REQUEST_OK_CODE
)
}
}
\ 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