Commit fe8ecea6 by 徐健

backup

parent 437bc484
......@@ -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",
......
......@@ -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
......
......@@ -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)
}
......
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment