Commit d508d3a9 by 霍志良

Merge remote-tracking branch 'origin/最新Dev' into MDT群聊搭建

parents 95a65674 fd7f9a0d
......@@ -7,6 +7,7 @@ import android.os.Process;
import androidx.multidex.MultiDex;
import android.webkit.WebView;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.meituan.android.walle.WalleChannelReader;
import com.umeng.analytics.MobclickAgent;
import com.umeng.commonsdk.UMConfigure;
......@@ -58,6 +59,8 @@ public class ComponentTestApp extends BaseApp {
initUmeng();
registerActivityLifecycleCallbacks(new CoursePlayLifecycle());
Fresco.initialize(this);
}
private void initUmeng() {
......
......@@ -5,12 +5,12 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.49.52",
"m-consultant" : "0.0.60.04",
"m-confide" : "0.0.49.53",
"m-consultant" : "0.0.60.10",
"m-fm" : "0.0.30.04",
"m-user" : "0.0.61.94",
"m-home" : "0.0.22.85",
"m-im" : "0.0.21.17",
"m-user" : "0.0.61.96",
"m-home" : "0.0.22.87",
"m-im" : "0.0.21.18",
"m-dynamic" : "0.0.7.35",
"m-article" : "0.0.0.10",
......@@ -26,14 +26,14 @@ ext {
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.17",
"m-user-api" : "0.0.10.19",
"m-home-api" : "0.0.4.2",
"m-im-api" : "0.0.12.23",
"m-dynamic-api" : "0.0.3.71",
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.40.79",
"ydl-platform" : "0.0.40.83",
//第二步 若干
"ydl-webview" : "0.0.38.58",
......@@ -76,6 +76,7 @@ ext {
retrofitSdkVersion : "2.6.0",
dagger2SdkVersion : "2.23.2",
glideSdkVersion : "4.12.0",
frescoSdkVersion : "2.1.0",
butterknifeSdkVersion : "9.0.0-rc1",
rxlifecycleSdkVersion : "1.0",
rxlifecycle2SdkVersion : "2.2.2",
......@@ -89,11 +90,11 @@ ext {
//第三步 若干
"m-confide" : "0.0.49.52",
"m-consultant" : "0.0.60.03",
"m-consultant" : "0.0.60.10",
"m-fm" : "0.0.30.07",
"m-user" : "0.0.61.94",
"m-home" : "0.0.22.85",
"m-im" : "0.0.21.17",
"m-user" : "0.0.61.96",
"m-home" : "0.0.22.87",
"m-im" : "0.0.21.18",
"m-dynamic" : "0.0.7.35",
"m-article" : "0.0.0.8",
......@@ -108,14 +109,14 @@ ext {
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.17",
"m-user-api" : "0.0.10.19",
"m-home-api" : "0.0.4.2",
"m-im-api" : "0.0.12.23",
"m-dynamic-api" : "0.0.3.71",
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.40.79",
"ydl-platform" : "0.0.40.83",
//第二步 若干
"ydl-webview" : "0.0.38.58",
......@@ -155,7 +156,11 @@ ext {
"glide-loader-okhttp3" : "com.github.bumptech.glide:okhttp3-integration:${version["glideSdkVersion"]}",
"glide-annotations" : "com.github.bumptech.glide:annotations:${version["glideSdkVersion"]}",
"glide-transformations" : "jp.wasabeef:glide-transformations:4.3.0",
"picasso" : "com.squareup.picasso:picasso:2.5.2",
// "picasso" : "com.squareup.picasso:picasso:2.5.2",
"fresco" : "com.facebook.fresco:fresco:${version["frescoSdkVersion"]}",
// 支持 WebP (静态图+动图),需要添加
"fresco-animated-webp" : "com.facebook.fresco:animated-webp:${version["frescoSdkVersion"]}",
"fresco-webpsupport" : "com.facebook.fresco:webpsupport:${version["frescoSdkVersion"]}",
//view
"autolayout" : "com.zhy:autolayout:1.4.5",
......
......@@ -5,17 +5,25 @@ import android.animation.Animator
import android.animation.ObjectAnimator
import android.app.Dialog
import android.content.Context
import android.net.Uri
import android.os.Bundle
import android.os.Handler
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.drawee.interfaces.DraweeController
import com.facebook.imagepipeline.common.ResizeOptions
import com.facebook.imagepipeline.common.RotationOptions
import com.facebook.imagepipeline.postprocessors.IterativeBoxBlurPostProcessor
import com.facebook.imagepipeline.request.ImageRequest
import com.facebook.imagepipeline.request.ImageRequestBuilder
import com.yidianling.common.tools.RxImageTool
import com.yidianling.consultant.R
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
import kotlinx.android.synthetic.main.consultant_expert_consult_assistant_popup_window.*
/**
* 咨询助理浮层
* Created by xj on 2019/10/30.
......@@ -92,6 +100,16 @@ class ConsultAssistantDialog(
})
}
val controller: DraweeController = Fresco.newDraweeControllerBuilder()
.setUri(Uri.parse("res://drawable/"+R.drawable.consultant_assistant_dialog_img))
.setOldController(consultant_assistant.controller)
.setAutoPlayAnimations(true) // 是否自动播放Gif动画
.build()
consultant_assistant.controller = controller
consultant_assistant.setOnClickListener {
consultAssistantClickListener?.onClickAction()
}
......
......@@ -5,6 +5,7 @@ import android.app.Activity
import androidx.appcompat.app.AppCompatActivity
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.YdlBuryPointUtil
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
......@@ -16,6 +17,7 @@ import com.yidianling.consultant.dialog.ConsultAssistantDialog
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.router.ConsultantIn
import com.yidianling.home.api.event.HomeModuleTabEvent
import com.yidianling.user.api.listener.LoginCallBackListener
import de.greenrobot.event.EventBus
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
......@@ -114,11 +116,22 @@ class ConsultAssistantDialogUtils private constructor() {
if (Utils.isFastClick()) {
return onClickAction()
}
if (ConsultantIn.getUserImpl().loginByOneKeyLogin(activity,true)){
if (ConsultantIn.getUserImpl().isLogin()){
//获取用户uid
ActionCountUtils.count("main_page|main_daoyi_entry_click")
YdlBuryPointUtil.sendClick("home_page_assistant_click")
getConsultAssistantUid("", activity, 1)
}else{
ConsultantIn.getUserImpl().loginByOneKeyLoginCallBack(activity,true,object :LoginCallBackListener{
override fun loginSuccess() {
//获取用户uid
ActionCountUtils.count("main_page|main_daoyi_entry_click")
YdlBuryPointUtil.sendClick("home_page_assistant_click")
getConsultAssistantUid("", activity, 1)
}
override fun notLogin() {
}
})
}
}
......@@ -150,10 +163,20 @@ class ConsultAssistantDialogUtils private constructor() {
if (Utils.isFastClick()) {
return onClickAction()
}
if (!ConsultantIn.getUserImpl().loginByOneKeyLogin(activity, true)) {
return
if (ConsultantIn.getUserImpl().isLogin()){
//获取用户uid
getConsultAssistantUid("", activity, 17)
}else{
ConsultantIn.getUserImpl().loginByOneKeyLoginCallBack(activity,true,object :LoginCallBackListener{
override fun loginSuccess() {
//获取用户uid
getConsultAssistantUid("", activity, 17)
}
override fun notLogin() {
}
})
}
getConsultAssistantUid("", activity, 17)
}
})
......@@ -243,10 +266,19 @@ class ConsultAssistantDialogUtils private constructor() {
}
ActionCountUtils.count("app_consult_list_page|app_consult_list_daoyi_entry_click")
YdlBuryPointUtil.sendClick("assistant_list_click")
// 咨询师列表页面且未登录情况下,跳转登录页面
if (ConsultantIn.loginByOneKeyLogin(activity, true)) {
if (ConsultantIn.getUserImpl().isLogin()){
//获取用户uid
getConsultAssistantUid(origin, activity, 6)
}else{
ConsultantIn.getUserImpl().loginByOneKeyLoginCallBack(activity,true,object :LoginCallBackListener{
override fun loginSuccess() {
//获取用户uid
getConsultAssistantUid(origin, activity, 6)
}
override fun notLogin() {
}
})
}
}
......
......@@ -10,17 +10,17 @@
android:layout_height="84dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="25dp"
android:layout_marginRight="22dp"
android:clipChildren="true"
android:gravity="center"
android:orientation="horizontal"
android:paddingRight="25dp"
android:paddingBottom="40dp">
>
<LinearLayout
android:id="@+id/consultant_assistant_dialog_desc_ll"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="47dp"
android:layout_marginTop="5dp"
android:background="@drawable/consultant_assistant_dialog_text_bg"
android:gravity="center">
......@@ -39,7 +39,7 @@
android:layout_width="0.5dp"
android:layout_height="26dp"
android:layout_marginRight="8dp"
android:background="#ffffff" />
android:background="#80ffffff" />
<LinearLayout
android:id="@+id/ll_desc_assistant"
......@@ -66,6 +66,7 @@
android:layout_height="wrap_content"
android:text="为你精准匹配咨询师 "
android:textColor="#ffffff"
android:textStyle="bold"
android:textSize="12dp" />
<ImageView
......@@ -78,14 +79,13 @@
</LinearLayout>
<ImageView
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/consultant_assistant"
android:layout_width="61dp"
android:layout_height="101dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:scaleType="centerCrop"
android:src="@drawable/consultant_assistant_dialog_img"
android:paddingBottom="40dp" />
</RelativeLayout>
\ No newline at end of file
......@@ -8,6 +8,7 @@
"linkUrl": "ydl-user://h5/course?params=%7b%22url%22%3a%22https%3a%2f%2fm.ydl.com%2fcourse%2fDetail%2fv2%2f6194%22%7d",
"title": ""
},
"listenFree": false,
"askCategoryData": [
{
"cateId": 0,
......
......@@ -257,7 +257,8 @@
"imageUrl": "",
"btnLinkurl": "",
"imageBanner": "https://pic.ydlcdn.com/HFfHKt6tNj.png"
}
},
"listenFree": false
},
"type": 10001
},
......@@ -523,7 +524,8 @@
"imageUrl": "",
"btnLinkurl": "",
"imageBanner": "https://pic.ydlcdn.com/HFfHKt6tNj.png"
}
},
"listenFree": false
},
"type": 10002
},
......@@ -990,7 +992,8 @@
"imageUrl": "",
"btnLinkurl": "",
"imageBanner": "https://pic.ydlcdn.com/HFfHKt6tNj.png"
}
},
"listenFree": false
},
"type": 10003
},
......
......@@ -43,6 +43,10 @@ class HomeHeaderBean : HomeItemBaseBean {
* 专家名称
*/
var doctorName : String? = null
/*
* 倾诉免费标识
* */
var listenFree : Boolean? = null
class AskCategoryDataBean {
/**
......
......@@ -57,6 +57,11 @@ class YdlHomeAdapter(private val mContext: Context,
*/
var consultCategoryData: List<HomeHeaderBean.ConsultCategoryDateBean>? = null
/*
倾诉免费标识
* */
var listenFree:Boolean?=false
fun updateItems(list: MutableList<HomePagerDataBean>) {
if (null == this.list || this.list!!.isEmpty()) {
this.list = ArrayList()
......@@ -64,6 +69,7 @@ class YdlHomeAdapter(private val mContext: Context,
this.list.clear()
}
this.list.addAll(list)
this.listenFree= list[0]?.headerBean?.listenFree
//重置标记位
confidePosition = -1
consultPosition = -1
......@@ -131,7 +137,9 @@ class YdlHomeAdapter(private val mContext: Context,
}
//顶部预约专家,即时倾诉,心理测试按钮模块
HomeViewConfig.getOrder().buttonIndex -> {
return HomeButtonBannerViewHolder(HomeButtonBannerView(mContext, homeEvent),viewType)
return HomeButtonBannerViewHolder(HomeButtonBannerView(mContext, homeEvent,
listenFree!!
),viewType)
}
//倾诉*排解模块
HomeViewConfig.getOrder().confideIndex -> {
......
......@@ -22,7 +22,7 @@ import kotlinx.android.synthetic.ydl.home_button_banner_view.view.*
* @Company 壹点灵
* @date 2019/02/13
*/
class HomeButtonBannerView(private val mContext: Context, private var homeEvent: IHomeBaseEvent?) : LinearLayout(mContext) {
class HomeButtonBannerView(private val mContext: Context, private var homeEvent: IHomeBaseEvent?,var listenFree:Boolean) : LinearLayout(mContext) {
private var buttonParams: LinearLayout.LayoutParams? = null
private var buttonParamsFrame: FrameLayout.LayoutParams? = null
......@@ -36,10 +36,14 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
val params = RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(mContext, R.layout.home_button_banner_view, this)
Glide.with(context)
.load(R.drawable.qingsu_new_free_temp)
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.into(qingsuGif)
if (listenFree){
qingsuGif.visibility=View.VISIBLE
Glide.with(context)
.load(R.drawable.qingsu_new_free_dynamic)
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.into(qingsuGif)
}
initButtonView()
homeModuleButtonBannerFirst.setOnClickListener {
......@@ -67,7 +71,7 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
buttonParams = LinearLayout.LayoutParams(viewWidth, viewHeight)
buttonParamsFrame = FrameLayout.LayoutParams(viewWidth, viewHeight)
buttonParamsFrame2= FrameLayout.LayoutParams((viewWidth/2.0).toInt(), (viewHeight/2.3).toInt())
buttonParamsFrame2!!.setMargins((((viewWidth/6f).toInt())),0,0,0)
buttonParamsFrame2!!.setMargins((((viewWidth/12f).toInt())),0,0,0)
qingsuGif.layoutParams=buttonParamsFrame2
homeModuleButtonBannerFirst.layoutParams = buttonParams
......
......@@ -111,6 +111,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/qingsuGif"
android:visibility="gone"
>
</ImageView>
</FrameLayout>
......
......@@ -841,7 +841,7 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
ToastUtil.toastShort("咨询助理忙碌中,请稍后再试")
})
}
},2000)
},1000)
}
......
......@@ -14,6 +14,7 @@ import com.yidianling.im.api.bean.IMRequestCallback
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.event.UserLoginEvent
import com.yidianling.user.api.event.UserLogoutEvent
import com.yidianling.user.api.listener.LoginCallBackListener
import com.yidianling.user.http.UserHttpImpl
import com.yidianling.user.http.request.Logout
import com.yidianling.user.route.UserIn
......@@ -35,7 +36,10 @@ import io.reactivex.android.schedulers.AndroidSchedulers
* time : 2018/05/09
*/
object LoginUtils {
var logingCallBackListener: LoginCallBackListener? = null
fun setLoginCallBack(listener: LoginCallBackListener) {
logingCallBackListener = listener
}
@JvmStatic
fun saveData(userInfo: UserResponseBean?) {
UserHelper.setUserinfo(userInfo)
......@@ -107,6 +111,7 @@ object LoginUtils {
@JvmStatic
fun loginSuccessOperate(activity: Activity) {
logingCallBackListener?.loginSuccess()
// 登录成功后,如果一键登录界面没有关闭,则关闭掉
OneKeyLoginHelp.quitLoginPage()
val size = ActivityManager.getActivitySize()
......
......@@ -20,6 +20,7 @@ import com.yidianling.user.UserConstants
import com.yidianling.user.UserHelper
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.bean.UserSettingBean
import com.yidianling.user.api.listener.LoginCallBackListener
import com.yidianling.user.api.listener.SecretDataListener
import com.yidianling.user.api.listener.UserInfoFromApiListener
import com.yidianling.user.api.listener.VersionUpdateStatusListener
......@@ -321,4 +322,12 @@ public class UserServiceImp : IUserService {
override fun loginByOneKeyLogin(context: Context, isOpenDialog: Boolean):Boolean {
return OneKeyLoginHelp.startLoginByStatus(context,isOpenDialog)
}
override fun loginByOneKeyLoginCallBack(
context: Context,
isOpenDialog: Boolean,
listener: LoginCallBackListener
) {
OneKeyLoginHelp.startLoginByStatusLoginCallBack(context,isOpenDialog,listener)
}
}
\ No newline at end of file
......@@ -35,6 +35,7 @@ import com.yidianling.user.LoginUtils
import com.yidianling.user.StatusUtils
import com.yidianling.user.UserHelper
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.listener.LoginCallBackListener
import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.http.LoginApiRequestUtil
import com.yidianling.user.http.request.PhoneLoginAutoParam
......@@ -526,6 +527,7 @@ object OneKeyLoginHelp {
// 号码验证监听
private lateinit var verifyTokenResultListener: VerifyTokenResultListener
interface VerifyTokenResultListener {
fun onTokenSuccess(result: String)
......@@ -591,7 +593,23 @@ object OneKeyLoginHelp {
}
return UserHelper.isLogin()
}
/**
* @param isOpenDialog true: 使用弹窗展示一键登录
* false: 使用全页面展示一键登录
* @return true:登录。false:未登录
* */
fun startLoginByStatusLoginCallBack(context: Context, isOpenDialog: Boolean,listener: LoginCallBackListener) {
LoginUtils.setLoginCallBack(listener)
if (!UserHelper.isLogin()) {
if (this::mActivity.isInitialized) {
//如果mActivity有初始化,代表项目使用了一键登录
startLogin(context as Activity, isOpenDialog)
} else {
//如果mActivity未初始化,使用正常登录
RegisterAndLoginActivity.start(context)
}
}
}
/**
* @param isOpenDialog true 使用弹窗
* */
......
package com.yidianling.user.api.listener
interface LoginCallBackListener {
fun loginSuccess()
fun notLogin()
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.template.IProvider
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.bean.UserSettingBean
import com.yidianling.user.api.listener.LoginCallBackListener
import com.yidianling.user.api.listener.SecretDataListener
import com.yidianling.user.api.listener.UserInfoFromApiListener
import com.yidianling.user.api.listener.VersionUpdateStatusListener
......@@ -114,4 +115,11 @@ interface IUserService : IProvider {
* @return true:已登录,不触发登录跳转,false:未登录,优先一键登录
* */
fun loginByOneKeyLogin(context: Context, isOpenDialog: Boolean) :Boolean
/**
* 调用优先使用一键登录,并返回调用时的登录状态,
* @param isOpenDialog true:一键登录使用弹窗展示 false:一键登录使用全屏模式
* @return true:已登录,不触发登录跳转,false:未登录,优先一键登录
* */
fun loginByOneKeyLoginCallBack(context: Context, isOpenDialog: Boolean,listener: LoginCallBackListener)
}
\ No newline at end of file
......@@ -57,7 +57,9 @@ public class DefaultFormatPrinter {
logLines(tag, new String[]{URL_TAG + request.url()}, false);
logLines(tag, getRequest(request), true);
logLines(tag, requestBody.split(LINE_SEPARATOR), true);
NetLogUtils.debugInfo(tag, END_LINE);
if (!request.url().toString().contains("writemaidiandata")){
NetLogUtils.debugInfo(tag, END_LINE);
}
}
/**
......
......@@ -136,6 +136,9 @@ dependencies {
kapt rootProject.ext.dependencies["glide-compiler"]
api rootProject.ext.dependencies["glide"]
api rootProject.ext.dependencies["glide-transformations"]
api rootProject.ext.dependencies["fresco"]
api rootProject.ext.dependencies["fresco-animated-webp"]
api rootProject.ext.dependencies["fresco-webpsupport"]
api rootProject.ext.dependencies["constraint-layout"]
api rootProject.ext.dependencies["cube"]
api rootProject.ext.dependencies["support-multidex"]
......
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