Commit c791b7b6 by 严久程

Merge branch 'dev' into 咨询加声网

# Conflicts:
#	app/src/main/java/com/ydl/component/MainActivity.kt
#	config.gradle
#	m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
parents f81c445c 91b014db
...@@ -181,7 +181,7 @@ dependencies { ...@@ -181,7 +181,7 @@ dependencies {
implementation project(':m-user') implementation project(':m-user')
implementation modularPublication('com.ydl:m-user-api') implementation modularPublication('com.ydl:m-user-api')
api project(':m-tests') api project(':m-tests')
// api project(':m-consultant') api project(':m-consultant')
implementation modularPublication('com.ydl:m-consultant-api') implementation modularPublication('com.ydl:m-consultant-api')
implementation project(':m-confide') implementation project(':m-confide')
......
package com.ydl.component package com.ydl.component
//import com.ydl.confide.home.ConfideHomeActivity //import com.ydl.confide.home.ConfideHomeActivity
//import com.ydl.confide.home.ConfideHomeActivity
//import com.yidianling.consultant.ExpertSearchActivity.Companion.HOT_SEARCH_DOCTOR_NAME
//import com.yidianling.consultant.api.IConsultantService
import android.Manifest import android.Manifest
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.ComponentName import android.content.ComponentName
...@@ -9,6 +12,7 @@ import android.content.Intent ...@@ -9,6 +12,7 @@ import android.content.Intent
import android.content.ServiceConnection import android.content.ServiceConnection
import android.net.Uri import android.net.Uri
import android.os.IBinder import android.os.IBinder
import android.os.Process
import android.provider.Settings import android.provider.Settings
import android.util.Log import android.util.Log
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
...@@ -17,24 +21,26 @@ import com.tbruyelle.rxpermissions2.RxPermissions ...@@ -17,24 +21,26 @@ import com.tbruyelle.rxpermissions2.RxPermissions
import com.umeng.analytics.MobclickAgent import com.umeng.analytics.MobclickAgent
import com.ydl.audioim.YDLavManager import com.ydl.audioim.YDLavManager
import com.ydl.component.music.FragmentContainerActivity import com.ydl.component.music.FragmentContainerActivity
import com.ydl.component.mvp.DemoContract
import com.ydl.component.mvp.DemoPresenter import com.ydl.component.mvp.DemoPresenter
import com.ydl.confide.home.ConfideHomeActivity
//import com.ydl.confide.home.ConfideHomeActivity
import com.ydl.media.audio.PlayService import com.ydl.media.audio.PlayService
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.ydl.ydlcommon.router.IYDLRouterConstant import com.ydl.ydlcommon.utils.ActivityManager.Companion.finishAll
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
//import com.yidianling.consultant.ExpertSearchActivity.Companion.HOT_SEARCH_DOCTOR_NAME
//import com.yidianling.consultant.api.IConsultantService
import com.yidianling.fm.api.service.IFMService import com.yidianling.fm.api.service.IFMService
import com.yidianling.tests.home.NewTestHomeActivity import com.yidianling.user.ui.collect.CollectSexAndBirthActivity
import com.yidianling.user.widget.SecretDescriptionDialog import com.yidianling.user.widget.SecretDescriptionDialog
import com.yidianling.user.widget.SecretDescriptionDialog.OnSecretDescriptionDialogListener
import com.yidianling.user.widget.SecretDialog import com.yidianling.user.widget.SecretDialog
import com.yidianling.user.widget.SecretDialog.OnSecretDialogListener
import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.activity_main.*
import com.ydl.ydlcommon.utils.ResUtil.getResources
import com.alibaba.fastjson.serializer.AwtCodec.support
import android.support.v4.app.SupportActivity
import android.support.v4.app.SupportActivity.ExtraData
import com.ydl.component.mvp.DemoContract
/** /**
* Created by haorui on 2019-09-01 . * Created by haorui on 2019-09-01 .
...@@ -43,8 +49,9 @@ import kotlinx.android.synthetic.main.activity_main.* ...@@ -43,8 +49,9 @@ import kotlinx.android.synthetic.main.activity_main.*
@Route(path = "/main/main") @Route(path = "/main/main")
class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(), class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(),
DemoContract.View { DemoContract.View {
private var secretDescriptionDialog: SecretDescriptionDialog? = null
private var serviceConnection: ServiceConnection? = null private var serviceConnection: ServiceConnection? = null
private var secretDialog: SecretDialog? = null
protected var playService: PlayService? = null protected var playService: PlayService? = null
override fun getContentViewId(): Int { override fun getContentViewId(): Int {
...@@ -69,11 +76,10 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -69,11 +76,10 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
override fun initDataAndEvent() { override fun initDataAndEvent() {
YDLavManager.instances.login("13081706") // YDLavManager.instances.init(this, "3387e9b251f3491e9221a9877e8f7830")
bindService() bindService()
// reLoadData() reLoadData()
requestPermission() requestPermission()
tv_user.setOnClickListener { tv_user.setOnClickListener {
reLoadData() reLoadData()
...@@ -109,14 +115,35 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -109,14 +115,35 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
FragmentContainerActivity.start(this, "TrendsHomeFragment") FragmentContainerActivity.start(this, "TrendsHomeFragment")
} }
bt_to_tests.setOnClickListener { bt_to_tests.setOnClickListener {
startActivity(Intent(this, NewTestHomeActivity::class.java)) // startActivity(Intent(this, NewTestHomeActivity::class.java))
// SecretActivity.Companion.startProtocol(this, it.data.getContent());
secretDescriptionDialog = SecretDescriptionDialog(
this@MainActivity,
"122342453653456345674356",
object : OnSecretDescriptionDialogListener {
override fun onCancel() {
secretDescriptionDialog!!.dismiss()
showEnsureDialog()
}
override fun onSure() {
secretDescriptionDialog!!.dismiss()
}
})
secretDescriptionDialog!!.setCanceledOnTouchOutside(false)
secretDescriptionDialog!!.show()
}
bt_to_collect_info.setOnClickListener {
startActivity(Intent(this, CollectSexAndBirthActivity::class.java))
} }
bt_to_confide.setOnClickListener { bt_to_confide.setOnClickListener {
startActivity(Intent(this, ConfideHomeActivity::class.java)) // YDLavManager.instances.login("1193016")
// startActivity(Intent(this, ConfideHomeActivity::class.java))
} }
bt_to_muse.setOnClickListener { bt_to_muse.setOnClickListener {
// YDLRouterManager.router(IYDLRouterConstant.ROUTER_MUSE_CENTER, // YDLRouterManager.router(IYDLRouterConstant.ROUTER_MUSE_CENTER,
// YDLRouterParams().putExtra // YDLRouterParams().putExtra
// ("url", "http://video.yidianling.com/2019/05/30/746851e2f335baf5f44499f4fb49d3a9.mp3")) // ("url", "http://video.yidianling.com/2019/05/30/746851e2f335baf5f44499f4fb49d3a9.mp3"))
...@@ -163,14 +190,18 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -163,14 +190,18 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
} }
bt_to_test.setOnClickListener { bt_to_test.setOnClickListener {
val dialog = SecretDescriptionDialog(this@MainActivity, "感谢您信任并使用壹点灵APP,\\n\n" + val dialog = SecretDescriptionDialog(this@MainActivity,
"感谢您信任并使用壹点灵APP,\\n\n" +
"我们深知个人隐私的重要性,为了您更好的使用本APP,希望您着重关注:\\n\\n1. 为向您提供交易相关基本功能,我们会收集、使用必要的信息;\\n\n" + "我们深知个人隐私的重要性,为了您更好的使用本APP,希望您着重关注:\\n\\n1. 为向您提供交易相关基本功能,我们会收集、使用必要的信息;\\n\n" +
"2. 基于您的明示授权,我们可能会获取您的位置(为您提供附近的咨询师等)、设备号信息(以保障您账号与交易安全)等信息,您有权拒绝或取消授权;\\n\n" + "2. 基于您的明示授权,我们可能会获取您的位置(为您提供附近的咨询师等)、设备号信息(以保障您账号与交易安全)等信息,您有权拒绝或取消授权;\\n\n" +
"3. 我们会采业界先进的安全措施保护您的信息安全;\\n\n" + "3. 我们会采业界先进的安全措施保护您的信息安全;\\n\n" +
"4. 未经您同意,我们不会从第三方处获取、共享或向其提供您的信息;\\n\n" + "4. 未经您同意,我们不会从第三方处获取、共享或向其提供您的信息;\\n\n" +
"5. 您可以查询、更正、删除您的个人信息。", object : SecretDescriptionDialog.OnSecretDescriptionDialogListener { "5. 您可以查询、更正、删除您的个人信息。",
object : SecretDescriptionDialog.OnSecretDescriptionDialogListener {
override fun onCancel() { override fun onCancel() {
val secretDialog = SecretDialog(this@MainActivity, object : SecretDialog.OnSecretDialogListener { val secretDialog = SecretDialog(
this@MainActivity,
object : SecretDialog.OnSecretDialogListener {
override fun onCancel() { override fun onCancel() {
ToastUtil.toastShort("onCancel") ToastUtil.toastShort("onCancel")
} }
...@@ -192,7 +223,6 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -192,7 +223,6 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
} }
override fun reLoadData() { override fun reLoadData() {
mPresenter.loadHome() mPresenter.loadHome()
} }
...@@ -262,4 +292,22 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -262,4 +292,22 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
} }
} }
private fun showEnsureDialog() {
secretDialog = SecretDialog(this, object : OnSecretDialogListener {
override fun onCancel() {
secretDialog!!.dismiss()
// finishAll()
// Process.killProcess(Process.myPid())
// System.exit(0)
}
override fun onSure() {
secretDialog!!.dismiss()
}
})
secretDialog!!.setCanceledOnTouchOutside(false)
secretDialog!!.show()
}
} }
...@@ -7,6 +7,7 @@ import com.ydl.component.mvp.DemoContract ...@@ -7,6 +7,7 @@ import com.ydl.component.mvp.DemoContract
import com.ydl.component.mvp.DemoPresenter import com.ydl.component.mvp.DemoPresenter
import com.ydl.ydlcommon.bean.StatusBarOptions import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.yidianling.consultant.ExpertSearchFragment
//import com.yidianling.consultant.ExpertSearchFragment //import com.yidianling.consultant.ExpertSearchFragment
import com.yidianling.dynamic.trendsHome.TrendsHomeFragment import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
import com.yidianling.home.ui.fragment.YdlHomeFragment import com.yidianling.home.ui.fragment.YdlHomeFragment
...@@ -70,9 +71,9 @@ class FragmentContainerActivity : BaseLceActivity<DemoContract.View, DemoContra ...@@ -70,9 +71,9 @@ class FragmentContainerActivity : BaseLceActivity<DemoContract.View, DemoContra
if ("YdlHomeFragment" == fragmentName) { if ("YdlHomeFragment" == fragmentName) {
return YdlHomeFragment() return YdlHomeFragment()
} }
// if ("ExpertSearchFragment" == fragmentName) { if ("ExpertSearchFragment" == fragmentName) {
// return ExpertSearchFragment() return ExpertSearchFragment()
// } }
return PlayFragment() return PlayFragment()
} }
} }
...@@ -184,6 +184,15 @@ ...@@ -184,6 +184,15 @@
android:layout_weight="1" android:layout_weight="1"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:text="动态" /> android:text="动态" />
<Button
android:id="@+id/bt_to_collect_info"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="10dp"
android:layout_marginRight="10dp"
android:text="信息收集" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -42,12 +42,12 @@ ext { ...@@ -42,12 +42,12 @@ ext {
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.48.7.6", "m-confide" : "0.0.48.7.12",
"m-consultant" : "0.0.57.4", "m-consultant" : "0.0.57.4",
"m-fm" : "0.0.29.3", "m-fm" : "0.0.29.3",
"m-user" : "0.0.58.2", "m-user" : "0.0.60.1",
"m-home" : "0.0.19.1", "m-home" : "0.0.19.1",
"m-im" : "0.0.15.6.1", "m-im" : "0.0.17.0",
"m-dynamic" : "0.0.7.5", "m-dynamic" : "0.0.7.5",
"m-muse" : "0.0.28.9", "m-muse" : "0.0.28.9",
...@@ -69,10 +69,10 @@ ext { ...@@ -69,10 +69,10 @@ ext {
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//第一步 //第一步
"ydl-platform" : "0.0.38.2", "ydl-platform" : "0.0.39.16",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.37.1", "ydl-webview" : "0.0.38.24",
"ydl-media" : "0.0.20", "ydl-media" : "0.0.20",
"ydl-pay" : "0.0.17", "ydl-pay" : "0.0.17",
"m-audioim" : "0.0.48.2.6", "m-audioim" : "0.0.48.2.6",
...@@ -115,13 +115,13 @@ ext { ...@@ -115,13 +115,13 @@ ext {
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//第一步 //第一步
"ydl-platform" : "0.0.38.2", "ydl-platform" : "0.0.39.16",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.37.1", "ydl-webview" : "0.0.38.24",
"ydl-media" : "0.0.20", "ydl-media" : "0.0.20",
"ydl-pay" : "0.0.17", "ydl-pay" : "0.0.17",
"m-audioim" : "0.0.48.2.6", "m-audioim" : "0.0.48.3.2",
"ydl-flutter-base": "0.0.10.9", "ydl-flutter-base": "0.0.10.9",
//以下 几乎不会动 //以下 几乎不会动
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# Specifies the JVM arguments used for the daemon process. # Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings. # The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m org.gradle.jvmargs=-Xmx2048m
# When configured, Gradle will run in incubating parallel mode. # When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit # This option should only be used with decoupled projects. More details, visit
......
...@@ -54,6 +54,7 @@ import com.ydl.ydlcommon.router.YdlCommonRouterManager ...@@ -54,6 +54,7 @@ import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.ydl.ydlcommon.utils.LogUtil import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.StatusBarUtils import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.Utils import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.log.LogHelper import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlcommon.utils.remind.ToastHelper import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.user.api.service.IUserService import com.yidianling.user.api.service.IUserService
...@@ -267,6 +268,18 @@ class AudioHomeActivity : ...@@ -267,6 +268,18 @@ class AudioHomeActivity :
} }
override fun onRejoinChannelSuccess(channel: String?, uid: Int, elapsed: Int) {
super.onRejoinChannelSuccess(channel, uid, elapsed)
LogUtil.e("[agora]$uid 用户声网重新加入频道成功:channel=$channel")
runOnUiThread {
//自己加入频道成功
if(!isConnectSuccess){
connectSuccess()
}
}
}
override fun onRtcStats(stats: IRtcEngineEventHandler.RtcStats?) { override fun onRtcStats(stats: IRtcEngineEventHandler.RtcStats?) {
super.onRtcStats(stats) super.onRtcStats(stats)
//因为用户端直接加入了频道,防止该回调执行时,专家还未加入频道,因此在连接成功之后,才进行频道人数判断 //因为用户端直接加入了频道,防止该回调执行时,专家还未加入频道,因此在连接成功之后,才进行频道人数判断
...@@ -458,6 +471,9 @@ class AudioHomeActivity : ...@@ -458,6 +471,9 @@ class AudioHomeActivity :
} else { } else {
userCloseCalling() userCloseCalling()
} }
ActionCountUtils.count("shengwang_popup_layer_page|shengwang_popup_layer_refuse_click", YdlCommonRouterManager.getYdlCommonRoute().getUid().toString(), uid = YdlCommonRouterManager.getYdlCommonRoute().getUid().toString())
} }
//免提 //免提
iv_hands_free.setOnClickListener { iv_hands_free.setOnClickListener {
...@@ -531,33 +547,18 @@ class AudioHomeActivity : ...@@ -531,33 +547,18 @@ class AudioHomeActivity :
// } // }
// } // }
// //
// override fun onRemoteInvitationReceived(response: CallRemoteResponse?) { // override fun onMessageReceived(message: RTMMesssage?, member: ChannelMember?) {
// //返回给被叫 // //接到频道消息
// LogUtil.i("[agora]收到来自${response?.callerId}的呼叫邀请") // LogUtil.i("[agora]接到${member?.channelId}频道${member?.userId}的消息:" + message?.text)
// }
//
// override fun onRemoteInvitationAccepted(response: CallRemoteResponse?) {
// //返回给被叫
// LogUtil.i("[agora]接受来自${response?.callerId}的呼叫成功")
// }
//
// override fun onRemoteInvitationRefused(response: CallRemoteResponse?) {
// //返回给被叫
// LogUtil.i("[agora]已拒绝来自${response?.callerId}的呼叫")
// }
//
// override fun onRemoteInvitationCanceled(response: CallRemoteResponse?) {
// //返回给被叫
// LogUtil.i("[agora]主叫${response?.callerId}已取消呼叫邀请")
// } // }
// //
// override fun onRemoteInvitationFailure(response: CallRemoteResponse?, errorCode: Int) { // override fun onMemberJoined(member: ChannelMember?) {
// //返回给被叫 // //新用户加入频道
// LogUtil.i("[agora]来自主叫${response?.callerId}的呼叫邀请进程失败:${response?.response}") // LogUtil.i("[agora]新用户加入${member?.channelId}频道:${member?.userId}")
// } // }
// //
// override fun onOtherMsg(error: String?) { // override fun onMemberLeft(member: ChannelMember?) {
// LogUtil.i("[agora]其它消息:${error}") // LogUtil.i("[agora]有用户离开${member?.channelId}频道:${member?.userId}")
// } // }
// }) // })
} }
...@@ -610,27 +611,32 @@ class AudioHomeActivity : ...@@ -610,27 +611,32 @@ class AudioHomeActivity :
rtcCall() rtcCall()
Observable.interval(0, 100, TimeUnit.MILLISECONDS) // Observable.interval(0, 100, TimeUnit.MILLISECONDS)
// .subscribeOn(Schedulers.computation())
// .take(303)
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe({
// var result = it.toFloat() / 2.5f
// progress_view.setProgress(result)
// if (result >= 100f && !iv_hang_up.isEnabled) {
// //挂断按钮可点击
// iv_hang_up.isEnabled = true
// iv_hang_up.setImageResource(R.drawable.audioim_img_hang_up)
// }
// }, {}, {})
//开始60s等待倒计时
waitDisposable = Observable.interval(0, 100, TimeUnit.MILLISECONDS)
.subscribeOn(Schedulers.computation()) .subscribeOn(Schedulers.computation())
.take(303) .take(603)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ .subscribe({ var result = it.toFloat() / 2.5f
var result = it.toFloat() / 2.5f
progress_view.setProgress(result) progress_view.setProgress(result)
if (result >= 100f && !iv_hang_up.isEnabled) { if (result >= 100f && !iv_hang_up.isEnabled) {
//挂断按钮可点击 //挂断按钮可点击
iv_hang_up.isEnabled = true iv_hang_up.isEnabled = true
iv_hang_up.setImageResource(R.drawable.audioim_img_hang_up) iv_hang_up.setImageResource(R.drawable.audioim_img_hang_up)
} }
}, {}, {})
//开始60s等待倒计时
waitDisposable = Observable.interval(0, 100, TimeUnit.MILLISECONDS)
.subscribeOn(Schedulers.computation())
.take(603)
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
}, { }, {
LogUtil.d(it.message) LogUtil.d(it.message)
}, { }, {
...@@ -668,9 +674,6 @@ class AudioHomeActivity : ...@@ -668,9 +674,6 @@ class AudioHomeActivity :
*/ */
voiceManage = YDLVoiceManager(this, BuildConfig.AGORA_APPID, mRtcEventHandler) voiceManage = YDLVoiceManager(this, BuildConfig.AGORA_APPID, mRtcEventHandler)
voiceManage!!.init() voiceManage!!.init()
voiceManage!!.getVoiceApi().enableLastmileTest()
//默认听筒模式
voiceManage!!.getVoiceApi().setEnableSpeakerphone(false)
} }
/** /**
...@@ -914,9 +917,13 @@ class AudioHomeActivity : ...@@ -914,9 +917,13 @@ class AudioHomeActivity :
//通知服务端,此次通话已经接通,服务端开始订单 //通知服务端,此次通话已经接通,服务端开始订单
updateExpertStatus(false, 0) updateExpertStatus(false, 0)
if (waitDisposable != null) { //是否开启外放
waitDisposable!!.dispose() voiceManage!!.getVoiceApi().setEnableSpeakerphone(false)
} iv_hands_free.isSelected = false
iv_hands_free.setImageResource(R.drawable.audioim_img_hands_free_unuse)
// if (waitDisposable != null) {
// waitDisposable!!.dispose()
// }
if (disposable != null) { if (disposable != null) {
disposable!!.dispose() disposable!!.dispose()
} }
...@@ -1051,6 +1058,9 @@ class AudioHomeActivity : ...@@ -1051,6 +1058,9 @@ class AudioHomeActivity :
sensorManager!!.getDefaultSensor(Sensor.TYPE_PROXIMITY), sensorManager!!.getDefaultSensor(Sensor.TYPE_PROXIMITY),
SensorManager.SENSOR_DELAY_NORMAL SensorManager.SENSOR_DELAY_NORMAL
) )
ActionCountUtils.count("shengwang_popup_layer_page|shengwang_popup_layer_page_visit", "", uid = YdlCommonRouterManager.getYdlCommonRoute().getUid().toString())
} }
override fun onAccuracyChanged(sensor: Sensor?, accuracy: Int) { override fun onAccuracyChanged(sensor: Sensor?, accuracy: Int) {
......
...@@ -45,8 +45,10 @@ import com.ydl.ydlcommon.modular.ModularServiceManager; ...@@ -45,8 +45,10 @@ import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.ydl.ydlcommon.utils.LogUtil; import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.SharedPreferencesEditor; import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
import com.ydl.ydlcommon.utils.YdlBuryPointUtil; import com.ydl.ydlcommon.utils.YdlBuryPointUtil;
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils;
import com.ydl.ydlcommon.utils.log.LogHelper; import com.ydl.ydlcommon.utils.log.LogHelper;
import com.ydl.ydlcommon.view.CircleImageView; import com.ydl.ydlcommon.view.CircleImageView;
import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R; import com.yidianling.im.R;
import com.yidianling.im.router.ImIn; import com.yidianling.im.router.ImIn;
...@@ -258,9 +260,10 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -258,9 +260,10 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
if (ChatStatusCacheHelper.getStatusCache("collectEvent")) { if (ChatStatusCacheHelper.getStatusCache("collectEvent")) {
String time = Calendar.getInstance().get(Calendar.YEAR) + "-" + Calendar.getInstance().get(Calendar.MONTH) + Calendar.getInstance().get(Calendar.DAY_OF_MONTH); String time = Calendar.getInstance().get(Calendar.YEAR) + "-" + Calendar.getInstance().get(Calendar.MONTH) + Calendar.getInstance().get(Calendar.DAY_OF_MONTH);
// if (!TextUtils.equals(time, SharedPreferencesEditor.getString("skip_time_" + YdlCommonRouterManager.INSTANCE.getYdlCommonRoute().getUid()))) {
if (!TextUtils.equals(time, SharedPreferencesEditor.getString("skip_time_" + ImIn.INSTANCE.getUserInfo().getUid()))) { if (!TextUtils.equals(time, SharedPreferencesEditor.getString("skip_time_" + ImIn.INSTANCE.getUserInfo().getUid()))) {
collectInfoPopupWindow = new CollectInfoPopupWindow(getActivity(), (content, result) -> { collectInfoPopupWindow = new CollectInfoPopupWindow(getActivity(), new CollectInfoPopupWindow.OnSendMsgListener() {
@Override
public void sendMsg(@NotNull String content, @NotNull List<UserQuestInfoBean> result) {
if (TextUtils.isEmpty(content)) {//点击跳过后当天不再显示此弹窗 if (TextUtils.isEmpty(content)) {//点击跳过后当天不再显示此弹窗
SharedPreferencesEditor.putString("skip_time_" + ImIn.INSTANCE.getUserInfo().getUid() SharedPreferencesEditor.putString("skip_time_" + ImIn.INSTANCE.getUserInfo().getUid()
, time); , time);
...@@ -271,6 +274,12 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -271,6 +274,12 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
} }
submitUserCollect(result); submitUserCollect(result);
} }
}
@Override
public void finishPage() {
getActivity().finish();
}
}); });
getUserInfoCollect(); getUserInfoCollect();
if (!getActivity().isFinishing()) { if (!getActivity().isFinishing()) {
...@@ -281,8 +290,6 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -281,8 +290,6 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
} }
collectInfoPopupWindow.show(top_expert_info_cl); collectInfoPopupWindow.show(top_expert_info_cl);
} }
} }
ChatStatusCacheHelper.clearDataByKey("collectEvent"); ChatStatusCacheHelper.clearDataByKey("collectEvent");
} }
...@@ -382,6 +389,33 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -382,6 +389,33 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
rl_doctor_name.setVisibility(View.GONE); rl_doctor_name.setVisibility(View.GONE);
}); });
} }
if (ActionHandlerStorage.getL(sessionId) != null && ModularServiceManager.INSTANCE.provide(IUserService.class).getUserInfo().getUser_type() == 1) {
if (TextUtils.isEmpty(SharedPreferencesEditor.getString("chat_age_ensure_" + ImIn.INSTANCE.getUserInfo().getUid()))) {
ServiceImpl.Companion.getInstance().getNewUserMes()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(hasCollectedInResp -> {
if (hasCollectedInResp.data != null && hasCollectedInResp.data.size() > 0) {
for (UserQuestInfoBean bean : hasCollectedInResp.data) {
if (TextUtils.equals(bean.getUserInfoType(), "age")) {
try {
String year = bean.getContent();
if ((Calendar.getInstance().get(Calendar.YEAR) - Integer.valueOf(year)) <= 16) {
if (!getActivity().isFinishing()) {
showCheckAgeDialog();
}
}
} catch (Exception e) {
}
}
}
}
}, throwable -> {
});
}
}
} }
private void addScrollListener() { private void addScrollListener() {
...@@ -1190,7 +1224,18 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -1190,7 +1224,18 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(resp -> { .subscribe(resp -> {
if (resp.data != null && resp.data.size() > 0) { if (resp.data != null && resp.data.size() > 0) {
collectInfoPopupWindow.setData(resp.data); ServiceImpl.Companion.getInstance().getNewUserMes()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(hasCollectedInResp -> {
if (hasCollectedInResp.data != null && hasCollectedInResp.data.size() > 0) {
collectInfoPopupWindow.setData(resp.data, hasCollectedInResp.data);
} else {
collectInfoPopupWindow.setData(resp.data, null);
}
}, throwable -> {
collectInfoPopupWindow.setData(resp.data, null);
});
} else { } else {
collectInfoPopupWindow.dismiss(); collectInfoPopupWindow.dismiss();
} }
...@@ -1210,4 +1255,20 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -1210,4 +1255,20 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}, throwable -> { }, throwable -> {
}); });
} }
private void showCheckAgeDialog() {
CommonDialog.create(getActivity())
.setLeftOnclick("返回", v -> {
getActivity().finish();
ActionCountUtils.Companion.count("under_age_alert_page|under_age_alert_return_click");
})
.setRightClick("继续", v -> {
SharedPreferencesEditor.putString("chat_age_ensure_" + ImIn.INSTANCE.getUserInfo().getUid(), "ensure");
ActionCountUtils.Companion.count("under_age_alert_page|under_age_alert_continue_clcik");})
.setMessage("由于您未满16周岁,如需咨询需要在家长陪同下进行")
.setCancelAble(false)
.show();
ActionCountUtils.Companion.count("under_age_alert_page|under_age_alert_page_visit");
}
} }
...@@ -18,7 +18,8 @@ import com.yidianling.uikit.custom.http.response.UserQuestInfoBean ...@@ -18,7 +18,8 @@ import com.yidianling.uikit.custom.http.response.UserQuestInfoBean
* @Company 壹点灵 * @Company 壹点灵
* @date 2019/12/10 * @date 2019/12/10
*/ */
class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListener) : PopupWindow(mContext) { class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListener) :
PopupWindow(mContext) {
private var collectUserInformationView: CollectUserInformationView private var collectUserInformationView: CollectUserInformationView
private var isFromBack = true private var isFromBack = true
...@@ -30,6 +31,9 @@ class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListe ...@@ -30,6 +31,9 @@ class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListe
listener.sendMsg("", ArrayList()) listener.sendMsg("", ArrayList())
isFromBack = false isFromBack = false
dismiss() dismiss()
}, {
dismiss()
listener.finishPage()
}, { _content, _list -> }, { _content, _list ->
listener.sendMsg(_content, _list) listener.sendMsg(_content, _list)
isFromBack = false isFromBack = false
...@@ -49,12 +53,12 @@ class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListe ...@@ -49,12 +53,12 @@ class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListe
isOutsideTouchable = false isOutsideTouchable = false
} }
fun setData(list: List<UserQuestInfoBean>) { fun setData(list: List<UserQuestInfoBean>, hasCompleteInfoList: List<UserQuestInfoBean>?) {
if (list.isEmpty()) { if (list.isEmpty()) {
ToastUtil.toastShort("数据异常,请稍后重试") ToastUtil.toastShort("数据异常,请稍后重试")
return return
} }
collectUserInformationView.setData(list) collectUserInformationView.setData(list, hasCompleteInfoList)
} }
...@@ -78,6 +82,8 @@ class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListe ...@@ -78,6 +82,8 @@ class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListe
interface OnSendMsgListener { interface OnSendMsgListener {
fun sendMsg(content: String, result: List<UserQuestInfoBean>) fun sendMsg(content: String, result: List<UserQuestInfoBean>)
fun finishPage()
} }
} }
\ No newline at end of file
...@@ -48,6 +48,12 @@ interface ServiceApi { ...@@ -48,6 +48,12 @@ interface ServiceApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun userCollectList(): Observable<BaseAPIResponse<List<UserQuestInfoBean>>> fun userCollectList(): Observable<BaseAPIResponse<List<UserQuestInfoBean>>>
//获取新用户收集的信息
@POST("user/getNewUserMes")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getNewUserMes(): Observable<BaseAPIResponse<List<UserQuestInfoBean>>>
//信息采集的问题 //信息采集的问题
@POST("user/collect/submit") @POST("user/collect/submit")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
......
...@@ -64,6 +64,13 @@ class ServiceImpl private constructor() { ...@@ -64,6 +64,13 @@ class ServiceImpl private constructor() {
} }
/** /**
* 获取新用户收集的信息
*/
fun getNewUserMes(): Observable<BaseAPIResponse<List<UserQuestInfoBean>>> {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).getNewUserMes()
}
/**
* 上传采集的问题 * 上传采集的问题
*/ */
fun submitUserCollect(params: String): Observable<BaseAPIResponse<Any>> { fun submitUserCollect(params: String): Observable<BaseAPIResponse<Any>> {
......
...@@ -90,6 +90,16 @@ ...@@ -90,6 +90,16 @@
android:exported="true" android:exported="true"
android:launchMode="singleTop" /> android:launchMode="singleTop" />
<activity
android:name=".ui.collect.CollectSexAndBirthActivity"
android:exported="true"
android:launchMode="singleTop" />
<activity
android:name=".ui.collect.CollectFocusActivity"
android:exported="true"
android:launchMode="singleTop" />
</application> </application>
</manifest> </manifest>
\ No newline at end of file
package com.yidianling.user package com.yidianling.user
import android.app.Activity
import android.content.Context
import android.content.Intent
import com.tencent.bugly.crashreport.CrashReport import com.tencent.bugly.crashreport.CrashReport
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.BuryPointUtils import com.ydl.ydlcommon.utils.BuryPointUtils
import com.yidianling.common.tools.LogUtil import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxKeyboardTool
import com.yidianling.im.api.bean.IMLoginInfo import com.yidianling.im.api.bean.IMLoginInfo
import com.yidianling.im.api.bean.IMRequestCallback import com.yidianling.im.api.bean.IMRequestCallback
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
...@@ -12,6 +17,14 @@ import com.yidianling.user.api.event.UserLogoutEvent ...@@ -12,6 +17,14 @@ import com.yidianling.user.api.event.UserLogoutEvent
import com.yidianling.user.http.UserHttpImpl import com.yidianling.user.http.UserHttpImpl
import com.yidianling.user.http.request.Logout import com.yidianling.user.http.request.Logout
import com.yidianling.user.route.UserIn import com.yidianling.user.route.UserIn
import com.yidianling.user.safePrivate.FingerPrintCheckActivity
import com.yidianling.user.safePrivate.FingerPrintUtil
import com.yidianling.user.safePrivate.HandUnlockCheckActivity
import com.yidianling.user.ui.LoginActivity
import com.yidianling.user.ui.collect.CollectSexAndBirthActivity
import com.yidianling.user.ui.login.InputPassWordActivity
import com.yidianling.user.ui.login.RegisterAndLoginActivity
import com.yidianling.user.ui.login.VerificationCodeActivity
import de.greenrobot.event.EventBus import de.greenrobot.event.EventBus
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
...@@ -86,5 +99,46 @@ object LoginUtils { ...@@ -86,5 +99,46 @@ object LoginUtils {
UserHelper.setUserinfo(null) UserHelper.setUserinfo(null)
} }
@JvmStatic
fun LoginSuccessOperate(activity: Activity) {
val size = ActivityManager.getActivitySize()
if (size <= 2) {//当前stack只有两个页面,必然没有MainActivity
ActivityManager.finishAll()
if (StatusUtils.isFirstLogin && StatusUtils.isFromGuide) {
activity.startActivity(Intent(activity, CollectSexAndBirthActivity::class.java))
}else {
UserIn.mainIntent(activity)
}
} else {//需要判断stack中是否有MainActivity
//这里不能引用到MainActivity 想别的办法
var flag = 0
//判断stack中activity是否属于登录相关的三个页面
for (activity in ActivityManager.getInstance().getActivitys()) {
if (activity is RegisterAndLoginActivity
|| activity is VerificationCodeActivity
|| activity is InputPassWordActivity
|| activity is FingerPrintCheckActivity
|| activity is HandUnlockCheckActivity
) {
flag++
}
}
//flag小于size:则stack中必然有其他的activity
if (flag < size) {
ActivityManager.getInstance().finishActivity(VerificationCodeActivity::class.java)
ActivityManager.getInstance().finishActivity(InputPassWordActivity::class.java)
ActivityManager.getInstance().finishActivity(RegisterAndLoginActivity::class.java)
ActivityManager.getInstance().finishActivity(FingerPrintCheckActivity::class.java)
ActivityManager.getInstance().finishActivity(HandUnlockCheckActivity::class.java)
FingerPrintUtil.instance().setCurrentUnLockTime(System.currentTimeMillis())
} else {
ActivityManager.finishAll()
if (StatusUtils.isFirstLogin && StatusUtils.isFromGuide) {
activity.startActivity(Intent(activity, CollectSexAndBirthActivity::class.java))
} else {
UserIn.mainIntent(activity)
}
}
}
}
} }
\ No newline at end of file
package com.yidianling.user;
/**
* 部分实时状态记录类
* isFirstLogin && isFromGuide 表示为注册前置且进行了注册
*/
public class StatusUtils {
/**
* 是否是注册
*/
public static boolean isFirstLogin = false;
/**
* 是否是第一次打开App
*/
public static boolean isFromGuide = false;
}
package com.yidianling.user.bean
/**
* 用户信息收集关注数据bean
*/
class CollectFocusItemBean (
val id: String, //id
val cateName: String, //标题
val des: String, //描述二级标题
var isFocus: Boolean = false //是否关注
)
\ No newline at end of file
...@@ -37,6 +37,21 @@ class UserBIConstants { ...@@ -37,6 +37,21 @@ class UserBIConstants {
//登录主页浏览事件(不包含随便逛逛) //登录主页浏览事件(不包含随便逛逛)
const val POSITION_LOGIN_TWO_PAGE_VISIT = "login_main_two_page_visit" const val POSITION_LOGIN_TWO_PAGE_VISIT = "login_main_two_page_visit"
//百度监测 用户信息收集页面
const val COLLECT_USER_INFO_PAGE = "collect_user_info_page"
const val COLLECT_USER_INFO_PAGE_VISIT = "collect_user_info_page_visit" //百度监测 用户信息收集页面--页面浏览事件
const val COLLECT_USER_INFO_SEX_MAN_CLICK = "collect_user_info_sex_man_click" // (sign1存储状态(1代表选中,2代表取消),String) //百度监测 用户信息收集页面--性别男按钮点击
const val COLLECT_USER_INFO_SEX_FEMALE_CLICK = "collect_user_info_sex_female_click" // (sign1存储状态(1代表选中,2代表取消),String) //百度监测 用户信息收集页面--性别女按钮点击
const val COLLECT_USER_INFO_NEXT_CLICK= "collect_user_info_next_click" //百度监测 用户信息收集页面--下一步点击
const val COLLECT_USER_INFO_EXIT_CLICK= "collect_user_info_exit_click" //百度监测 用户信息收集页面--退出点击
//百度监测 收集感兴趣话题页
const val COLLECT_TOPIC_PAGE = "collect_topic_page"
const val COLLECT_TOPIC_PAGE_VISIT = "collect_topic_page_visit" //百度监测 页面浏览事件
const val COLLECT_TOPIC_CLICK = "collect_topic_click" //百度监测 话题点击 ( sign1存储话题,例如:情绪压力)
const val COLLECT_TOPIC_SUBMIT_CLICK = "collect_topic_submit_click" //百度监测 提交点击
const val COLLECT_TOPIC_INFO_EXIT_CLICK = "collect_topic_info_exit_click" //百度监测 退出点击
/** /**
* action type * action type
......
...@@ -7,6 +7,7 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA ...@@ -7,6 +7,7 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.CollectFocusItemBean
import com.yidianling.user.http.response.* import com.yidianling.user.http.response.*
import io.reactivex.Observable import io.reactivex.Observable
import okhttp3.RequestBody import okhttp3.RequestBody
...@@ -177,4 +178,20 @@ interface UserApi { ...@@ -177,4 +178,20 @@ interface UserApi {
//获取隐私政策数据 //获取隐私政策数据
@GET("site/get-privacy-content") @GET("site/get-privacy-content")
fun getSecretData(): Observable<BaseResponse<SecretResponse>> fun getSecretData(): Observable<BaseResponse<SecretResponse>>
//上传用户信息数据接口
@POST("user/collect/submit")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
fun uploadUserInfo(@Body body: RequestBody): Observable<BaseAPIResponse<Any>>
//获取关注问题数据接口
@GET("cate/list-parentId")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
fun getFocusData(@Query("parentId") parentId: String = "0"): Observable<BaseAPIResponse<List<CollectFocusItemBean>>>
//获取新用户引导页面url
@POST("user/getNewUserJumpUrl")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
fun getNewUserJumpUrl(): Observable<BaseAPIResponse<String>>
} }
\ No newline at end of file
...@@ -7,11 +7,9 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse ...@@ -7,11 +7,9 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.CheckPhonePassBean import com.yidianling.user.bean.CheckPhonePassBean
import com.yidianling.user.bean.CollectFocusItemBean
import com.yidianling.user.http.request.* import com.yidianling.user.http.request.*
import com.yidianling.user.http.response.CheckPassword import com.yidianling.user.http.response.*
import com.yidianling.user.http.response.CountryResponse
import com.yidianling.user.http.response.ExistResponse
import com.yidianling.user.http.response.SecretResponse
import io.reactivex.Observable import io.reactivex.Observable
/** /**
...@@ -64,4 +62,10 @@ interface UserHttp { ...@@ -64,4 +62,10 @@ interface UserHttp {
fun unBindThirdLogin(param: UnBindThirdLoginParam): Observable<BaseResponse<Any>> fun unBindThirdLogin(param: UnBindThirdLoginParam): Observable<BaseResponse<Any>>
fun getSecretData(): Observable<BaseResponse<SecretResponse>> fun getSecretData(): Observable<BaseResponse<SecretResponse>>
fun userInfoCollectUpload(param: UserInfoCollectUploadParam): Observable<BaseAPIResponse<Any>>
fun getFocusData(): Observable<BaseAPIResponse<List<CollectFocusItemBean>>>
fun getNewUserJumpUrl(): Observable<BaseAPIResponse<String>>
} }
\ No newline at end of file
...@@ -15,11 +15,9 @@ import com.yidianling.common.tools.RxDeviceTool ...@@ -15,11 +15,9 @@ import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.UserHelper import com.yidianling.user.UserHelper
import com.yidianling.user.bean.CheckPhonePassBean import com.yidianling.user.bean.CheckPhonePassBean
import com.yidianling.user.bean.CollectFocusItemBean
import com.yidianling.user.http.request.* import com.yidianling.user.http.request.*
import com.yidianling.user.http.response.CheckPassword import com.yidianling.user.http.response.*
import com.yidianling.user.http.response.CountryResponse
import com.yidianling.user.http.response.ExistResponse
import com.yidianling.user.http.response.SecretResponse
import com.yidianling.user.rxlogin.LoginObservable import com.yidianling.user.rxlogin.LoginObservable
import io.reactivex.Observable import io.reactivex.Observable
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
...@@ -195,6 +193,19 @@ class UserHttpImpl private constructor() : UserHttp { ...@@ -195,6 +193,19 @@ class UserHttpImpl private constructor() : UserHttp {
return getUserApi().getSecretData() return getUserApi().getSecretData()
} }
override fun userInfoCollectUpload(param: UserInfoCollectUploadParam): Observable<BaseAPIResponse<Any>> {
var str = Gson().toJson(param)
val body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), str)
return getUserApi().uploadUserInfo(body)
}
override fun getFocusData(): Observable<BaseAPIResponse<List<CollectFocusItemBean>>> {
return getUserApi().getFocusData()
}
override fun getNewUserJumpUrl(): Observable<BaseAPIResponse<String>> {
return getUserApi().getNewUserJumpUrl()
}
private object Holder { private object Holder {
val INSTANCE = UserHttpImpl() val INSTANCE = UserHttpImpl()
......
package com.yidianling.user.http.request;
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/2/15
*/
public class UserInfoCollectParam {
public UserInfoCollectParam(String content, String userInfoType) {
this.content = content;
this.userInfoType = userInfoType;
}
public String content; //"男","女"
public String userInfoType; // "gener"性别 "age"年龄 "consultAttention"关注话题
public String getContent() {
return content;
}
public String getUserInfoType() {
return userInfoType;
}
public void setContent(String content) {
this.content = content;
}
public void setUserInfoType(String userInfoType) {
this.userInfoType = userInfoType;
}
}
package com.yidianling.user.http.request;
import java.util.ArrayList;
public class UserInfoCollectUploadParam {
public ArrayList<UserInfoCollectParam> userInfoList;
}
package com.yidianling.user.http.response
class CollectFocusResponseBean (
val id: String,
val cateName: String,
val des: String,
val isFocus: Boolean = false
)
\ No newline at end of file
...@@ -19,6 +19,7 @@ import com.yidianling.home.api.service.IHomeService ...@@ -19,6 +19,7 @@ import com.yidianling.home.api.service.IHomeService
import com.yidianling.im.api.bean.IMLoginInfo import com.yidianling.im.api.bean.IMLoginInfo
import com.yidianling.im.api.bean.IMRequestCallback import com.yidianling.im.api.bean.IMRequestCallback
import com.yidianling.user.LoginUtils import com.yidianling.user.LoginUtils
import com.yidianling.user.StatusUtils
import com.yidianling.user.UserConstants import com.yidianling.user.UserConstants
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.constants.UserBIConstants import com.yidianling.user.constants.UserBIConstants
...@@ -150,16 +151,18 @@ class SmsLoginActivity : BaseActivity() { ...@@ -150,16 +151,18 @@ class SmsLoginActivity : BaseActivity() {
//关闭手势解锁页面与指纹解锁页面 //关闭手势解锁页面与指纹解锁页面
finishFinger() finishFinger()
if (it.firstLogin == 1) { if (it.firstLogin == 1) {
StatusUtils.isFirstLogin = true
ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true) ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true)
baiduActionBury() baiduActionBury()
}else { }else {
ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,it.uid!!,UserBIConstants.ACTION_TYPE_CODE_LOGIN) ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,it.uid!!,UserBIConstants.ACTION_TYPE_CODE_LOGIN)
} }
ActivityManager.finishActivity(LoginActivity::class.java) // ActivityManager.finishActivity(LoginActivity::class.java)
if (ActivityManager.getActivitySize() <= 1) { // if (ActivityManager.getActivitySize() <= 1) {
UserIn.mainIntent(this) // UserIn.mainIntent(this)
} // }
finish() // finish()
LoginUtils.LoginSuccessOperate(this)
}, object : ThrowableConsumer() { }, object : ThrowableConsumer() {
override fun accept(msg: String) { override fun accept(msg: String) {
dismissProgressDialog() dismissProgressDialog()
......
package com.yidianling.user.ui.collect.dialog
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import com.yidianling.user.R
class CompleteCollectUserInfoDialog(context: Context): Dialog(context, R.style.platform_dialog_default_style) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.user_complete_collect_dialog_layout)
setCanceledOnTouchOutside(false)
}
}
\ No newline at end of file
package com.yidianling.user.ui.collect.widget
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Color
import android.graphics.Typeface
import android.support.v4.content.ContextCompat
import android.util.AttributeSet
import android.view.Gravity
import android.view.View
import android.widget.LinearLayout
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import com.yidianling.user.R
import kotlinx.android.synthetic.main.user_item_focus_layout.view.*
class CollectFocusView : LinearLayout {
constructor(context: Context) : super(context) {
mContext = context
initView()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
mContext = context
initView()
}
constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(
context,
attrs,
defStyle
) {
mContext = context
initView()
}
private var mContext: Context? = null
private fun initView() {
View.inflate(mContext, R.layout.user_item_focus_layout, this)
val mWidth: Int = RxDeviceTool.getScreenWidth(mContext) / 2 - RxImageTool.dp2px(20f + 9.5f)
val params = LinearLayout.LayoutParams(
mWidth,
RxImageTool.dp2px(68f)
)
layoutParams = params
setFocus(false)
}
@SuppressLint("ResourceAsColor")
fun setFocus(focus: Boolean) {
if (focus) {
user_focus_title.setTextColor(ContextCompat.getColor(mContext, R.color.user_main_theme))
user_focus_desc.setTextColor(ContextCompat.getColor(mContext, R.color.user_main_theme))
user_focus_title.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
setBackgroundResource(R.drawable.user_collect_select_bg)
} else {
user_focus_title.typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
user_focus_title.setTextColor(Color.parseColor("#242424"))
user_focus_desc.setTextColor(Color.parseColor("#666666"))
setBackgroundResource(R.drawable.user_collect_unselect_bg)
}
}
fun setData(title: String, desc: String) {
user_focus_title.text = title
user_focus_desc.text = desc
}
}
\ No newline at end of file
package com.yidianling.user.ui.collect.widget
import android.content.Context
import android.content.res.Resources
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
import android.widget.EditText
import android.widget.NumberPicker
/**
* 自定义数字选择器
*/
class CustomNumberPicker: NumberPicker {
constructor(context: Context): super(context)
constructor(context: Context, attrs: AttributeSet): super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int): super(context, attrs, defStyleAttr)
override fun addView(child: View) {
updateView(child)
}
override fun addView(child: View, width: Int, height: Int) {
super.addView(child, width, height)
updateView(child)
}
override fun addView(child: View, index: Int, params: ViewGroup.LayoutParams) {
super.addView(child, index, params)
updateView(child)
}
override fun addView(child: View, params: ViewGroup.LayoutParams) {
super.addView(child, params)
updateView(child)
}
fun updateView(view: View) {
if (view is EditText) {
//这里修改显示字体的属性,主要修改颜色和大小
// view.setTextColor(Color.parseColor("#242424"))
view.textSize = 22f
}
}
/**
* 设置picker分割线的颜色
*/
public fun setDividerColor(colorString: String) {
val field = NumberPicker::class.java.getDeclaredField("mSelectionDivider")
if (field != null) {
field.isAccessible = true
field.set(this, ColorDrawable(Color.parseColor(colorString)))
}
}
/**
* 设置picker分割线的宽度
*/
public fun setNumberPickerDividerHeight(height: Int) {
val fields = NumberPicker::class.java.declaredFields
for (f in fields) {
if (f.name == "mSelectionDividerHeight") {
f.isAccessible = true
f.set(this, height)
break
}
}
}
/**
* 设置picker分割线透明
*/
public fun setNumberPickerDividerColorTransparent() {
val pickerFields = NumberPicker::class.java.declaredFields
for (pf in pickerFields) {
if (pf.name.equals("mSelectionDivider")) {
pf.isAccessible = true
try {
//设置分割线的颜色值 透明
pf.set(
this,
ColorDrawable(this.resources.getColor(android.R.color.transparent))
)
} catch (e: IllegalArgumentException) {
e.printStackTrace()
} catch (e: Resources.NotFoundException) {
e.printStackTrace()
} catch (e: IllegalAccessException) {
e.printStackTrace()
}
break
}
}
}
}
\ No newline at end of file
...@@ -16,6 +16,7 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils ...@@ -16,6 +16,7 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.view.dialog.CommonDialog import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.yidianling.common.tools.RxKeyboardTool import com.yidianling.common.tools.RxKeyboardTool
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.LoginUtils
import com.yidianling.user.R import com.yidianling.user.R
import com.yidianling.user.constants.UserBIConstants import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.route.UserIn import com.yidianling.user.route.UserIn
...@@ -276,38 +277,10 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput ...@@ -276,38 +277,10 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput
} }
override fun closeActivity() { override fun closeActivity() {
RxKeyboardTool.hideSoftInput(this) RxKeyboardTool.hideSoftInput(this)
val size = ActivityManager.getActivitySize()
if (size <= 2) {//当前stack只有两个页面,必然没有MainActivity LoginUtils.LoginSuccessOperate(this)
ActivityManager.finishAll()
UserIn.mainIntent(this)
} else {//需要判断stack中是否有MainActivity
//这里不能引用到MainActivity 想别的办法
var flag = 0
//判断stack中activity是否属于登录相关的三个页面
for (activity in ActivityManager.getInstance().getActivitys()) {
if (activity is RegisterAndLoginActivity
|| activity is VerificationCodeActivity
|| activity is InputPassWordActivity
|| activity is FingerPrintCheckActivity
|| activity is HandUnlockCheckActivity
) {
flag++
}
}
//flag小于size:则stack中必然有其他的activity
if (flag < size) {
ActivityManager.getInstance().finishActivity(VerificationCodeActivity::class.java)
ActivityManager.getInstance().finishActivity(InputPassWordActivity::class.java)
ActivityManager.getInstance().finishActivity(RegisterAndLoginActivity::class.java)
ActivityManager.getInstance().finishActivity(FingerPrintCheckActivity::class.java)
ActivityManager.getInstance().finishActivity(HandUnlockCheckActivity::class.java)
FingerPrintUtil.instance().setCurrentUnLockTime(System.currentTimeMillis())
} else {
ActivityManager.finishAll()
UserIn.mainIntent(this)
}
}
} }
private fun closeAnim(hasAnim: Boolean) { private fun closeAnim(hasAnim: Boolean) {
......
...@@ -38,7 +38,9 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog ...@@ -38,7 +38,9 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.yidianling.common.tools.LogUtil import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxKeyboardTool import com.yidianling.common.tools.RxKeyboardTool
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.LoginUtils
import com.yidianling.user.R import com.yidianling.user.R
import com.yidianling.user.StatusUtils
import com.yidianling.user.UserHelper import com.yidianling.user.UserHelper
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.AliAuthBean import com.yidianling.user.bean.AliAuthBean
...@@ -126,6 +128,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -126,6 +128,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
override fun initDataAndEvent() { override fun initDataAndEvent() {
isUmengLoginState = intent.getBooleanExtra(BIND_PHONE, false) isUmengLoginState = intent.getBooleanExtra(BIND_PHONE, false)
isFromGuide = intent.getBooleanExtra(IS_FROM_GUIDE, false) isFromGuide = intent.getBooleanExtra(IS_FROM_GUIDE, false)
StatusUtils.isFromGuide = isFromGuide
setWindowStatusBarColor() setWindowStatusBarColor()
initAuthHelper() initAuthHelper()
...@@ -467,10 +470,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -467,10 +470,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
tv_reg_title.text = "手机号绑定" tv_reg_title.text = "手机号绑定"
tv_protocol.visibility = View.GONE tv_protocol.visibility = View.GONE
} else { } else {
finishPrePage() LoginUtils.LoginSuccessOperate(this)
if (isFromGuide) {
UserIn.mainIntent(this)
}
} }
} }
...@@ -567,13 +567,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -567,13 +567,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
override fun autoLoginSuccess() { override fun autoLoginSuccess() {
ll_success.visibility = View.VISIBLE ll_success.visibility = View.VISIBLE
handler!!.postDelayed({ handler!!.postDelayed({
val size = ActivityManager.getActivitySize() LoginUtils.LoginSuccessOperate(this)
if (size == 1) {
ActivityManager.finishAll()
UserIn.mainIntent(this)
} else {
finishPrePage()
}
}, 3000) }, 3000)
} }
......
...@@ -14,6 +14,7 @@ import com.ydl.ydlcommon.utils.YDLCacheUtils ...@@ -14,6 +14,7 @@ import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.RxKeyboardTool import com.yidianling.common.tools.RxKeyboardTool
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.LoginUtils
import com.yidianling.user.R import com.yidianling.user.R
import com.yidianling.user.UserHelper import com.yidianling.user.UserHelper
import com.yidianling.user.constants.UserBIConstants import com.yidianling.user.constants.UserBIConstants
...@@ -272,37 +273,7 @@ class VerificationCodeActivity : BaseMvpActivity<IVerificationCodeContract.View, ...@@ -272,37 +273,7 @@ class VerificationCodeActivity : BaseMvpActivity<IVerificationCodeContract.View,
override fun closeActivity() { override fun closeActivity() {
RxKeyboardTool.hideSoftInput(this) RxKeyboardTool.hideSoftInput(this)
val size = ActivityManager.getActivitySize() LoginUtils.LoginSuccessOperate(this)
if (size <= 2) {//当前stack只有两个页面,必然没有MainActivity
ActivityManager.finishAll()
UserIn.mainIntent(this)
} else {//需要判断stack中是否有MainActivity
//这里不能引用到MainActivity 想别的办法
var flag = 0
//判断stack中activity是否属于登录相关的三个页面
for (activity in ActivityManager.getInstance().getActivitys()) {
if (activity is RegisterAndLoginActivity
|| activity is VerificationCodeActivity
|| activity is InputPassWordActivity
|| activity is FingerPrintCheckActivity
|| activity is HandUnlockCheckActivity
) {
flag++
}
}
//flag小于size:则stack中必然有其他的activity
if (flag < size) {
ActivityManager.getInstance().finishActivity(VerificationCodeActivity::class.java)
ActivityManager.getInstance().finishActivity(InputPassWordActivity::class.java)
ActivityManager.getInstance().finishActivity(RegisterAndLoginActivity::class.java)
ActivityManager.getInstance().finishActivity(FingerPrintCheckActivity::class.java)
ActivityManager.getInstance().finishActivity(HandUnlockCheckActivity::class.java)
FingerPrintUtil.instance().setCurrentUnLockTime(System.currentTimeMillis())
} else {
ActivityManager.finishAll()
UserIn.mainIntent(this)
}
}
} }
/** /**
......
...@@ -12,6 +12,7 @@ import com.ydl.ydlcommon.utils.log.LogHelper ...@@ -12,6 +12,7 @@ import com.ydl.ydlcommon.utils.log.LogHelper
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.home.api.service.IHomeService import com.yidianling.home.api.service.IHomeService
import com.yidianling.user.LoginUtils import com.yidianling.user.LoginUtils
import com.yidianling.user.StatusUtils
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.constants.UserBIConstants import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.http.request.PhoneLoginPwdParam import com.yidianling.user.http.request.PhoneLoginPwdParam
...@@ -59,6 +60,7 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II ...@@ -59,6 +60,7 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II
saveUserData(it.data) saveUserData(it.data)
ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,it.data.uid!!,UserBIConstants.ACTION_TYPE_RESET_PWD) ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,it.data.uid!!,UserBIConstants.ACTION_TYPE_RESET_PWD)
if (it.data.firstLogin == 1) {//第一次登录:是注册 if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true
ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true) ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true)
// 重设密码登录已经不可能是首次登录,所以不进行百度埋点 // 重设密码登录已经不可能是首次登录,所以不进行百度埋点
//view.baiduActionBury() //view.baiduActionBury()
...@@ -96,6 +98,7 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II ...@@ -96,6 +98,7 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II
} else { } else {
saveUserData(it.data) saveUserData(it.data)
if (it.data.firstLogin == 1) {//第一次登录:是注册 if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true
ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true) ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true)
mView.baiduActionBury() mView.baiduActionBury()
} else { } else {
......
...@@ -13,6 +13,7 @@ import com.ydl.ydlcommon.utils.log.LogHelper ...@@ -13,6 +13,7 @@ import com.ydl.ydlcommon.utils.log.LogHelper
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.home.api.service.IHomeService import com.yidianling.home.api.service.IHomeService
import com.yidianling.user.LoginUtils import com.yidianling.user.LoginUtils
import com.yidianling.user.StatusUtils
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.constants.UserBIConstants import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.http.UserHttpImpl import com.yidianling.user.http.UserHttpImpl
...@@ -71,6 +72,7 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra ...@@ -71,6 +72,7 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
//绑定手机号 //绑定手机号
saveUserData(it.data) saveUserData(it.data)
if (it.data.firstLogin == 1) {//第一次登录:是注册 if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true
ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true) ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true)
mView.baiduActionBury(it.data.uid, UserBIConstants.POSITION_ALIYUN_REGISTER_CLICK) mView.baiduActionBury(it.data.uid, UserBIConstants.POSITION_ALIYUN_REGISTER_CLICK)
} else { } else {
...@@ -193,11 +195,9 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra ...@@ -193,11 +195,9 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
ToastUtil.toastShort(it.msg) ToastUtil.toastShort(it.msg)
return@subscribe return@subscribe
} }
LoginUtils.onLogin(it.data)
mView.thirdLoginSuccess(it.data.userInfo!!)
LogHelper.getInstance().writeLogSync(media.getName() + "登录成功")
if (media == SHARE_MEDIA.QQ) { if (media == SHARE_MEDIA.QQ) {
if (it.data.firstLogin == 1) {//第一次登录:是注册 if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true
ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true) ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true)
mView.baiduActionBury(it.data.uid,UserBIConstants.POSITION_QQ_REGISTER_CLICK) mView.baiduActionBury(it.data.uid,UserBIConstants.POSITION_QQ_REGISTER_CLICK)
} else { } else {
...@@ -205,12 +205,16 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra ...@@ -205,12 +205,16 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
} }
} else { } else {
if (it.data.firstLogin == 1) {//第一次登录:是注册 if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true
ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true) ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true)
mView.baiduActionBury(it.data.uid,UserBIConstants.POSITION_WX_REGISTER_CLICK) mView.baiduActionBury(it.data.uid,UserBIConstants.POSITION_WX_REGISTER_CLICK)
} else { } else {
ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK, it.data.uid!!,sign1) ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK, it.data.uid!!,sign1)
} }
} }
LoginUtils.onLogin(it.data)
mView.thirdLoginSuccess(it.data.userInfo!!)
LogHelper.getInstance().writeLogSync(media.getName() + "登录成功")
}, { }, {
mView.dismissProgressView() mView.dismissProgressView()
YdlCommonOut.showToast(it.message!!) YdlCommonOut.showToast(it.message!!)
......
...@@ -9,6 +9,7 @@ import com.ydl.ydlcommon.utils.log.LogHelper ...@@ -9,6 +9,7 @@ import com.ydl.ydlcommon.utils.log.LogHelper
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.home.api.service.IHomeService import com.yidianling.home.api.service.IHomeService
import com.yidianling.user.LoginUtils import com.yidianling.user.LoginUtils
import com.yidianling.user.StatusUtils
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.constants.UserBIConstants import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.http.request.BindPhoneJavaParam import com.yidianling.user.http.request.BindPhoneJavaParam
...@@ -145,6 +146,7 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base ...@@ -145,6 +146,7 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
saveUserData(it.data) saveUserData(it.data)
if (it.data.firstLogin == 1) {//第一次登录:是注册 if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true
ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true) ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true)
mView.baiduActionBury() mView.baiduActionBury()
} else { } else {
......
...@@ -10,7 +10,6 @@ import android.text.Spanned ...@@ -10,7 +10,6 @@ import android.text.Spanned
import android.text.TextPaint import android.text.TextPaint
import android.text.method.LinkMovementMethod import android.text.method.LinkMovementMethod
import android.text.style.ClickableSpan import android.text.style.ClickableSpan
import android.text.style.ForegroundColorSpan
import android.view.Gravity import android.view.Gravity
import android.view.View import android.view.View
import android.view.WindowManager import android.view.WindowManager
...@@ -18,7 +17,7 @@ import com.ydl.ydlcommon.utils.SharedPreferencesEditor ...@@ -18,7 +17,7 @@ import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.Utils import com.ydl.ydlcommon.utils.Utils
import com.yidianling.user.R import com.yidianling.user.R
import com.yidianling.user.ui.login.H5Activity import com.yidianling.user.ui.login.H5Activity
import kotlinx.android.synthetic.main.user_activity_secret.* import kotlinx.android.synthetic.main.user_dialog_secret.*
class SecretDescriptionDialog( class SecretDescriptionDialog(
...@@ -30,7 +29,7 @@ class SecretDescriptionDialog( ...@@ -30,7 +29,7 @@ class SecretDescriptionDialog(
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.user_activity_secret) setContentView(R.layout.user_dialog_secret)
val params = window.attributes val params = window.attributes
params.width = WindowManager.LayoutParams.MATCH_PARENT params.width = WindowManager.LayoutParams.MATCH_PARENT
...@@ -65,14 +64,14 @@ class SecretDescriptionDialog( ...@@ -65,14 +64,14 @@ class SecretDescriptionDialog(
spannableString.setSpan( spannableString.setSpan(
object : ClickableSpan() { object : ClickableSpan() {
override fun onClick(widget: View?) { override fun onClick(widget: View?) {
if (Utils.isFastClick()){ if (Utils.isFastClick()) {
return return
} }
H5Activity.start(mContext, false) H5Activity.start(mContext, false)
} }
override fun updateDrawState(ds: TextPaint?) { override fun updateDrawState(ds: TextPaint?) {
ds?.color=Color.parseColor("#159CEF") ds?.color = Color.parseColor("#159CEF")
} }
}, 5, }, 5,
13, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE 13, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
...@@ -80,14 +79,14 @@ class SecretDescriptionDialog( ...@@ -80,14 +79,14 @@ class SecretDescriptionDialog(
spannableString.setSpan( spannableString.setSpan(
object : ClickableSpan() { object : ClickableSpan() {
override fun onClick(widget: View?) { override fun onClick(widget: View?) {
if (Utils.isFastClick()){ if (Utils.isFastClick()) {
return return
} }
H5Activity.start(mContext, true) H5Activity.start(mContext, true)
} }
override fun updateDrawState(ds: TextPaint?) { override fun updateDrawState(ds: TextPaint?) {
ds?.color=Color.parseColor("#159CEF") ds?.color = Color.parseColor("#159CEF")
} }
}, str.length - 8, }, str.length - 8,
str.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE str.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="4dp"/>
<stroke android:width="1dp"
android:color="@color/user_main_theme"/>
<solid
android:color="@color/user_main_theme_bright"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="4dp"/>
<stroke android:width="0.5dp"
android:color="#CCCCCC"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ffffff"/>
<corners android:radius="8dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal">
<TextView
android:id="@+id/collect_focus_out_btn"
android:layout_width="68dp"
android:layout_height="60dp"
android:gravity="center"
android:text="退出"
android:textSize="14dp"
android:textColor="#999999"
android:layout_gravity="right"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="选择您关注的问题"
android:textColor="@color/user_main_theme"
android:textStyle="bold"
android:textSize="28dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="为您推荐平台精选"
android:textSize="16dp"
android:textColor="#999999"
android:layout_marginTop="2dp"/>
<ScrollView
android:id="@+id/focus_scrollview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginTop="20dp"
android:paddingBottom="20dp">
<LinearLayout
android:id="@+id/focus_scrollview_ll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- 这里添加接口获取的关注数据视图 -->
</LinearLayout>
</ScrollView>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#ebebeb"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="64dp"
android:gravity="center">
<TextView
android:id="@+id/upload_focus_info_btn"
android:layout_marginLeft="17dp"
android:layout_marginRight="17dp"
android:layout_width="match_parent"
android:layout_height="44dp"
android:gravity="center"
android:text="提交(可多选)"
android:textSize="17dp"
android:textColor="#ffffff"
android:background="@drawable/user_collect_bottom_btn_un_bg"/>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout 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" xmlns:tools="http://schemas.android.com/tools"
xmlns:myapp="http://schemas.android.com/apk/res-auto" android:background="#ffffff">
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="34dp"
android:layout_marginRight="34dp"
android:background="@drawable/user_secret_dialog_bg">
<RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <ImageView
<com.ydl.ydlcommon.view.widgets.RoundImageView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
myapp:pa_borderRadius="12dp"
myapp:pa_type="pa_round"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:src="@drawable/user_secret_top_bg"/> android:src="@drawable/user_secret_top_bg" />
<RelativeLayout <RelativeLayout
android:id="@+id/user_top_rl" android:id="@+id/user_top_rl"
...@@ -34,37 +23,37 @@ ...@@ -34,37 +23,37 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="25dp" android:layout_marginLeft="25dp"
android:layout_marginTop="40dp" android:layout_marginTop="40dp"
android:text="隐私政策" android:text="壹点灵"
android:textColor="#242424" android:textColor="#242424"
android:textSize="28dp" android:textSize="28dp"
android:textStyle="bold"/> android:textStyle="bold" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/secrey_title" android:layout_below="@+id/secrey_title"
android:layout_marginLeft="25dp" android:layout_marginLeft="25dp"
android:text="及使用协议说明" android:text="隐私政策概要"
android:textColor="#242424" android:textColor="#242424"
android:textSize="28dp" android:textSize="28dp"
android:textStyle="bold"/> android:textStyle="bold" />
</RelativeLayout> </RelativeLayout>
</RelativeLayout>
<RelativeLayout android:layout_width="match_parent" android:layout_height="194dp">
<ScrollView <ScrollView
android:layout_below="@+id/user_top_rl"
android:layout_alignBottom="@+id/secret_bottom_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="194dp" android:layout_height="wrap_content"
android:scrollbars="none" android:layout_marginBottom="42dp">
>
<RelativeLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="25dp" android:layout_marginLeft="25dp"
android:layout_marginRight="25dp" android:layout_marginRight="25dp"
> android:orientation="vertical">
<TextView <TextView
android:id="@+id/user_secret_desc" android:id="@+id/user_secret_desc"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -78,94 +67,86 @@ ...@@ -78,94 +67,86 @@
4. 未经您同意,我们不会从第三方处获取、共享或向其提供您的信息;\n 4. 未经您同意,我们不会从第三方处获取、共享或向其提供您的信息;\n
5. 您可以查询、更正、删除您的个人信息。" 5. 您可以查询、更正、删除您的个人信息。"
android:textColor="#444444" android:textColor="#444444"
android:textSize="14dp"/> android:textSize="14dp" />
</RelativeLayout> </LinearLayout>
</ScrollView> </ScrollView>
<View
android:background="@drawable/user_secret_dectription_bg" <LinearLayout
android:id="@+id/secret_bottom_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_width="match_parent" android:layout_height="30dp"/> android:layout_marginBottom="185dp"
android:layout_marginLeft="@dimen/platform_dp_25">
</RelativeLayout> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="阅读完整版"
android:textColor="#444444"
android:textSize="14dp" />
<TextView
android:id="@+id/user_use_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="《用户使用协议》"
android:textColor="#159CEF"
android:textSize="14dp" />
<TextView <TextView
android:id="@+id/tv_content" android:layout_width="wrap_content"
android:layout_marginTop="15dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="25dp" android:text="、"
android:layout_marginRight="25dp"
android:text="阅读完整版《用户使用协议》、《隐私保护政策》"
android:textColor="#444444" android:textColor="#444444"
android:textSize="14dp"/> android:textSize="14dp" />
<!--<TextView--> <TextView
<!--android:layout_width="wrap_content"--> android:id="@+id/user_secret_protect_btn"
<!--android:layout_height="wrap_content"--> android:layout_width="wrap_content"
<!--android:text="阅读完整版"--> android:layout_height="wrap_content"
<!--android:textColor="#444444"--> android:text="《隐私保护政策》"
<!--android:textSize="14dp"/>--> android:textColor="#159CEF"
android:textSize="14dp" />
<!--<TextView--> </LinearLayout>
<!--android:id="@+id/user_use_btn"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="《用户使用协议》"-->
<!--android:textColor="#159CEF"-->
<!--android:textSize="14dp"/>-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="、"-->
<!--android:textColor="#444444"-->
<!--android:textSize="14dp"/>-->
<!--<TextView-->
<!--android:id="@+id/user_secret_protect_btn"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="《隐私保护政策》"-->
<!--android:textColor="#159CEF"-->
<!--android:textSize="14dp"/>-->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="24dp"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginLeft="25dp" android:layout_marginLeft="25dp"
android:layout_marginRight="25dp" android:layout_marginRight="25dp"
android:orientation="vertical" android:layout_marginBottom="40dp"
android:orientation="horizontal"
android:background="#ffffff"> android:background="#ffffff">
<TextView <TextView
android:id="@+id/user_secret_agree" android:id="@+id/user_secret_no_agree"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="44dp" android:layout_height="44dp"
android:layout_marginRight="5.5dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/user_secret_right_btn_bg" android:background="@drawable/user_secret_left_btn_bg"
android:gravity="center" android:gravity="center"
android:text="同意并继续" android:text="不同意并退出"
android:textColor="#FFFFFF" android:textColor="#999999"
android:textSize="16dp"/> android:textSize="16dp" />
<TextView <TextView
android:id="@+id/user_secret_no_agree" android:id="@+id/user_secret_agree"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_gravity="center_horizontal" android:layout_height="44dp"
android:layout_height="wrap_content" android:layout_marginLeft="5.5dp"
android:layout_marginTop="10dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/user_secret_right_btn_bg"
android:gravity="center" android:gravity="center"
android:text="仍不同意并退出" android:text="同意并继续"
android:textColor="#999999" android:textColor="#FFFFFF"
android:textSize="16dp"/> android:textSize="16dp" />
</LinearLayout> </LinearLayout>
</LinearLayout>
</LinearLayout> </RelativeLayout>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal">
<TextView
android:id="@+id/sex_and_birth_out"
android:layout_width="68dp"
android:layout_height="60dp"
android:gravity="center"
android:text="退出"
android:textSize="14dp"
android:textColor="#999999"
android:layout_gravity="right"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="欢迎来到壹点灵"
android:textColor="@color/user_main_theme"
android:textStyle="bold"
android:textSize="28dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="请完善信息,以便我们为您提供更好的服务"
android:textSize="16dp"
android:textColor="#999999"
android:layout_marginTop="2dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="您的性别是?"
android:textSize="18dp"
android:textColor="#242424"
android:layout_marginTop="40dp"
android:layout_marginBottom="22dp"
android:textStyle="bold"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<RelativeLayout
android:id="@+id/male_rl"
android:layout_marginRight="25dp"
android:layout_width="97dp"
android:layout_height="116dp"
android:gravity="center"
android:background="@drawable/user_collect_unselect_bg">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal">
<ImageView
android:id="@+id/male_img"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="centerCrop"
android:src="@drawable/user_male_unselected"/>
<TextView
android:id="@+id/male_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="男"
android:textColor="#242424"
android:textSize="18dp"
android:layout_marginTop="13dp"
/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/female_rl"
android:layout_marginLeft="25dp"
android:layout_width="97dp"
android:layout_height="116dp"
android:gravity="center"
android:background="@drawable/user_collect_unselect_bg">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal">
<ImageView
android:id="@+id/female_img"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="centerCrop"
android:src="@drawable/user_female_unselected"/>
<TextView
android:id="@+id/female_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="女"
android:textColor="#242424"
android:textSize="18dp"
android:layout_marginTop="13dp"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="您是哪年出生的?"
android:textSize="18dp"
android:textColor="#242424"
android:layout_marginTop="45dp"
android:textStyle="bold"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginTop="22dp"
android:layout_marginBottom="2dp"
android:gravity="center_horizontal">
<com.yidianling.user.ui.collect.widget.CustomNumberPicker
android:id="@+id/user_collect_date_pick"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</com.yidianling.user.ui.collect.widget.CustomNumberPicker>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#ebebeb"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="64dp"
android:gravity="center_horizontal">
<TextView
android:id="@+id/sex_and_birth_upload_btn"
android:layout_marginLeft="17dp"
android:layout_marginRight="17dp"
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="确定"
android:textSize="17dp"
android:textColor="#ffffff"
android:background="@drawable/user_collect_bottom_btn_un_bg"/>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
<?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="174dp"
android:background="@color/transparent">
<LinearLayout
android:layout_width="295dp"
android:layout_height="133dp"
android:gravity="center_horizontal"
android:layout_centerHorizontal="true"
android:orientation="vertical"
android:layout_marginTop="41dp"
android:background="@drawable/user_complete_dialog_bg">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="提交成功!"
android:textColor="#242424"
android:textSize="18dp"
android:textStyle="bold"
android:layout_marginTop="43dp"/>
<TextView
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="正在前往为您定制的专区…"
android:textColor="#242424"
android:textSize="14dp"/>
</LinearLayout>
<ImageView
android:layout_width="82dp"
android:layout_height="82dp"
android:src="@drawable/collect_success_top_icon"
android:layout_centerHorizontal="true"/>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:myapp="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="34dp"
android:layout_marginRight="34dp"
android:background="@drawable/user_secret_dialog_bg">
<RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content">
<com.ydl.ydlcommon.view.widgets.RoundImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
myapp:pa_borderRadius="12dp"
myapp:pa_type="pa_round"
android:adjustViewBounds="true"
android:src="@drawable/user_secret_top_bg"/>
<RelativeLayout
android:id="@+id/user_top_rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<TextView
android:id="@+id/secrey_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="40dp"
android:text="隐私政策"
android:textColor="#242424"
android:textSize="28dp"
android:textStyle="bold"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/secrey_title"
android:layout_marginLeft="25dp"
android:text="及使用协议说明"
android:textColor="#242424"
android:textSize="28dp"
android:textStyle="bold"/>
</RelativeLayout>
</RelativeLayout>
<RelativeLayout android:layout_width="match_parent" android:layout_height="194dp">
<ScrollView
android:layout_width="match_parent"
android:layout_height="194dp"
android:scrollbars="none"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
>
<TextView
android:id="@+id/user_secret_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:lineHeight="20dp"
tools:text="感谢您信任并使用壹点灵APP,\n
我们深知个人隐私的重要性,为了您更好的使用本APP,希望您着重关注:\n\n1. 为向您提供交易相关基本功能,我们会收集、使用必要的信息;\n
2. 基于您的明示授权,我们可能会获取您的位置(为您提供附近的咨询师等)、设备号信息(以保障您账号与交易安全)等信息,您有权拒绝或取消授权;\n
3. 我们会采业界先进的安全措施保护您的信息安全;\n
4. 未经您同意,我们不会从第三方处获取、共享或向其提供您的信息;\n
5. 您可以查询、更正、删除您的个人信息。"
android:textColor="#444444"
android:textSize="14dp"/>
</RelativeLayout>
</ScrollView>
<View
android:background="@drawable/user_secret_dectription_bg"
android:layout_alignParentBottom="true"
android:layout_width="match_parent" android:layout_height="30dp"/>
</RelativeLayout>
<TextView
android:id="@+id/tv_content"
android:layout_marginTop="15dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:text="阅读完整版《用户使用协议》、《隐私保护政策》"
android:textColor="#444444"
android:textSize="14dp"/>
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="阅读完整版"-->
<!--android:textColor="#444444"-->
<!--android:textSize="14dp"/>-->
<!--<TextView-->
<!--android:id="@+id/user_use_btn"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="《用户使用协议》"-->
<!--android:textColor="#159CEF"-->
<!--android:textSize="14dp"/>-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="、"-->
<!--android:textColor="#444444"-->
<!--android:textSize="14dp"/>-->
<!--<TextView-->
<!--android:id="@+id/user_secret_protect_btn"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="《隐私保护政策》"-->
<!--android:textColor="#159CEF"-->
<!--android:textSize="14dp"/>-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="24dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:orientation="vertical"
android:background="#ffffff">
<TextView
android:id="@+id/user_secret_agree"
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_weight="1"
android:background="@drawable/user_secret_right_btn_bg"
android:gravity="center"
android:text="同意并继续"
android:textColor="#FFFFFF"
android:textSize="16dp"/>
<TextView
android:id="@+id/user_secret_no_agree"
android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:gravity="center"
android:text="仍不同意并退出"
android:textColor="#999999"
android:textSize="16dp"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/user_focus_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="情绪压力"
android:textColor="#242424"
android:textSize="18dp" />
<TextView
android:id="@+id/user_focus_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:ellipsize="end"
android:maxLines="1"
android:text="#焦虑#困惑#失眠多梦#"
android:textColor="#666666"
android:textSize="12dp" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="22dp"/>
<gradient
android:angle="180"
android:startColor="@color/user_main_theme"
android:endColor="@color/user_main_theme"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="22dp"/>
<gradient
android:angle="180"
android:startColor="@color/user_main_theme_66"
android:endColor="@color/user_main_theme_66"/>
</shape>
\ No newline at end of file
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
<resources> <resources>
<!--主题色--> <!--主题色-->
<color name="user_main_theme">#fdbd00</color> <color name="user_main_theme">#fdbd00</color>
<color name="user_main_theme_66">#66fdbd00</color>
<!--主题浅色--> <!--主题浅色-->
<color name="user_main_theme_light">#FFEC8C</color> <color name="user_main_theme_light">#FFEC8C</color>
<!--主题亮色--> <!--主题亮色-->
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="22dp"/>
<gradient
android:angle="180"
android:startColor="#159CEF"
android:endColor="#22BFFF"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="22dp"/>
<gradient
android:angle="180"
android:startColor="#66159CEF"
android:endColor="#6622BFFF"/>
</shape>
\ No newline at end of file
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
<resources> <resources>
<!--主题色--> <!--主题色-->
<color name="user_main_theme">#1da1f2</color> <color name="user_main_theme">#1da1f2</color>
<color name="user_main_theme_66">#661da1f2</color>
<!--主题浅色--> <!--主题浅色-->
<color name="user_main_theme_light">#60BDF5</color> <color name="user_main_theme_light">#60BDF5</color>
<!--主题亮色--> <!--主题亮色-->
......
package com.channel.ydl_flutter_base.plugin package com.channel.ydl_flutter_base.plugin
import android.app.Activity
import android.text.TextUtils import android.text.TextUtils
import com.channel.ydl_flutter_base.base.BaseFlutterFragment import com.channel.ydl_flutter_base.base.BaseFlutterFragment
import com.ydl.burypointlib.BuryPointHelper import com.ydl.burypointlib.BuryPointHelper
...@@ -99,7 +100,17 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler { ...@@ -99,7 +100,17 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
field.isAccessible = true field.isAccessible = true
val property = field.get(ownerClass) val property = field.get(ownerClass)
if (property is Boolean && property) { if (property is Boolean && property) {
BuryPointHelper.showEditDialog(mActivity, MD5Util.md5(clickPath), null) var activity: Activity?= mActivity
if (mActivity==null&&mFragment!=null){
activity = mFragment?.activity!!
}
activity?.let {
BuryPointHelper.showEditDialog(
activity,
MD5Util.md5(clickPath),
null
)
}
} }
} catch (e: Exception) { } catch (e: Exception) {
......
...@@ -2,18 +2,24 @@ package com.ydl.ydlcommon.base ...@@ -2,18 +2,24 @@ package com.ydl.ydlcommon.base
import android.app.Activity import android.app.Activity
import android.content.res.Resources import android.content.res.Resources
import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.support.annotation.LayoutRes import android.support.annotation.LayoutRes
import android.support.v7.app.AppCompatActivity import android.support.v7.app.AppCompatActivity
import android.util.Log import android.util.Log
import android.view.View import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.LinearLayout
import com.trello.rxlifecycle2.android.ActivityEvent import com.trello.rxlifecycle2.android.ActivityEvent
import com.ydl.ydlcommon.R
import com.ydl.ydlcommon.base.lifecycle.IActivityLifecycleable import com.ydl.ydlcommon.base.lifecycle.IActivityLifecycleable
import com.ydl.ydlcommon.bean.StatusBarOptions import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.ui.LoadingDialogFragment import com.ydl.ydlcommon.ui.LoadingDialogFragment
import com.ydl.ydlcommon.utils.ActivityManager import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.AndroidSystemHelper import com.ydl.ydlcommon.utils.AndroidSystemHelper
import com.ydl.ydlcommon.utils.StatusBarUtils import com.ydl.ydlcommon.utils.StatusBarUtils
import com.yidianling.common.tools.RxImageTool
import io.reactivex.subjects.BehaviorSubject import io.reactivex.subjects.BehaviorSubject
import io.reactivex.subjects.Subject import io.reactivex.subjects.Subject
import kotlin.properties.Delegates import kotlin.properties.Delegates
...@@ -24,7 +30,7 @@ import kotlin.properties.Delegates ...@@ -24,7 +30,7 @@ import kotlin.properties.Delegates
* e-mail : zhangwch@yidianling.com * e-mail : zhangwch@yidianling.com
* time : 2018/01/27 * time : 2018/01/27
*/ */
abstract class BaseActivity : AppCompatActivity(),IActivityLifecycleable { abstract class BaseActivity : AppCompatActivity(), IActivityLifecycleable {
private val mLifecycleSubject = BehaviorSubject.create<ActivityEvent>() private val mLifecycleSubject = BehaviorSubject.create<ActivityEvent>()
var mContext: Activity by Delegates.notNull() var mContext: Activity by Delegates.notNull()
...@@ -57,18 +63,48 @@ abstract class BaseActivity : AppCompatActivity(),IActivityLifecycleable { ...@@ -57,18 +63,48 @@ abstract class BaseActivity : AppCompatActivity(),IActivityLifecycleable {
override fun setContentView(@LayoutRes layoutResID: Int) { override fun setContentView(@LayoutRes layoutResID: Int) {
if (getStatusViewOptions()?.isAddStatusView) { if (getStatusViewOptions()?.isAddStatusView) {
val returnViews = StatusBarUtils.initStatusBarView(this, layoutResID, getStatusViewOptions()) val options = getStatusViewOptions()
options.bottomStatusColor = getDefaultBottomColor()
val returnViews =
StatusBarUtils.initStatusBarView(this, layoutResID, getStatusViewOptions())
if(returnViews.size > 1){ if (returnViews.size > 1) {
statusView = returnViews[1]; statusView = returnViews[1];
} }
super.setContentView(returnViews[0]) super.setContentView(returnViews[0])
AndroidSystemHelper.fixAndroidBug5497Workaround(this) AndroidSystemHelper.fixAndroidBug5497Workaround(this)
} else { } else {
//判定是否有底部小横条
if (StatusBarUtils.hasBottomNavigatorLine(this)) {
val containerView =
View.inflate(this, R.layout.platform_layout_bottom_fit_root, null) as ViewGroup
val rootView = containerView.findViewById<FrameLayout>(R.id.ll_bottom_fit_root);
val layoutView = View.inflate(this, layoutResID, null)
val params =
ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
rootView.addView(layoutView, params)
val bottomView = containerView.findViewById<View>(R.id.ll_bottom_fit_v)
bottomView.visibility = View.VISIBLE
bottomView.setBackgroundColor(getDefaultBottomColor())
super.setContentView(containerView)
} else {
super.setContentView(layoutResID) super.setContentView(layoutResID)
} }
} }
}
open fun getDefaultBottomColor(): Int {
return Color.parseColor("#00000000")
}
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
...@@ -88,7 +124,7 @@ abstract class BaseActivity : AppCompatActivity(),IActivityLifecycleable { ...@@ -88,7 +124,7 @@ abstract class BaseActivity : AppCompatActivity(),IActivityLifecycleable {
return AndroidSystemHelper.fixResourcesScale(res) return AndroidSystemHelper.fixResourcesScale(res)
} }
open fun getStatusViewOptions():StatusBarOptions{ open fun getStatusViewOptions(): StatusBarOptions {
return StatusBarOptions() return StatusBarOptions()
} }
......
...@@ -55,7 +55,7 @@ abstract class BaseFragment : Fragment() ,IFragmentLifecycleable{ ...@@ -55,7 +55,7 @@ abstract class BaseFragment : Fragment() ,IFragmentLifecycleable{
layoutResId != 0 -> { layoutResId != 0 -> {
val childView = inflater.inflate(layoutResId, container, false) val childView = inflater.inflate(layoutResId, container, false)
if (getStatusViewOptions().isAddStatusView){ if (getStatusViewOptions().isAddStatusView){
val returnViews = StatusBarUtils.initStatusBarView(activity!!, childView, getStatusViewOptions()) val returnViews = StatusBarUtils.initStatusBarView(activity!!, childView, getStatusViewOptions(), true)
return returnViews[0] return returnViews[0]
}else{ }else{
......
package com.ydl.ydlcommon.bean package com.ydl.ydlcommon.bean
import android.graphics.Color
import android.os.Build import android.os.Build
/** /**
...@@ -20,6 +21,7 @@ class StatusBarOptions { ...@@ -20,6 +21,7 @@ class StatusBarOptions {
return "#1da1f2" return "#1da1f2"
} }
} }
var bottomStatusColor: Int = Color.parseColor("#00000000") //底部颜色默认透明色,个别页面自己设置即可
constructor(isAddStatusView: Boolean = false, statusBarDarkMode: Boolean= false) { constructor(isAddStatusView: Boolean = false, statusBarDarkMode: Boolean= false) {
this.isAddStatusView = isAddStatusView this.isAddStatusView = isAddStatusView
......
...@@ -15,6 +15,7 @@ import android.support.v4.widget.DrawerLayout ...@@ -15,6 +15,7 @@ import android.support.v4.widget.DrawerLayout
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.WindowManager import android.view.WindowManager
import android.widget.FrameLayout
import android.widget.LinearLayout import android.widget.LinearLayout
import com.ydl.ydlcommon.R import com.ydl.ydlcommon.R
import com.ydl.ydlcommon.bean.StatusBarOptions import com.ydl.ydlcommon.bean.StatusBarOptions
...@@ -997,25 +998,38 @@ class StatusBarUtils { ...@@ -997,25 +998,38 @@ class StatusBarUtils {
return initStatusBarView( return initStatusBarView(
context, context,
child, child,
statusBarOptions statusBarOptions,
false
) )
} }
fun initStatusBarView( fun initStatusBarView(
context: Activity,child:View, context: Activity,
statusBarOptions: StatusBarOptions child:View,
statusBarOptions: StatusBarOptions,
isFragment: Boolean = false
): Array<View> { ): Array<View> {
var returnView = arrayOfNulls<View>(2) var returnView = arrayOfNulls<View>(2)
val containerView = View.inflate(context, R.layout.platform_layout_root, null) as ViewGroup val containerView = View.inflate(context, R.layout.platform_layout_root, null) as ViewGroup
val rootView = containerView.findViewById<LinearLayout>(R.id.ll_root); val rootView = containerView.findViewById<FrameLayout>(R.id.ll_root)
val statusView = val statusView =
initStatus(context, rootView, statusBarOptions); initStatus(context, containerView, statusBarOptions)
val params = val params =
ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
rootView.addView(child, params) rootView.addView(child, params)
if (!isFragment && hasBottomNavigatorLine(context)) {
val bottomView = containerView.findViewById<View>(R.id.ll_bottom_v)
bottomView.visibility = View.VISIBLE
bottomView.setBackgroundColor(statusBarOptions.bottomStatusColor)
}
returnView[0] = containerView returnView[0] = containerView
if (statusView != null){ if (statusView != null){
...@@ -1025,21 +1039,39 @@ class StatusBarUtils { ...@@ -1025,21 +1039,39 @@ class StatusBarUtils {
return returnView as Array<View> return returnView as Array<View>
} }
/**
* 判定是否含有底部小横条,当底部导航高度像素小于50时,认为是有小横条
*/
fun hasBottomNavigatorLine(context: Context): Boolean {
return try {
val clazz = Class.forName("com.android.internal.R\$dimen")
val `object` = clazz.newInstance()
val heightStr = clazz.getField("navigation_bar_height").get(`object`).toString()
val height = Integer.parseInt(heightStr)
val bottomNavigatorHeight = context.resources.getDimensionPixelSize(height)
bottomNavigatorHeight < 50
} catch (e: Exception) {
false
}
}
fun initStatus( fun initStatus(
context: Activity, context: Activity,
rootView: View, containerView: View,
statusBarOptions: StatusBarOptions statusBarOptions: StatusBarOptions
):View? { ):View? {
var statusView:View ?=null var statusView:View ?=null
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
statusView = rootView.findViewById<View>(R.id.view_status_place_holder) statusView = containerView.findViewById<View>(R.id.view_status_place_holder)
statusView?.setBackgroundColor(Color.parseColor(statusBarOptions.statusColor)) statusView?.setBackgroundColor(Color.parseColor(statusBarOptions.statusColor))
val statusBarHeight = val statusBarHeight =
getStatusBarHeight(context) getStatusBarHeight(context)
statusView?.let {
val layoutParams = statusView?.getLayoutParams() as LinearLayout.LayoutParams val layoutParams = statusView?.getLayoutParams() as LinearLayout.LayoutParams
layoutParams.height = statusBarHeight layoutParams.height = statusBarHeight
statusView?.layoutParams = layoutParams statusView?.layoutParams = layoutParams
}
setTransparentForImageView(context, null) setTransparentForImageView(context, null)
} }
if (statusBarOptions.statusBarDarkMode) { if (statusBarOptions.statusBarDarkMode) {
......
...@@ -4,6 +4,7 @@ import android.app.Dialog ...@@ -4,6 +4,7 @@ import android.app.Dialog
import android.content.Context import android.content.Context
import android.os.Bundle import android.os.Bundle
import android.view.Gravity import android.view.Gravity
import android.view.View
import android.view.WindowManager import android.view.WindowManager
import com.ydl.ydlcommon.R import com.ydl.ydlcommon.R
import com.ydl.ydlcommon.router.YdlCommonOut import com.ydl.ydlcommon.router.YdlCommonOut
...@@ -14,6 +15,7 @@ class YDLCommonDialog: Dialog { ...@@ -14,6 +15,7 @@ class YDLCommonDialog: Dialog {
private var mContext: Context? = null private var mContext: Context? = null
private var mListener: OnYDLCommonDialogListener? = null private var mListener: OnYDLCommonDialogListener? = null
private var hasTitle = true // 默认为有标题弹窗
private var mTitle: String = "" private var mTitle: String = ""
private var mDesc: String = "" private var mDesc: String = ""
private var mLeftText: String = "" private var mLeftText: String = ""
...@@ -35,8 +37,18 @@ class YDLCommonDialog: Dialog { ...@@ -35,8 +37,18 @@ class YDLCommonDialog: Dialog {
window.setGravity(Gravity.CENTER) window.setGravity(Gravity.CENTER)
window.attributes = params window.attributes = params
if (hasTitle) {
ydl_common_dialog_title.visibility = View.VISIBLE
ydl_common_dialog_desc.visibility = View.VISIBLE
ydl_common_dialog_title.text = mTitle ydl_common_dialog_title.text = mTitle
ydl_common_dialog_desc.text = mDesc ydl_common_dialog_desc.text = mDesc
ydl_common_dialog_null_title_desc.visibility = View.GONE
}else {
ydl_common_dialog_title.visibility = View.GONE
ydl_common_dialog_desc.visibility = View.GONE
ydl_common_dialog_null_title_desc.visibility = View.VISIBLE
ydl_common_dialog_null_title_desc.text = mDesc
}
ydl_common_dialog_cancel.text = mLeftText ydl_common_dialog_cancel.text = mLeftText
ydl_common_dialog_sure.text = mRightText ydl_common_dialog_sure.text = mRightText
...@@ -73,6 +85,15 @@ class YDLCommonDialog: Dialog { ...@@ -73,6 +85,15 @@ class YDLCommonDialog: Dialog {
} }
/** /**
* 设置无标题弹窗描述
*/
fun setNullTitleDesc(desc: String): YDLCommonDialog {
hasTitle = false
mDesc = desc
return this
}
/**
* 左侧按钮 * 左侧按钮
*/ */
fun setCancelText(cancelText: String): YDLCommonDialog { fun setCancelText(cancelText: String): YDLCommonDialog {
......
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
android:shape="rectangle"> android:shape="rectangle">
<gradient <gradient
android:endColor="#fdbd00" android:angle="0"
android:startColor="#FFEC8C"/> android:startColor="#fdbd00"
android:endColor="#fdbd00"/>
<corners android:bottomRightRadius="8dp" /> <corners android:bottomRightRadius="8dp" />
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
android:shape="rectangle"> android:shape="rectangle">
<gradient <gradient
android:angle="180"
android:endColor="#1DA1F2" android:endColor="#1DA1F2"
android:startColor="#23B2FA"/> android:startColor="#23B2FA"/>
......
<?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"
android:orientation="vertical">
<FrameLayout
android:id="@+id/ll_bottom_fit_root"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
</FrameLayout>
<View
android:id="@+id/ll_bottom_fit_v"
android:layout_width="match_parent"
android:layout_height="10dp"
android:visibility="gone">
</View>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_root"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
...@@ -11,4 +10,19 @@ ...@@ -11,4 +10,19 @@
android:background="@color/platform_white" android:background="@color/platform_white"
android:layout_height="0dp"/> android:layout_height="0dp"/>
<FrameLayout
android:id="@+id/ll_root"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
</FrameLayout>
<View
android:id="@+id/ll_bottom_v"
android:layout_width="match_parent"
android:layout_height="10dp"
android:visibility="gone">
</View>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -39,6 +39,20 @@ ...@@ -39,6 +39,20 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginBottom="34dp"/> android:layout_marginBottom="34dp"/>
<TextView
android:id="@+id/ydl_common_dialog_null_title_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="确定要退出吗?
很多人在这里得到了帮助哦~"
android:layout_marginLeft="44dp"
android:layout_marginRight="44dp"
android:textSize="16dp"
android:gravity="center"
android:textColor="#242424"
android:layout_marginTop="30dp"
android:layout_marginBottom="24dp"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="44dp" android:layout_height="44dp"
......
...@@ -14,6 +14,13 @@ class H5Params : Serializable { ...@@ -14,6 +14,13 @@ class H5Params : Serializable {
this.title = title this.title = title
} }
constructor(url: String, backLimit: BackLimit, hasBackLimit: Boolean): super() {
this.url =url
if (hasBackLimit) {
this.backLimit = backLimit
}
}
constructor(url: String, title: String?, share: ShareData?) : super() { constructor(url: String, title: String?, share: ShareData?) : super() {
this.url = url this.url = url
this.shareData = share this.shareData = share
...@@ -60,4 +67,13 @@ class H5Params : Serializable { ...@@ -60,4 +67,13 @@ class H5Params : Serializable {
* 倾诉拨打电话 * 倾诉拨打电话
*/ */
var phone: String? = null var phone: String? = null
/**
* h5页面返回按钮限制
*/
var backLimit: BackLimit? = null
enum class BackLimit {
NEW_USER_PAGE // 新用户引导页面
}
} }
\ No newline at end of file
...@@ -40,7 +40,9 @@ import com.ydl.ydlcommon.base.BaseActivity; ...@@ -40,7 +40,9 @@ import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.BaseApp; import com.ydl.ydlcommon.base.BaseApp;
import com.ydl.ydlcommon.base.config.YDLConstants; import com.ydl.ydlcommon.base.config.YDLConstants;
import com.ydl.ydlcommon.bean.StatusBarOptions; import com.ydl.ydlcommon.bean.StatusBarOptions;
import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.ydl.ydlcommon.ui.LogoLoadingView; import com.ydl.ydlcommon.ui.LogoLoadingView;
import com.ydl.ydlcommon.utils.ActivityManager;
import com.ydl.ydlcommon.utils.BuryPointUtils; import com.ydl.ydlcommon.utils.BuryPointUtils;
import com.ydl.ydlcommon.utils.LogUtil; import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.NetWorkSpeedUtils; import com.ydl.ydlcommon.utils.NetWorkSpeedUtils;
...@@ -55,6 +57,7 @@ import com.yidianling.common.tools.RxImageTool; ...@@ -55,6 +57,7 @@ import com.yidianling.common.tools.RxImageTool;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.user.api.event.UserBindPhoneEvent; import com.yidianling.user.api.event.UserBindPhoneEvent;
import com.yidianling.user.api.event.UserLoginEvent; import com.yidianling.user.api.event.UserLoginEvent;
import com.yidianling.user.api.service.IAppService;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
...@@ -619,7 +622,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -619,7 +622,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
WebModularServiceUtils.Companion.startMain(NewH5Activity.this); WebModularServiceUtils.Companion.startMain(NewH5Activity.this);
finish(); finish();
} else { }
else {
if (ActivityManager.Companion.getInstance().getActivitys().size() == 1) {
WebModularServiceUtils.Companion.startMain(NewH5Activity.this);
}
finish(); finish();
} }
}); });
...@@ -812,7 +819,8 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -812,7 +819,8 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
tb_title.setImageListener(v -> { tb_title.setImageListener(v -> {
if (wv_content.canGoBack()) { if (wv_content.canGoBack()) {
wv_content.goBack(); wv_content.goBack();
} else { }
else {
finish(); finish();
} }
}); });
...@@ -826,7 +834,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -826,7 +834,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
if (h5Params.getShowUrlTitle()) { if (h5Params.getShowUrlTitle()) {
WebModularServiceUtils.Companion.startMain(NewH5Activity.this); WebModularServiceUtils.Companion.startMain(NewH5Activity.this);
finish(); finish();
} else { }
else {
if (ActivityManager.Companion.getInstance().getActivitys().size() == 1) {
WebModularServiceUtils.Companion.startMain(NewH5Activity.this);
}
finish(); finish();
} }
}); });
...@@ -1099,7 +1111,9 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -1099,7 +1111,9 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
tb_title.setLeftTextVisible(VISIBLE); tb_title.setLeftTextVisible(VISIBLE);
if ("top".equals(type)) { if ("top".equals(type)) {
setTitle(wv_content.getTitle()); setTitle(wv_content.getTitle());
tb_title.setImageListener(v -> wv_content.goBack()); tb_title.setImageListener(v ->
wv_content.goBack()
);
} else { } else {
wv_content.goBack(); wv_content.goBack();
} }
...@@ -1115,7 +1129,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -1115,7 +1129,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
if (h5Params.isSplash()) { if (h5Params.isSplash()) {
WebModularServiceUtils.Companion.startMain(NewH5Activity.this); WebModularServiceUtils.Companion.startMain(NewH5Activity.this);
finish(); finish();
} else { }
else {
if (ActivityManager.Companion.getInstance().getActivitys().size() == 1) {
WebModularServiceUtils.Companion.startMain(NewH5Activity.this);
}
finish(); finish();
} }
}); });
...@@ -1246,12 +1264,20 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -1246,12 +1264,20 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
} }
/** /**
* 新用户侧滑按钮限制
*/
if (h5Params.getBackLimit() != null && h5Params.getBackLimit() == H5Params.BackLimit.NEW_USER_PAGE) {
return true;
}
/**
* 增加逻辑:在高级题测试页面,按物理返回键直接finish当前页面,不走webview.goback()逻辑 * 增加逻辑:在高级题测试页面,按物理返回键直接finish当前页面,不走webview.goback()逻辑
*/ */
if (h5Params.isControlBack()) { if (h5Params.isControlBack()) {
finish(); finish();
} }
back("key"); back("key");
return true; return true;
} }
return super.onKeyDown(keyCode, event); return super.onKeyDown(keyCode, event);
......
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