Commit 48552ba6 by konghaorui

Merge branch 'dev' into feature/组件化_ending

# Conflicts:
#	app/src/main/java/com/ydl/component/MainActivity.kt
#	config.gradle
#	m-im/src/main/java/com/yidianling/uikit/business/session/view/ImCommentBannerView.kt
#	m-im/src/main/res_uikit/layout/im_ydl_nim_message_fragment.xml
#	m-user/src/main/AndroidManifest.xml
#	m-user/src/main/java/com/yidianling/user/http/UserApi.kt
#	m-user/src/main/java/com/yidianling/user/http/UserHttp.kt
#	m-user/src/main/java/com/yidianling/user/http/UserHttpImpl.kt
#	m-user/src/main/java/com/yidianling/user/ui/SmsLoginActivity.kt
#	m-user/src/main/java/com/yidianling/user/ui/login/presenter/InputPassWordPresenterImpl.kt
#	m-user/src/main/java/com/yidianling/user/ui/login/presenter/LoginPresenterImpl.kt
#	m-user/src/main/java/com/yidianling/user/ui/login/presenter/VerificationCodePresenterImpl.kt
#	m-user/src/main/res/layout/user_activity_secret.xml
#	m-user/src/main/res/layout/user_dialog_secret.xml
#	m-user/src/xlzx/res/values/colors.xml
#	m-user/src/ydl/res/values/colors.xml
#	ydl-flutter-base/src/main/java/com/channel/ydl_flutter_base/plugin/YDLCommonPlugin.kt
#	ydl-platform/src/main/res/drawable/platform_ydl_common_dialog_sure_btn_ydl_bg.xml
parents 903a8813 1430860e
......@@ -183,11 +183,11 @@ dependencies {
api project(':m-tests')
api project(':m-consultant')
implementation modularPublication('com.ydl:m-consultant-api')
// implementation project(':m-confide')
implementation project(':m-confide')
api project(':m-home')
api project(':m-confide')
// api project(':m-confide')
// api "com.ydl:m-consultant-api:0.0.2"
// api 'com.ydl:m-consultant-module-ydl:0.0.18@aar'
......
package com.ydl.component
//import com.ydl.confide.home.ConfideHomeActivity
//import com.yidianling.consultant.ExpertSearchActivity.Companion.HOT_SEARCH_DOCTOR_NAME
import android.Manifest
import android.annotation.SuppressLint
import android.content.ComponentName
......@@ -10,28 +8,33 @@ import android.content.Intent
import android.content.ServiceConnection
import android.net.Uri
import android.os.IBinder
import android.os.Process
import android.provider.Settings
import android.util.Log
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.tbruyelle.rxpermissions2.RxPermissions
import com.umeng.analytics.MobclickAgent
import com.ydl.audioim.YDLavManager
import com.ydl.component.music.FragmentContainerActivity
import com.ydl.component.mvp.DemoContract
import com.ydl.component.mvp.DemoPresenter
import com.ydl.confide.home.ConfideHomeActivity
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.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.consultant.api.IConsultantService
import com.yidianling.fm.api.service.IFMService
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.OnSecretDialogListener
import kotlinx.android.synthetic.main.activity_main.*
import com.ydl.ydlcommon.utils.ResUtil.getResources
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 .
......@@ -40,8 +43,9 @@ import kotlinx.android.synthetic.main.activity_main.*
@Route(path = "/main/main")
class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(),
DemoContract.View {
private var secretDescriptionDialog: SecretDescriptionDialog? = null
private var serviceConnection: ServiceConnection? = null
private var secretDialog: SecretDialog? = null
protected var playService: PlayService? = null
override fun getContentViewId(): Int {
......@@ -105,18 +109,37 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
FragmentContainerActivity.start(this, "TrendsHomeFragment")
}
bt_to_tests.setOnClickListener {
// startActivity(Intent(this, NewTestHomeActivity::class.java))
FragmentContainerActivity.start(this, "NewTestHomeFragment")
// 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 {
// YDLavManager.instances.login("1193016")
startActivity(Intent(this, ConfideHomeActivity::class.java))
// YDLavManager.instances.login("1193016")
// startActivity(Intent(this, ConfideHomeActivity::class.java))
}
bt_to_muse.setOnClickListener {
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MUSE_CENTER,
YDLRouterParams().putExtra
("url", "http://video.yidianling.com/2019/05/30/746851e2f335baf5f44499f4fb49d3a9.mp3"))
// YDLRouterManager.router(IYDLRouterConstant.ROUTER_MUSE_CENTER,
// YDLRouterParams().putExtra
// ("url", "http://video.yidianling.com/2019/05/30/746851e2f335baf5f44499f4fb49d3a9.mp3"))
// YDLRouterManager.router(
// IYDLRouterConstant.ROUTER_MUSE,
......@@ -163,29 +186,33 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
}
bt_to_privacy.setOnClickListener {
val dialog = SecretDescriptionDialog(this@MainActivity, "感谢您信任并使用壹点灵旗下的APP,\\n\n" +
"我们深知个人隐私的重要性,为了您更好的使用本APP,希望您着重关注:\\n\\n1. 为向您提供交易相关基本功能,我们会收集、使用必要的信息;\\n\n" +
"2. 基于您的明示授权,我们可能会获取您的位置(为您提供附近的咨询师等)、设备号信息(以保障您账号与交易安全)等信息,您有权拒绝或取消授权;\\n\n" +
"3. 我们会采业界先进的安全措施保护您的信息安全;\\n\n" +
"4. 未经您同意,我们不会从第三方处获取、共享或向其提供您的信息;\\n\n" +
"5. 您可以查询、更正、删除您的个人信息。", object : SecretDescriptionDialog.OnSecretDescriptionDialogListener {
override fun onCancel() {
val secretDialog = SecretDialog(this@MainActivity, object : SecretDialog.OnSecretDialogListener {
override fun onCancel() {
ToastUtil.toastShort("onCancel")
}
override fun onSure() {
ToastUtil.toastShort("nextStep")
}
})
secretDialog?.show()
}
override fun onSure() {
ToastUtil.toastShort("nextStep")
val dialog = SecretDescriptionDialog(this@MainActivity,
"感谢您信任并使用壹点灵旗下APP,\\n\n" +
"我们深知个人隐私的重要性,为了您更好的使用本APP,希望您着重关注:\\n\\n1. 为向您提供交易相关基本功能,我们会收集、使用必要的信息;\\n\n" +
"2. 基于您的明示授权,我们可能会获取您的位置(为您提供附近的咨询师等)、设备号信息(以保障您账号与交易安全)等信息,您有权拒绝或取消授权;\\n\n" +
"3. 我们会采业界先进的安全措施保护您的信息安全;\\n\n" +
"4. 未经您同意,我们不会从第三方处获取、共享或向其提供您的信息;\\n\n" +
"5. 您可以查询、更正、删除您的个人信息。",
object : SecretDescriptionDialog.OnSecretDescriptionDialogListener {
override fun onCancel() {
val secretDialog = SecretDialog(
this@MainActivity,
object : SecretDialog.OnSecretDialogListener {
override fun onCancel() {
ToastUtil.toastShort("onCancel")
}
override fun onSure() {
ToastUtil.toastShort("nextStep")
}
})
secretDialog?.show()
}
override fun onSure() {
ToastUtil.toastShort("nextStep")
}
}
}
)
dialog.show()
}
......@@ -233,14 +260,15 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
super.onResume()
MobclickAgent.onResume(this)
ModularServiceManager.provide(IConsultantService::class.java)
.showConsultAssistantDialog(this)
// ModularServiceManager.provide(IConsultantService::class.java)
// .
// (this)
}
override fun onPause() {
super.onPause()
ModularServiceManager.provide(IConsultantService::class.java).hideConsultAssistantDialog()
// ModularServiceManager.provide(IConsultantService::class.java).hideConsultAssistantDialog()
}
......@@ -261,4 +289,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()
}
}
......@@ -8,6 +8,7 @@ import com.ydl.component.mvp.DemoPresenter
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.yidianling.consultant.ExpertSearchFragment
//import com.yidianling.consultant.ExpertSearchFragment
import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
import com.yidianling.home.ui.fragment.YdlHomeFragment
//import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
......
......@@ -184,6 +184,15 @@
android:layout_weight="1"
android:layout_marginRight="10dp"
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
android:layout_width="match_parent"
......
......@@ -43,16 +43,16 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.48.8",
"m-consultant" : "0.0.58.3",
"m-fm" : "0.0.29.2",
"m-user" : "0.0.59.21",
"m-consultant" : "0.0.58.4",
"m-fm" : "0.0.29.3",
"m-user" : "0.0.60.1",
"m-home" : "0.0.20.3",
"m-im" : "0.0.16.7",
"m-dynamic" : "0.0.7.4",
"m-im" : "0.0.17.0",
"m-dynamic" : "0.0.7.5",
"m-muse" : "0.0.28.8",
"m-tests" : "0.0.23.11",
"m-course" : "0.0.41.10",
"m-muse" : "0.0.28.9",
"m-tests" : "0.0.24.0",
"m-course" : "0.0.42.0",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
......@@ -72,10 +72,10 @@ ext {
"ydl-platform" : "0.0.39.17",
//第二步 若干
"ydl-webview" : "0.0.38.13",
"ydl-webview" : "0.0.38.24",
"ydl-media" : "0.0.21.3",
"ydl-pay" : "0.0.18.6",
"m-audioim" : "0.0.48.0",
"m-audioim" : "0.0.48.2.7",
"ydl-flutter-base": "0.0.14.4",
//以下 几乎不会动
......@@ -115,14 +115,14 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.39.9",
"ydl-platform" : "0.0.39.16",
//第二步 若干
"ydl-webview" : "0.0.38.12",
"ydl-webview" : "0.0.38.24",
"ydl-media" : "0.0.21.3",
"ydl-pay" : "0.0.18.6",
"m-audioim" : "0.0.48.0",
"ydl-flutter-base": "0.0.10.8",
"m-audioim" : "0.0.48.2.7",
"ydl-flutter-base": "0.0.10.9",
//以下 几乎不会动
"router" : "0.0.1",
......@@ -287,6 +287,7 @@ ext {
"ydl-m-muse-api" : "com.ydl:m-muse-api:${ydlCompileVersion["m-muse-api"]}",
"ydl-m-fm-api" : "com.ydl:m-fm-api:${ydlCompileVersion["m-fm-api"]}",
"ydl-m-tests-api" : "com.ydl:m-tests-api:${ydlCompileVersion["m-tests-api"]}",
"ydl-m-audioim-api" : "com.ydl:m-audioim-api:${ydlCompileVersion["m-audioim-api"]}",
"ydl-m-im-api" : "com.ydl:m-im-api:${ydlCompileVersion["m-im-api"]}",
"ydl-m-home-api" : "com.ydl:m-home-api:${ydlCompileVersion["m-home-api"]}",
"ydl-m-consultant-api" : "com.ydl:m-consultant-api:${ydlCompileVersion["m-consultant-api"]}",
......
......@@ -9,7 +9,7 @@
# Specifies the JVM arguments used for the daemon process.
# 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.
# This option should only be used with decoupled projects. More details, visit
......
......@@ -75,7 +75,7 @@ dependencies {
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api "com.alibaba:arouter-api:$arouter_api"
api ('com.ydl:ydl-av:1.1.9@aar'){
api ('com.ydl:ydl-av:1.2.1@aar'){
transitive = true
}
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ydl.audioim" >
package="com.ydl.audioim">
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.VIBRATE"/>
<application>
<activity
android:name=".AudioHomeActivity"
android:screenOrientation="portrait" />
android:name=".AudioHomeActivity"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
android:screenOrientation="portrait"/>
</application>
</manifest>
package com.ydl.audioim.presenter
import android.annotation.SuppressLint
import com.ydl.audioim.BuildConfig
import com.ydl.ydl_av.chat.config.YDLChatParam
import com.ydl.audioim.contract.IAudioHomeActivityContract
......@@ -65,6 +66,7 @@ class AudioHomePresenterImpl : BasePresenter<IAudioHomeActivityContract.View, IA
// })
// }
@SuppressLint("CheckResult")
override fun connectException(param: ConnectExceptionCommand) {
mModel.connectException(param)
.subscribeOn(Schedulers.io())
......@@ -106,6 +108,7 @@ class AudioHomePresenterImpl : BasePresenter<IAudioHomeActivityContract.View, IA
/**
* 获取axb电话
*/
@SuppressLint("CheckResult")
override fun getAXBPhone(cmd: ConnectCommand) {
mModel.getAXBPhone(cmd)
.subscribeOn(Schedulers.io())
......@@ -113,7 +116,7 @@ class AudioHomePresenterImpl : BasePresenter<IAudioHomeActivityContract.View, IA
.doOnSubscribe { mView.showProgressView() }
.doAfterTerminate { mView.dismissProgressView() }
.subscribe({
if ("200".equals(it.code)){
if ("200" == it.code){
if(0==it.data?.dialDetail?.dialStatus?:-1){
//连接成功
if(it.data?.dialDetail?.callConnectType?:-1==1){
......
......@@ -68,7 +68,7 @@ class DynamicConstants {
open var TOPIC_DETAIL_H5 = HttpConfig.H5_URL+ "active/topic-members/"
open var TRENF_INFO_SHARE_H5 = HttpConfig.H5_URL + "ask/"
open var TRENF_INFO_SHARE_H5 = HttpConfig.MH5_URL + "ask/"
const val PUBLISH_TYPE = "publish_type"
......
......@@ -320,7 +320,7 @@ public class BrowsePicturesActivity extends BaseActivity implements ViewPager.On
Uri uri = FileUtils.INSTANCE.getUriByPath(container.getContext(), mImages.get(position).getImage_url());
GlideApp.with(mContext)
.load(uri)
.load(mImages.get(position).getImage_url())
.error(R.drawable.dynamic_default_img)
.into(mDatas.get(position));
mDatas.get(position).setOnPhotoTapListener((imageView, v, v1) -> finish());
......
......@@ -18,7 +18,8 @@ import com.yidianling.uikit.custom.http.response.UserQuestInfoBean
* @Company 壹点灵
* @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 isFromBack = true
......@@ -30,6 +31,9 @@ class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListe
listener.sendMsg("", ArrayList())
isFromBack = false
dismiss()
}, {
dismiss()
listener.finishPage()
}, { _content, _list ->
listener.sendMsg(_content, _list)
isFromBack = false
......@@ -49,12 +53,12 @@ class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListe
isOutsideTouchable = false
}
fun setData(list: List<UserQuestInfoBean>) {
fun setData(list: List<UserQuestInfoBean>, hasCompleteInfoList: List<UserQuestInfoBean>?) {
if (list.isEmpty()) {
ToastUtil.toastShort("数据异常,请稍后重试")
return
}
collectUserInformationView.setData(list)
collectUserInformationView.setData(list, hasCompleteInfoList)
}
......@@ -78,6 +82,8 @@ class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListe
interface OnSendMsgListener {
fun sendMsg(content: String, result: List<UserQuestInfoBean>)
fun finishPage()
}
}
\ No newline at end of file
......@@ -207,7 +207,7 @@ class ImCommentBannerView : LinearLayout {
//获取经过加密的名字 : 徐**
private fun getName(name: String?): String {
var nameBuffer = StringBuffer()
if (name!=null&&!TextUtils.isEmpty(name)){
if (name != null && !TextUtils.isEmpty(name)) {
nameBuffer.append(name[0])
}
nameBuffer.append("**:")
......
......@@ -3,7 +3,6 @@ package com.yidianling.uikit.custom.http
import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.uikit.custom.http.response.*
import io.reactivex.Observable
import okhttp3.RequestBody
......@@ -12,7 +11,7 @@ import retrofit2.http.*
/**
* Created by xj on 2019/6/26.
*/
interface ServiceApi{
interface ServiceApi {
//获取专家状态信息
@GET("chat/status")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
......@@ -27,7 +26,11 @@ interface ServiceApi{
//获取推荐专家列表信息
@GET("doctor/recommendSimilarListeners")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getRecommendExpertList(@Query("doctorUid") doctorUid: Long, @Query("catName") catName: String, @Query("limit") limit: Int): Observable<BaseAPIResponse<ArrayList<RecommendExpertBean>>>
fun getRecommendExpertList(
@Query("doctorUid") doctorUid: Long, @Query("catName") catName: String, @Query(
"limit"
) limit: Int
): Observable<BaseAPIResponse<ArrayList<RecommendExpertBean>>>
//获取常用语
@POST("phrase/list")
......@@ -45,6 +48,12 @@ interface ServiceApi{
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
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")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
......@@ -64,4 +73,12 @@ interface ServiceApi{
@GET("systemconfig/get-chat-view-config")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getChatViewConfig(): Observable<BaseAPIResponse<SystemInfoBean>>
//获取代运营关联的专家的信息
@GET("chat/get-source-doctor")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
//注意:这个接口返回的还有很多字段,但是暂时不需要,就先取这两个字段
fun getSourceDoctor(@Query("scene") scene: Int,@Query("userUid") userUid: String,@Query("assistantUid") assistantUid: String): Observable<BaseAPIResponse<SourceDoctorInfoBean>>
}
\ No newline at end of file
......@@ -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>> {
......@@ -94,4 +101,13 @@ class ServiceImpl private constructor() {
fun getChatViewConfig(): Observable<BaseAPIResponse<SystemInfoBean>> {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).getChatViewConfig()
}
/**
* 获取代运营关联的专家的信息
*/
fun getSourceDoctor(userUid: String, assistantUid: String): Observable<BaseAPIResponse<SourceDoctorInfoBean>> {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).getSourceDoctor(1, userUid, assistantUid)
}
}
\ No newline at end of file
package com.yidianling.uikit.custom.http.response;
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2020/2/21
*/
public class SourceDoctorInfoBean {
//注意:这个接口返回的还有很多字段,但是暂时不需要,就先取这两个字段
public String name;//专家name
public String uid;//专家uid
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:exitFadeDuration="@android:integer/config_shortAnimTime">
<corners
android:bottomRightRadius="17dp"
android:topRightRadius="17dp" />
<solid android:color="@color/white" />
</shape>
\ No newline at end of file
......@@ -219,8 +219,7 @@
android:orientation="horizontal"
android:paddingLeft="5dp"
android:paddingRight="10dp"
android:visibility="gone"
>
android:visibility="gone">
<TextView
android:id="@+id/im_focus_btn"
......@@ -257,10 +256,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="1dp"
android:lines="1"
android:textColor="@color/platform_main_theme"
android:textSize="12dp"
android:layout_marginBottom="1dp"
android:text="(" />
<TextView
......@@ -403,9 +402,7 @@
android:id="@+id/rl_contain"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout_height="50dp">
</RelativeLayout>
tools:layout_height="50dp" />
<android.support.v7.widget.RecyclerView
android:id="@+id/messageListView"
......@@ -430,37 +427,6 @@
android:layout_marginTop="14dp"
android:visibility="visible">
<!-- <RelativeLayout-->
<!-- android:id="@+id/rela_qingsu"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="36dp"-->
<!-- android:background="@drawable/im_bg_im_confide_action"-->
<!-- android:gravity="center"-->
<!-- android:paddingLeft="14dp"-->
<!-- android:paddingRight="17dp">-->
<!-- <ImageView-->
<!-- android:id="@+id/action_qingshu_img"-->
<!-- android:layout_width="12dp"-->
<!-- android:layout_height="12dp"-->
<!-- android:layout_centerVertical="true"-->
<!-- android:src="@mipmap/im_chat_ico_call" />-->
<!-- <TextView-->
<!-- android:id="@+id/action_qingshu"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_toRightOf="@+id/action_qingshu_img"-->
<!-- android:gravity="center"-->
<!-- android:paddingLeft="5dp"-->
<!-- android:text="即时倾诉"-->
<!-- android:textColor="@color/platform_main_theme"-->
<!-- android:textSize="12dp"-->
<!-- android:textStyle="bold" />-->
<!-- </RelativeLayout>-->
<RelativeLayout
android:id="@+id/rela_zixun"
android:layout_width="wrap_content"
......@@ -485,6 +451,56 @@
</RelativeLayout>
<!--和助理聊天时,显示关联的咨询师的信息-->
<RelativeLayout
android:id="@+id/rl_doctor_name"
android:layout_width="wrap_content"
android:layout_height="34dp"
android:layout_marginTop="15dp"
android:gravity="center_vertical"
android:visibility="gone"
tools:visibility="visible">
<LinearLayout
android:id="@+id/ll_info_detail"
android:layout_width="wrap_content"
android:layout_height="34dp"
android:layout_toRightOf="@+id/view_empty"
android:background="@drawable/im_background_chat_assistant_to_doctor_name"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingRight="12dp">
<TextView
android:id="@+id/tv_from"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingRight="3dp"
android:text="来自"
android:textColor="@color/platform_color_242424"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_doctor_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:textColor="@color/im_main_theme"
android:textSize="12sp"
tools:text="雷水寿" />
</LinearLayout>
<View
android:id="@+id/view_empty"
android:layout_width="12dp"
android:layout_height="34dp"
android:background="@color/white" />
</RelativeLayout>
</RelativeLayout>
......
......@@ -193,6 +193,16 @@
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"
android:theme="@style/platform_NoTitleTheme"/>
<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>
</manifest>
\ No newline at end of file
package com.yidianling.user
import android.app.Activity
import android.content.Context
import android.content.Intent
import com.tencent.bugly.crashreport.CrashReport
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.BuryPointUtils
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.IMRequestCallback
import com.yidianling.user.api.bean.UserResponseBean
......@@ -12,6 +17,14 @@ import com.yidianling.user.api.event.UserLogoutEvent
import com.yidianling.user.http.UserHttpImpl
import com.yidianling.user.http.request.Logout
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 io.reactivex.android.schedulers.AndroidSchedulers
......@@ -84,5 +97,46 @@ object LoginUtils {
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 {
//登录主页浏览事件(不包含随便逛逛)
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
......
......@@ -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.BaseResponse
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.CollectFocusItemBean
import com.yidianling.user.http.response.*
import com.yidianling.user.mine.bean.RedPackDataForRegister
import com.yidianling.user.mine.bean.RedPacketId
......@@ -184,4 +185,20 @@ interface UserApi {
@FormUrlEncoded
@POST("uc/ready-bonus")
fun getRedPacketId(@FieldMap params: Map<String, String>): Observable<BaseResponse<RedPacketId>>
//上传用户信息数据接口
@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,6 +7,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.CheckPhonePassBean
import com.yidianling.user.bean.CollectFocusItemBean
import com.yidianling.user.http.request.*
import com.yidianling.user.http.response.CheckPassword
import com.yidianling.user.http.response.CountryResponse
......@@ -15,6 +16,7 @@ import com.yidianling.user.http.response.SecretResponse
import com.yidianling.user.mine.bean.RedPackDataForRegister
import com.yidianling.user.mine.bean.RedPacketId
import com.yidianling.user.mine.bean.RedPacketIdCmd
import com.yidianling.user.http.response.*
import io.reactivex.Observable
/**
......@@ -69,4 +71,10 @@ interface UserHttp {
fun getSecretData(): Observable<BaseResponse<SecretResponse>>
fun getRedPacketId(param: RedPacketIdCmd): Observable<BaseResponse<RedPacketId>>
fun userInfoCollectUpload(param: UserInfoCollectUploadParam): Observable<BaseAPIResponse<Any>>
fun getFocusData(): Observable<BaseAPIResponse<List<CollectFocusItemBean>>>
fun getNewUserJumpUrl(): Observable<BaseAPIResponse<String>>
}
\ No newline at end of file
......@@ -12,9 +12,10 @@ import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.common.tools.RxAppTool
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.user.UserHelper
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.UserHelper
import com.yidianling.user.bean.CheckPhonePassBean
import com.yidianling.user.bean.CollectFocusItemBean
import com.yidianling.user.http.request.*
import com.yidianling.user.http.response.CheckPassword
import com.yidianling.user.http.response.CountryResponse
......@@ -203,6 +204,20 @@ class UserHttpImpl private constructor() : UserHttp {
.flatMap { getUserApi().getRedPacketId(it) }
}
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 {
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
......@@ -17,6 +17,7 @@ import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.im.api.bean.IMLoginInfo
import com.yidianling.im.api.bean.IMRequestCallback
import com.yidianling.user.LoginUtils
import com.yidianling.user.StatusUtils
import com.yidianling.user.UserConstants
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.constants.UserBIConstants
......@@ -148,15 +149,17 @@ class SmsLoginActivity : BaseActivity() {
//关闭手势解锁页面与指纹解锁页面
finishFinger()
if (it.firstLogin == 1) {
StatusUtils.isFirstLogin = true
baiduActionBury()
}else {
ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,it.uid!!,UserBIConstants.ACTION_TYPE_CODE_LOGIN)
}
ActivityManager.finishActivity(LoginActivity::class.java)
if (ActivityManager.getActivitySize() <= 1) {
UserIn.mainIntent(this)
}
finish()
// ActivityManager.finishActivity(LoginActivity::class.java)
// if (ActivityManager.getActivitySize() <= 1) {
// UserIn.mainIntent(this)
// }
// finish()
LoginUtils.LoginSuccessOperate(this)
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
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
......@@ -17,6 +17,7 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.yidianling.common.tools.RxKeyboardTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.LoginUtils
import com.yidianling.user.R
import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.route.UserIn
......@@ -277,38 +278,10 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput
}
override fun closeActivity() {
RxKeyboardTool.hideSoftInput(this)
val size = ActivityManager.getActivitySize()
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)
}
}
LoginUtils.LoginSuccessOperate(this)
}
private fun closeAnim(hasAnim: Boolean) {
......
......@@ -38,7 +38,9 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxKeyboardTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.LoginUtils
import com.yidianling.user.R
import com.yidianling.user.StatusUtils
import com.yidianling.user.UserHelper
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.AliAuthBean
......@@ -126,6 +128,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
override fun initDataAndEvent() {
isUmengLoginState = intent.getBooleanExtra(BIND_PHONE, false)
isFromGuide = intent.getBooleanExtra(IS_FROM_GUIDE, false)
StatusUtils.isFromGuide = isFromGuide
setWindowStatusBarColor()
initAuthHelper()
......@@ -467,10 +470,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
tv_reg_title.text = "手机号绑定"
tv_protocol.visibility = View.GONE
} else {
finishPrePage()
if (isFromGuide) {
UserIn.mainIntent(this)
}
LoginUtils.LoginSuccessOperate(this)
}
}
......@@ -567,13 +567,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
override fun autoLoginSuccess() {
ll_success.visibility = View.VISIBLE
handler!!.postDelayed({
val size = ActivityManager.getActivitySize()
if (size == 1) {
ActivityManager.finishAll()
UserIn.mainIntent(this)
} else {
finishPrePage()
}
LoginUtils.LoginSuccessOperate(this)
}, 3000)
}
......
......@@ -15,6 +15,7 @@ import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.RxKeyboardTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.LoginUtils
import com.yidianling.user.R
import com.yidianling.user.UserHelper
import com.yidianling.user.constants.UserBIConstants
......@@ -273,37 +274,7 @@ class VerificationCodeActivity : BaseMvpActivity<IVerificationCodeContract.View,
override fun closeActivity() {
RxKeyboardTool.hideSoftInput(this)
val size = ActivityManager.getActivitySize()
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)
}
}
LoginUtils.LoginSuccessOperate(this)
}
/**
......
......@@ -2,7 +2,6 @@ package com.yidianling.user.ui.login.presenter
import android.annotation.SuppressLint
import android.text.TextUtils
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.utils.StringUtils
......@@ -11,6 +10,7 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.log.LogHelper
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.LoginUtils
import com.yidianling.user.StatusUtils
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.http.request.PhoneLoginPwdParam
......@@ -58,7 +58,7 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II
saveUserData(it.data)
ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,it.data.uid!!,UserBIConstants.ACTION_TYPE_RESET_PWD)
if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true
// 重设密码登录已经不可能是首次登录,所以不进行百度埋点
//view.baiduActionBury()
} else {
......@@ -95,7 +95,7 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II
} else {
saveUserData(it.data)
if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true
mView.baiduActionBury()
} else {
ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,it.data.uid!!,UserBIConstants.ACTION_TYPE_PWD_LOGIN)
......
......@@ -4,7 +4,6 @@ import android.annotation.SuppressLint
import android.app.Activity
import android.text.TextUtils
import com.umeng.socialize.bean.SHARE_MEDIA
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.utils.YDLCacheUtils
......@@ -12,6 +11,7 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.log.LogHelper
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.LoginUtils
import com.yidianling.user.StatusUtils
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.http.UserHttpImpl
......@@ -70,7 +70,7 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
//绑定手机号
saveUserData(it.data)
if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true
mView.baiduActionBury(it.data.uid, UserBIConstants.POSITION_ALIYUN_REGISTER_CLICK)
} else {
ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,it.data.uid!!,UserBIConstants.ACTION_TYPE_DIRECT_LOGIN)
......@@ -192,24 +192,24 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
ToastUtil.toastShort(it.msg)
return@subscribe
}
LoginUtils.onLogin(it.data)
mView.thirdLoginSuccess(it.data.userInfo!!)
LogHelper.getInstance().writeLogSync(media.getName() + "登录成功")
if (media == SHARE_MEDIA.QQ) {
if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true
mView.baiduActionBury(it.data.uid,UserBIConstants.POSITION_QQ_REGISTER_CLICK)
} else {
ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK, it.data.uid!!,sign1)
}
} else {
if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true
mView.baiduActionBury(it.data.uid,UserBIConstants.POSITION_WX_REGISTER_CLICK)
} else {
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()
YdlCommonOut.showToast(it.message!!)
......
......@@ -8,6 +8,7 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.log.LogHelper
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.LoginUtils
import com.yidianling.user.StatusUtils
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.http.request.BindPhoneJavaParam
......@@ -144,7 +145,7 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
saveUserData(it.data)
if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true
mView.baiduActionBury()
} else {
ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,it.data.uid!!,UserBIConstants.ACTION_TYPE_CODE_LOGIN)
......
......@@ -64,14 +64,14 @@ class SecretDescriptionDialog(
spannableString.setSpan(
object : ClickableSpan() {
override fun onClick(widget: View?) {
if (Utils.isFastClick()){
if (Utils.isFastClick()) {
return
}
H5Activity.start(mContext, false)
}
override fun updateDrawState(ds: TextPaint?) {
ds?.color=Color.parseColor("#159CEF")
ds?.color = Color.parseColor("#159CEF")
}
}, 5,
13, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
......@@ -79,14 +79,14 @@ class SecretDescriptionDialog(
spannableString.setSpan(
object : ClickableSpan() {
override fun onClick(widget: View?) {
if (Utils.isFastClick()){
if (Utils.isFastClick()) {
return
}
H5Activity.start(mContext, true)
}
override fun updateDrawState(ds: TextPaint?) {
ds?.color=Color.parseColor("#159CEF")
ds?.color = Color.parseColor("#159CEF")
}
}, str.length - 8,
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"?>
<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"
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
<?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
......@@ -99,7 +99,6 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
}
ACTION_PUSH_EVENT_TRACKING_TAP -> {
val map = methodCall.arguments as HashMap<*, *>
LogUtil.i("flutter click:"+GsonProvider.getGson().toJson(map))
val clickPath = map["path"] as String
if (!TextUtils.isEmpty(clickPath)) {
......@@ -109,11 +108,17 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
field.isAccessible = true
val property = field.get(ownerClass)
if (property is Boolean && property) {
var activity:Activity ?= mActivity
var activity: Activity?= mActivity
if (mActivity==null&&mFragment!=null){
activity = mFragment?.activity!!
}
BuryPointHelper.showEditDialog(activity, MD5Util.md5(clickPath), null)
activity?.let {
BuryPointHelper.showEditDialog(
activity,
MD5Util.md5(clickPath),
null
)
}
}
} catch (e: Exception) {
LogUtil.e("flutter click exception:$e")
......
......@@ -2,18 +2,24 @@ package com.ydl.ydlcommon.base
import android.app.Activity
import android.content.res.Resources
import android.graphics.Color
import android.os.Bundle
import android.support.annotation.LayoutRes
import android.support.v7.app.AppCompatActivity
import android.util.Log
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.LinearLayout
import com.trello.rxlifecycle2.android.ActivityEvent
import com.ydl.ydlcommon.R
import com.ydl.ydlcommon.base.lifecycle.IActivityLifecycleable
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.ui.LoadingDialogFragment
import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.AndroidSystemHelper
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.yidianling.common.tools.RxImageTool
import io.reactivex.subjects.BehaviorSubject
import io.reactivex.subjects.Subject
import kotlin.properties.Delegates
......@@ -24,7 +30,7 @@ import kotlin.properties.Delegates
* e-mail : zhangwch@yidianling.com
* time : 2018/01/27
*/
abstract class BaseActivity : AppCompatActivity(),IActivityLifecycleable {
abstract class BaseActivity : AppCompatActivity(), IActivityLifecycleable {
private val mLifecycleSubject = BehaviorSubject.create<ActivityEvent>()
var mContext: Activity by Delegates.notNull()
......@@ -57,19 +63,49 @@ abstract class BaseActivity : AppCompatActivity(),IActivityLifecycleable {
override fun setContentView(@LayoutRes layoutResID: Int) {
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];
}
super.setContentView(returnViews[0])
AndroidSystemHelper.fixAndroidBug5497Workaround(this)
} else {
super.setContentView(layoutResID)
//判定是否有底部小横条
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)
}
}
}
open fun getDefaultBottomColor(): Int {
return Color.parseColor("#00000000")
}
override fun onDestroy() {
super.onDestroy()
ActivityManager.getInstance().removeStack(this)
......@@ -88,7 +124,7 @@ abstract class BaseActivity : AppCompatActivity(),IActivityLifecycleable {
return AndroidSystemHelper.fixResourcesScale(res)
}
open fun getStatusViewOptions():StatusBarOptions{
open fun getStatusViewOptions(): StatusBarOptions {
return StatusBarOptions()
}
......
......@@ -55,7 +55,7 @@ abstract class BaseFragment : Fragment() ,IFragmentLifecycleable{
layoutResId != 0 -> {
val childView = inflater.inflate(layoutResId, container, false)
if (getStatusViewOptions().isAddStatusView){
val returnViews = StatusBarUtils.initStatusBarView(activity!!, childView, getStatusViewOptions())
val returnViews = StatusBarUtils.initStatusBarView(activity!!, childView, getStatusViewOptions(), true)
return returnViews[0]
}else{
......
package com.ydl.ydlcommon.bean
import android.graphics.Color
import android.os.Build
import com.ydl.ydlcommon.R
import com.ydl.ydlcommon.base.BaseApp
......@@ -23,6 +24,7 @@ class StatusBarOptions {
return BaseApp.getApp().resources.getString(0+R.color.platform_main_theme);
}
}
var bottomStatusColor: Int = Color.parseColor("#00000000") //底部颜色默认透明色,个别页面自己设置即可
constructor(isAddStatusView: Boolean = false, statusBarDarkMode: Boolean= false) {
this.isAddStatusView = isAddStatusView
......
package com.ydl.ydlcommon.utils
import android.annotation.SuppressLint
import android.app.Activity
import android.app.Dialog
import android.os.Bundle
......@@ -36,22 +37,24 @@ class ApkUpdateDialog : Dialog{
this.activity = activity
}
@SuppressLint("SetTextI18n")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.platform_dialog_update_layout)
tv_update_content.text = updateData?.title
tv_update_content.setMovementMethod(ScrollingMovementMethod.getInstance());
tv_update_content.movementMethod = ScrollingMovementMethod.getInstance();
text_version.text = "v${updateData?.ver}"
text_desc.text = updateData?.content
text_desc.setMovementMethod(ScrollingMovementMethod.getInstance());
text_desc.movementMethod = ScrollingMovementMethod.getInstance();
v_downpress.setSize(28,14,6,9,4)
v_downpress.setTextSize(10)
// v_downpress.setProgress(0)
listener = object : ApkInstallTool.UpdateProgressListener {
@SuppressLint("CheckResult")
override fun startLoad() {
Observable.just(1)
.observeOn(AndroidSchedulers.mainThread())
......@@ -66,6 +69,7 @@ class ApkUpdateDialog : Dialog{
},{})
}
@SuppressLint("CheckResult")
override fun progress(progress: Int) {
Observable.just(1)
.observeOn(AndroidSchedulers.mainThread())
......
......@@ -15,6 +15,7 @@ import android.support.v4.widget.DrawerLayout
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import android.widget.FrameLayout
import android.widget.LinearLayout
import com.ydl.ydlcommon.R
import com.ydl.ydlcommon.bean.StatusBarOptions
......@@ -997,25 +998,38 @@ class StatusBarUtils {
return initStatusBarView(
context,
child,
statusBarOptions
statusBarOptions,
false
)
}
fun initStatusBarView(
context: Activity,child:View,
statusBarOptions: StatusBarOptions
context: Activity,
child:View,
statusBarOptions: StatusBarOptions,
isFragment: Boolean = false
): Array<View> {
var returnView = arrayOfNulls<View>(2)
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 =
initStatus(context, rootView, statusBarOptions);
initStatus(context, containerView, statusBarOptions)
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)
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
if (statusView != null){
......@@ -1025,21 +1039,39 @@ class StatusBarUtils {
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(
context: Activity,
rootView: View,
containerView: View,
statusBarOptions: StatusBarOptions
):View? {
var statusView:View ?=null
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))
val statusBarHeight =
getStatusBarHeight(context)
val layoutParams = statusView?.getLayoutParams() as LinearLayout.LayoutParams
layoutParams.height = statusBarHeight
statusView?.layoutParams = layoutParams
statusView?.let {
val layoutParams = statusView?.getLayoutParams() as LinearLayout.LayoutParams
layoutParams.height = statusBarHeight
statusView?.layoutParams = layoutParams
}
setTransparentForImageView(context, null)
}
if (statusBarOptions.statusBarDarkMode) {
......
......@@ -4,6 +4,7 @@ import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import com.ydl.ydlcommon.R
import com.ydl.ydlcommon.router.YdlCommonOut
......@@ -14,6 +15,7 @@ class YDLCommonDialog: Dialog {
private var mContext: Context? = null
private var mListener: OnYDLCommonDialogListener? = null
private var hasTitle = true // 默认为有标题弹窗
private var mTitle: String = ""
private var mDesc: String = ""
private var mLeftText: String = ""
......@@ -35,8 +37,18 @@ class YDLCommonDialog: Dialog {
window.setGravity(Gravity.CENTER)
window.attributes = params
ydl_common_dialog_title.text = mTitle
ydl_common_dialog_desc.text = mDesc
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_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_sure.text = mRightText
......@@ -73,6 +85,15 @@ class YDLCommonDialog: Dialog {
}
/**
* 设置无标题弹窗描述
*/
fun setNullTitleDesc(desc: String): YDLCommonDialog {
hasTitle = false
mDesc = desc
return this
}
/**
* 左侧按钮
*/
fun setCancelText(cancelText: String): YDLCommonDialog {
......
......@@ -3,8 +3,9 @@
android:shape="rectangle">
<gradient
android:endColor="#fdbd00"
android:startColor="#FFEC8C"/>
android:angle="0"
android:startColor="#fdbd00"
android:endColor="#fdbd00"/>
<corners android:bottomRightRadius="8dp" />
......
......@@ -3,6 +3,7 @@
android:shape="rectangle">
<gradient
android:angle="180"
android:endColor="@color/platform_main_gradient_end_color"
android:startColor="@color/platform_main_gradient_start_color"/>
......
<?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"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
......@@ -11,4 +10,19 @@
android:background="@color/platform_white"
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>
\ No newline at end of file
......@@ -39,6 +39,20 @@
android:layout_marginTop="8dp"
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
android:layout_width="match_parent"
android:layout_height="44dp"
......
......@@ -14,6 +14,13 @@ class H5Params : Serializable {
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() {
this.url = url
this.shareData = share
......@@ -60,4 +67,13 @@ class H5Params : Serializable {
* 倾诉拨打电话
*/
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.ydl_router.manager.YDLRouterManager;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.BaseApp;
import com.ydl.ydlcommon.bean.StatusBarOptions;
import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.ydl.ydlcommon.ui.LogoLoadingView;
import com.ydl.ydlcommon.utils.ActivityManager;
import com.ydl.ydlcommon.utils.BuryPointUtils;
import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.NetWorkSpeedUtils;
......@@ -55,6 +57,7 @@ import com.yidianling.common.tools.ToastUtil;
import com.yidianling.dynamic.api.IDynamicService;
import com.yidianling.user.api.event.UserBindPhoneEvent;
import com.yidianling.user.api.event.UserLoginEvent;
import com.yidianling.user.api.service.IAppService;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
......@@ -632,7 +635,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
WebModularServiceUtils.Companion.startMain(NewH5Activity.this);
finish();
} else {
}
else {
if (ActivityManager.Companion.getInstance().getActivitys().size() == 1) {
WebModularServiceUtils.Companion.startMain(NewH5Activity.this);
}
finish();
}
});
......@@ -825,7 +832,8 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
tb_title.setImageListener(v -> {
if (wv_content.canGoBack()) {
wv_content.goBack();
} else {
}
else {
finish();
}
});
......@@ -839,7 +847,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
if (h5Params.getShowUrlTitle()) {
WebModularServiceUtils.Companion.startMain(NewH5Activity.this);
finish();
} else {
}
else {
if (ActivityManager.Companion.getInstance().getActivitys().size() == 1) {
WebModularServiceUtils.Companion.startMain(NewH5Activity.this);
}
finish();
}
});
......@@ -1112,7 +1124,9 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
tb_title.setLeftTextVisible(VISIBLE);
if ("top".equals(type)) {
setTitle(wv_content.getTitle());
tb_title.setImageListener(v -> wv_content.goBack());
tb_title.setImageListener(v ->
wv_content.goBack()
);
} else {
wv_content.goBack();
}
......@@ -1128,7 +1142,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
if (h5Params.isSplash()) {
WebModularServiceUtils.Companion.startMain(NewH5Activity.this);
finish();
} else {
}
else {
if (ActivityManager.Companion.getInstance().getActivitys().size() == 1) {
WebModularServiceUtils.Companion.startMain(NewH5Activity.this);
}
finish();
}
});
......@@ -1259,12 +1277,20 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
}
/**
* 新用户侧滑按钮限制
*/
if (h5Params.getBackLimit() != null && h5Params.getBackLimit() == H5Params.BackLimit.NEW_USER_PAGE) {
return true;
}
/**
* 增加逻辑:在高级题测试页面,按物理返回键直接finish当前页面,不走webview.goback()逻辑
*/
if (h5Params.isControlBack()) {
finish();
}
back("key");
return true;
}
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