Commit e932a552 by 范玉宾

Merge branch 'feat/lancet/v4398' into 'd/v4.3.98'

Feat/lancet/v4398 done  &  fix  bugs

See merge request app_android_lib/YDL-Component!174
parents 80e3afd0 4fe87aa7
......@@ -5,11 +5,11 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.50.27",
"m-confide" : "0.0.50.35",
"m-consultant" : "0.0.60.68",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.54",
"m-home" : "0.0.23.90",
"m-home" : "0.0.23.93",
"m-im" : "0.0.21.58",
"m-dynamic" : "0.0.7.74",
"m-article" : "0.0.0.10",
......@@ -92,11 +92,11 @@ ext {
ydlCompileVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.50.27",
"m-confide" : "0.0.50.35",
"m-consultant" : "0.0.60.68",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.54",
"m-home" : "0.0.23.90",
"m-home" : "0.0.23.93",
"m-im" : "0.0.21.58",
"m-dynamic" : "0.0.7.74",
"m-article" : "0.0.0.10",
......
......@@ -8,6 +8,11 @@ import android.os.Build
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import android.view.animation.AccelerateInterpolator
import android.view.animation.Animation
import android.view.animation.DecelerateInterpolator
import android.view.animation.TranslateAnimation
import android.widget.RelativeLayout
import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.SimpleItemAnimator
......@@ -29,6 +34,7 @@ import com.ydl.confide.home.event.ConfideHomeEventImpl
import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.confide.home.listener.ConfideHomeRecycleViewListener
import com.ydl.confide.home.listener.ConfideHomeRecyleSuspendListener
import com.ydl.confide.home.listener.HideScrollListener
import com.ydl.confide.home.modular.service.ConfideWebServiceImpl
import com.ydl.confide.home.presenter.ConfideHomePresenterImpl
import com.ydl.confide.home.util.ConfideHomeUtils
......@@ -63,7 +69,7 @@ import kotlinx.android.synthetic.main.confide_title_bar.*
@Route(path = ConfideRoute.R_CONFIDE_HOME)
class ConfideHomeActivity :
BaseLceActivity<IConfideHomeContract.View, IConfideHomeContract.Presenter>(),
IConfideHomeContract.View, XRecyclerView.LoadingListener {
IConfideHomeContract.View, XRecyclerView.LoadingListener,HideScrollListener {
private var listenFree = false
......@@ -218,7 +224,6 @@ class ConfideHomeActivity :
// mPresenter.loadLocalData(this)
rv_list.refresh()
initClick()
initQuickConsultDialog()
initStatusBar()
// ModularServiceManager.provide(IConsultantService::class.java).showConfideListDialog(this)
// ActionCountUtils.count("daoyi_advertisement_page|daoyi_advertisement_visit","17")
......@@ -287,41 +292,6 @@ class ConfideHomeActivity :
}
/**
* 监听控制一键倾诉浮层的显示与隐藏
*/
private fun initQuickConsultDialog() {
rv_list.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
super.onScrollStateChanged(recyclerView, newState)
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
quick_consult_card.visibility = View.VISIBLE
}
// val layoutManager: RecyclerView.LayoutManager = recyclerView?.layoutManager!!
// val linearManager = layoutManager as LinearLayoutManager
// if (linearManager is LinearLayoutManager) {
// val firstItemPosition = linearManager.findFirstCompletelyVisibleItemPosition()
// if (firstItemPosition > 3) {
// quick_consult_card.visibility = View.VISIBLE
// }else {
// quick_consult_card.visibility = View.GONE
// }
// }
}
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
if (dy <= 0) {
//向上滚动恢复显示
quick_consult_card.visibility = View.VISIBLE
} else {
//向下滚动隐藏
quick_consult_card.visibility = View.GONE
}
}
})
}
/**
* 初始化一键倾诉浮层的点击事件
*/
private fun initClick() {
......@@ -371,7 +341,7 @@ class ConfideHomeActivity :
}
//用于滑动筛选模块置顶
if (null == listScrollListener) {
listScrollListener = ConfideHomeRecycleViewListener()
listScrollListener = ConfideHomeRecycleViewListener(this)
}
rv_list.addOnScrollListener(listScrollListener!!)
//用于显示筛选悬浮按钮
......@@ -655,4 +625,19 @@ class ConfideHomeActivity :
}
super.onBackPressed()
}
override fun onHide() {
val lp = quick_consult_card.layoutParams as RelativeLayout.LayoutParams
quick_consult_card.animate().translationY(
(quick_consult_card.height + lp.bottomMargin).toFloat()
).setDuration(1000)
.interpolator = AccelerateInterpolator(3f)
}
override fun onShow() {
quick_consult_card.animate().translationY(0F).setDuration(1000)
.interpolator = DecelerateInterpolator(3f)
}
}
\ No newline at end of file
......@@ -13,7 +13,7 @@ import com.yidianling.common.tools.RxImageTool
* @Company 壹点灵
* @date 2018/9/25
*/
class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
class ConfideHomeRecycleViewListener() : RecyclerView.OnScrollListener() {
/**
* 筛选模块位置
*/
......@@ -23,6 +23,15 @@ class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
*/
private var move = false
private lateinit var listener: HideScrollListener
private var visible = true
constructor(listener: HideScrollListener):this(){
this.listener = listener
}
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
//在这里进行第二次滚动(最后的距离)
......@@ -37,6 +46,15 @@ class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
recyclerView.scrollBy(0, top)
}
}
if (dy > 0 && visible) {
visible = false
listener.onHide()
} else if (dy < 0 && !visible) {
visible = true
listener.onShow()
}
}
/**
......@@ -82,4 +100,6 @@ class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
// move = true
// }
}
}
\ No newline at end of file
package com.ydl.confide.home.listener
interface HideScrollListener {
fun onHide()
fun onShow()
}
\ No newline at end of file
......@@ -33,8 +33,7 @@
android:elevation="2dp"
android:paddingBottom="1dp"
android:paddingRight="@dimen/platform_dp_8"
android:visibility="gone"
tools:visibility="visible">
android:visibility="visible">
<ImageView
android:id="@+id/confide_logo"
......
package com.yidianling.home.adapter
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.launcher.ARouter
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.home.R
import com.yidianling.home.constants.HomeBIConstants
import com.yidianling.home.model.bean.MeditationModuleBean
import com.yidianling.user.api.service.IUserService
import kotlinx.android.synthetic.ydl.home_fragment.*
class HomeConfideAdapter(
private val context: Context,
private val data: List<MeditationModuleBean.MeditationDetail>?,
private val moreLink: String?,
private val homeLink: String? = null,
private val cateId: Long? = null,
private val buried: String? = null,
private val mark: Int? = null,
private val meditationType: Int? = null
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
return when (viewType) {
CONTENT_TYPE -> {
MeditationTypeViewHolder(
LayoutInflater.from(context)
.inflate(R.layout.home_layout_meditation_item, parent, false)
)
}
else -> {
MeditationTypeMoreViewHolder(
LayoutInflater.from(context)
.inflate(R.layout.home_layout_meditation_more_type, parent, false)
)
}
}
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
when (holder) {
is MeditationTypeViewHolder -> {
holder.ivType?.let {
Glide.with(context)
.load(data?.get(position)?.coverImageUrl)
.thumbnail(0.1f)
.transition(DrawableTransitionOptions.withCrossFade())
.into(it)
}
holder.tvName?.let {
it.text = data?.get(position)?.title ?: ""
}
holder.cvLayout?.setOnClickListener {
ActionCountUtils.baiDuCountSign3(
HomeBIConstants.YDL_USER_MAIN_PAGE_MUSE,
HomeBIConstants.YDL_HOME_MEDITATION_CLICK,
buried ?: "",
(position + 1).toString(),
""
)
if (meditationType == 0) {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
if (!ModularServiceManager.provide(IUserService::class.java)
.loginByOneKeyLogin(context, true)
) {
return@setOnClickListener
}
if (data == null) {
return@setOnClickListener
}
ARouter.getInstance().build("/muse/play")
.withLong("MEDITATION_ID", data[position]?.meditationId)
.withInt("MEDITATION_TYPE", meditationType)
.withFloat("MEDIA_DURATION", data[position].duration ?: 0.0f)
.withString("MEDIA_URL", data[position].mediaIdCoverImageUrl)
.withString("MEDIA_COVER_URL", data[position].mediaIdCoverImageUrl)
.navigation()
// YDLRouterManager.router(ROUTER_MUSE_PLAY,
// YDLRouterParams().putExtra("MEDITATION_ID" , data[position]?.meditationId.toString())
// .putExtra("MEDITATION_TYPE", meditationType.toString())
// .putExtra("MEDIA_DURATION", (data[position].duration?:0).toString())
// .putExtra("MEDIA_URL", data[position].mediaIdCoverImageUrl.toString())
// .putExtra("MEDIA_COVER_URL", data[position].mediaIdCoverImageUrl.toString()))
} else {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
if (data == null) {
return@setOnClickListener
}
val homeLink =
"${homeLink}mark=$mark&cateId=$cateId&meditationId=${data[position]?.meditationId}"
if (!homeLink.isNullOrBlank()) {
NewH5Activity.start(context, H5Params(homeLink, null))
}
}
}
}
is MeditationTypeMoreViewHolder -> {
holder.llMoreLayout?.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
//冥想助眠更多点击事件
ActionCountUtils.count(
HomeBIConstants.YDL_HOME_MEDITATION_VOICE_MORE_CLICK,
buried ?: ""
)
val moreLink = "${moreLink}mark=$mark&cateId=$cateId"
if (!moreLink.isNullOrBlank()) {
NewH5Activity.start(context, H5Params(moreLink, null))
}
}
}
}
}
override fun getItemCount(): Int {
return if (data?.isNotEmpty() == true) {
data.size + 1
} else {
0
}
}
override fun getItemId(position: Int) = position.toLong()
override fun getItemViewType(position: Int): Int {
return if (data?.isNotEmpty() == true && position == data.size) {
FOOTER_TYPE
} else {
CONTENT_TYPE
}
}
inner class MeditationTypeViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val cvLayout: FrameLayout? = itemView.findViewById(R.id.fl_layout)
val ivType: ImageView? = itemView.findViewById(R.id.iv_meditation_type)
val tvName: TextView? = itemView.findViewById(R.id.tv_meditation_type)
}
inner class MeditationTypeMoreViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val llMoreLayout: LinearLayout? = itemView.findViewById(R.id.ll_more_type)
}
companion object {
const val CONTENT_TYPE = 0
const val FOOTER_TYPE = 1
}
}
\ No newline at end of file
......@@ -325,7 +325,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
boolean isExpert = null!=ActionHandlerStorage.getL(sessionId)&&ActionHandlerStorage.getL(sessionId).getUserType() == 2;
ServiceImpl.Companion.getInstance().canViewConsult("")
ServiceImpl.Companion.getInstance().canViewConsult(ActionHandlerStorage.getL(sessionId).getInfo().doctorId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(response -> {
......@@ -441,13 +441,13 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
getInputPanel().setInputHintContent(res.data.getInputBoxReminder());
}
}
if ("200".equals(res.code) && res.data != null) {
if (res.data.getStatus() == 0) {
if (null != getActivity() && null != rela_zixun) {
rela_zixun.setVisibility(View.GONE);
}
}
}
// if ("200".equals(res.code) && res.data != null) {
// if (res.data.getStatus() == 0) {
// if (null != getActivity() && null != rela_zixun) {
// rela_zixun.setVisibility(View.GONE);
// }
// }
// }
}, throwable -> {
});
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 1 && ModularServiceManager.INSTANCE.provide(IUserService.class).getUserInfo().getUser_type() == 3) {
......
......@@ -3,6 +3,7 @@ package com.yidianling.uikit.custom.widget;
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
......@@ -20,6 +21,7 @@ import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.ydl.confide.api.ConfideRoute;
import com.ydl.confide.api.IConfideService;
import com.ydl.ydlcommon.base.config.HttpConfig;
import com.ydl.ydlcommon.router.IYDLRouterConstant;
import com.ydl.ydlcommon.utils.Utils;
import com.yidianling.common.tools.RxImageTool;
import com.yidianling.common.tools.ToastUtil;
......@@ -34,8 +36,12 @@ import com.ydl.ydlcommon.utils.StringUtils;
import com.ydl.ydlcommon.utils.YDLCacheUtils;
import java.util.HashMap;
import kotlin.Pair;
import static com.ydl.ydlcommon.modular.ModularServiceManagerKt.findRouteService;
import static com.ydl.ydlcommon.modular.ModularServiceManagerKt.route;
/**
* Created by haorui on 2019/5/22.
......@@ -140,23 +146,24 @@ public class ConfideOrderInfoView extends RelativeLayout {
//点击整个view,跳转订单详情页面
setOnClickListener(view -> {
if (Utils.isFastClick()){
if (Utils.isFastClick()) {
return;
}
String remainTime = ActionHandlerStorage.getL(mSessionId).getInfo().listenOrderRemainTime;
if(TextUtils.isEmpty(remainTime)){
if (!TextUtils.isEmpty(info.listenOrderUrl)) {//订单详情
H5Params h5Params = new H5Params(info.listenOrderUrl, "订单详情");
NewH5Activity.start(mContext, h5Params);
}
}else {
if (info!=null){
if (TextUtils.isEmpty(remainTime)) {
Pair<String, String> confideId = new Pair<>(IYDLRouterConstant.EXTRA_CONFIDEDID,
info.listenerId);
Pair<String, String> doctorId = new Pair<>(IYDLRouterConstant.EXTRA_DOCTORID,
info.doctorId);
route(getContext(), ConfideRoute.R_CONFIDE_HOME, confideId, doctorId);
} else {
if (info != null) {
String confideId = info.listenerId;
findRouteService(IConfideService.class)
.showExpertDetailDialog(
(FragmentActivity)mContext,
(FragmentActivity) mContext,
HttpConfig.Companion.getMH5_URL() + ConfideRoute.INSTANCE.h5ConfideIntro(confideId),
info.doctorId,
info.toUid);
......@@ -209,4 +216,7 @@ public class ConfideOrderInfoView extends RelativeLayout {
});
MessageListPanelHelper.getInstance().notifyAddMessage(message);
}
}
......@@ -690,7 +690,7 @@ public class ErrorMessageConverter {
return getLocalizedString(R.string.TUIKitErrorSVRNoSuccessResult); // @"批量操作无成功结果";
case BaseConstants.ERR_TO_USER_INVALID:
return getLocalizedString(R.string.TUIKitErrorSVRToUserInvalid); // @"IM: 无效接收方";
case BaseConstants.ERR_REQUEST_TIMEOUT:
case BaseConstants.ERR_REQUEST_TIME_OUT:
return getLocalizedString(R.string.TUIKitErrorSVRRequestTimeout); // @"请求超时";
case BaseConstants.ERR_INIT_CORE_FAIL:
return getLocalizedString(R.string.TUIKitErrorSVRInitCoreFail); // @"INIT CORE模块失败";
......
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