Commit f1271f4c by 霍志良

feat:金刚位全部分类页跳转

parent 6328d9be
......@@ -7,17 +7,22 @@
android:name=".ExpertSearchActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/consultant_NoTitleTheme"/>
android:theme="@style/consultant_NoTitleTheme" />
<activity
android:name=".ExpertEightCategoryActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/consultant_NoTitleTheme" />
<activity
android:name=".HotSearchActivity"
android:screenOrientation="portrait"
android:theme="@style/consultant_NoTitleTheme"/>
android:theme="@style/consultant_NoTitleTheme" />
<activity
android:name=".ConsultAssistantCenterActivity"
android:screenOrientation="portrait"
android:theme="@style/consultant_Transparent"/>
android:theme="@style/consultant_Transparent" />
<activity android:name=".preview.GridPreviewActivity"
android:screenOrientation="portrait"
......
package com.yidianling.consultant
import android.annotation.SuppressLint
import android.view.WindowManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.model.bean.ChildrenBean
import com.yidianling.consultant.router.ConsultantIn
import com.yidianling.consultant.ui.view.topView.EightCategoryView
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.consultant_layout_eight_category.*
import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.*
@Route(path = "/consult/eightcategory")
class ExpertEightCategoryActivity : BaseActivity() {
override fun layoutResId(): Int {
return R.layout.consultant_layout_eight_category
}
@SuppressLint("CheckResult")
override fun initDataAndEvent() {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE or WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN)
showProgressDialog()
SearchApi.getSearchApi()
.searchEightCategoryHotWord()
.compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ resp ->
dismissProgressDialog()
var mutableList = mutableListOf<MutableList<ChildrenBean>>()
resp.forEach {
it.children?.let { it1 -> mutableList.add(it1) }
}
mutableList.forEachIndexed { index, item ->
item.forEachIndexed { inin, childrenBean ->
if (inin < 8) {
childrenBean.isVisible = true
}
if (inin == 8) {
return@forEachIndexed
}
}
}
val eightCategoryView = EightCategoryView(this, true)
eightCategoryView.setData(mutableList, null, null, true)
eight_view_ll.addView(eightCategoryView)
}, { t ->
dismissProgressDialog()
})
btn_back.setOnClickListener {
onBackPressed()
}
btn_call.setOnClickListener {
ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_ONLINE_CUSTOMER_CLICK)
ConsultantIn.startP2PXiaoYi(this)
}
tv_guide.setOnClickListener {
ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_CONSULT_GUIDE_CLICK)
val h5param = H5Params(HttpConfig.H5_URL + "help/consultation/", "咨询指南")
h5param.isShowMenu = true
NewH5Activity.start(this, h5param)
}
rl_search.setOnClickListener {
ActionCountUtils.count(
ConsultBIConstants.ConsultEvent.YDL_USER_CONSULT_SEARCH_CLICK,
tv_search_content.hint.toString()
)
ARouter.getInstance()
.build("/consult/hot_search")
.withString(
ExpertSearchActivity.HOT_SEARCH_DOCTOR_NAME,
tv_search_content.text.toString()
)
.navigation()
}
}
}
\ No newline at end of file
......@@ -83,6 +83,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private var locationRegionItem: RegionItem? = null
private var locationList: ArrayList<SubItem>? = arrayListOf()
private var locationHistoryList: ArrayList<RegionItem>? = arrayListOf()
private lateinit var eightcategoryPopup: EightCategoryPopupWindow
override fun showImage(url: String?, imgView: ImageView) {
YDLImageCacheManager.showImage(ExpertSearchActivity@ this, url, imgView)
}
......@@ -213,6 +215,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private val doctorList = ArrayList<ExpertServiceItem>()
private var hasMore = true
private var initCategory = "0"
private var initCategoryCateid3 = "0"
private var initShowType: Int = 1
var mapFilter: Map<String, Any>? = null
......@@ -411,6 +414,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
mapFilter = mIntent.getSerializableExtra(GO_CRITERIA) as HashMap<String, Any>
}
initCategory = mIntent.getStringExtra("cateId") ?: ""
initCategoryCateid3 = mIntent.getStringExtra("cateid3in") ?: ""
if (!TextUtils.isEmpty(initCategoryCateid3) && initCategoryCateid3 != "0") {
allFilter.categoryId3List.add(initCategoryCateid3)
}
if (mIntent.getStringExtra("cateTitle") != null) {
cateName = mIntent.getStringExtra("cateTitle")
}
......@@ -1025,7 +1032,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
hideSoftInput()
appbar_layout.setExpanded(false)
appbar_layout.postDelayed({
showSubjectPopupWindow()
// showSubjectPopupWindow()
showeightCategoryPopupWindow()
}, 300)
}
......@@ -1665,6 +1673,22 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
/**
* 显示八大类弹窗
*/
private fun showeightCategoryPopupWindow() {
eightcategoryPopup = EightCategoryPopupWindow(this, allFilter)
eightcategoryPopup.setListener(this)
eightcategoryPopup.setOnDismissListener {
viewDim.visibility = View.INVISIBLE
ConsultAssistantDialogUtils.INSTANCE.fitRequest(this, "doctor_list", true)
}
ConsultAssistantDialogUtils.INSTANCE.hideAssistantActivity()
eightcategoryPopup.showAsDropDown(viewSep2)
updateFilterTextViewStatus(tvSubject, FILTER_STATUS_OPEN)
viewDim.visibility = View.VISIBLE
}
/**
* 主题选择确认回调
*
* 新增逻辑:当主题选择后,需要判断热门筛选中是否也有该主题,如果有,也需要同步更新选中状态
......
......@@ -45,6 +45,13 @@ class CategoryDetailAdapter(
outAdapterClicklistener.outAdapterClick(position, textPosition)
}
})
if (categoryDetailList[position].size > 9) {
holder.collapse_hide.visibility = View.VISIBLE
holder.arrow_collapse_hide.visibility = View.VISIBLE
} else {
holder.collapse_hide.visibility = View.GONE
holder.arrow_collapse_hide.visibility = View.GONE
}
if (categoryNamelList[position].collapse) {
eightCategoryAdapter.setAllVisible()
holder.collapse_hide.text = "收起"
......
......@@ -86,9 +86,6 @@ class CategoryDetailTextAdapter(
this.textAdapterOnclickListener = adapterOnclickListener
}
/**
* 设置大于第12个之后的标签全部显示
*/
fun setAllVisible() {
categoryDetailList.forEach { bean ->
bean.isVisible = true
......@@ -97,12 +94,9 @@ class CategoryDetailTextAdapter(
isVisible = true
}
/**
* 设置大于第12个之后的标签全部隐藏
*/
fun setGone() {
categoryDetailList.forEachIndexed { index, bean ->
if (index > 12) {
if (index > 8) {
bean.isVisible = false
}
}
......
package com.yidianling.consultant.adapter
import android.annotation.SuppressLint
import android.content.Context
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
......@@ -16,6 +17,7 @@ import kotlinx.android.synthetic.main.eight_category_list_item.view.*
class EightCategoryAdapter(
private val context: Context,
private val eightCateList: MutableList<EightCategoryBean>,
private val singleMultiple: Boolean
) : RecyclerView.Adapter<EightCategoryAdapter.ViewHolder>() {
lateinit var onLeftClickListener: OnLeftClickListener
override fun getItemCount(): Int = eightCateList.size
......@@ -26,15 +28,35 @@ class EightCategoryAdapter(
return ViewHolder(itemView)
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.eight_name.text = eightCateList[position].string
holder.itemView.setOnClickListener {
onLeftClickListener.onLeftClick(position)
}
if (eightCateList[position].selected) {
holder.itemView.setBackgroundColor(ContextCompat.getColor(context, R.color.white))
holder.eight_name.setTextColor(
ContextCompat.getColor(
context,
R.color.platform_main_theme
)
)
if (singleMultiple) {
holder.single_selected_tag.visibility = View.VISIBLE
} else {
holder.single_selected_tag.visibility = View.INVISIBLE
}
} else {
holder.eight_name.setTextColor(
ContextCompat.getColor(
context,
R.color.platform_color_242424
)
)
holder.single_selected_tag.visibility = View.INVISIBLE
holder.itemView.setBackgroundColor(
ContextCompat.getColor(
context,
......@@ -45,7 +67,7 @@ class EightCategoryAdapter(
if (eightCateList[position].hasData) {
holder.multiple_choise.visibility = View.VISIBLE
} else {
holder.multiple_choise.visibility = View.GONE
holder.multiple_choise.visibility = View.INVISIBLE
}
}
......@@ -61,6 +83,7 @@ class EightCategoryAdapter(
val eight_name = itemView.eight_name
val multiple_choise = itemView.multiple_choise
val single_selected_tag = itemView.single_selected_tag
}
}
\ No newline at end of file
......@@ -7,10 +7,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.consultant.bean.*
import com.yidianling.consultant.model.bean.ExpertBean
import com.yidianling.consultant.model.bean.FunctionWordBean
import com.yidianling.consultant.model.bean.HeadData
import com.yidianling.consultant.model.bean.PromptPaymentBean
import com.yidianling.consultant.model.bean.*
import io.reactivex.Observable
import retrofit2.http.*
......@@ -42,6 +39,11 @@ interface SearchApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun searchConditions(@Query("cateSource") cateSource: Int): Observable<BaseAPIResponse<HeadData>>
//查询八大类目包括
@GET("consult/search/v3/mix-cates")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun searchEightCategoryHotWord(): Observable<BaseAPIResponse<MutableList<CateItem>>>
//查询功能词、底纹词
//(1热门词,2底纹词,3跳转词)
@POST("function/word/queryList")
......
......@@ -51,8 +51,8 @@ class EightCategoryPopupWindow(context: Context, allFilter: AllFilter) :
fun setListener(onSubjectsSelectedListener: OnCategoriesSelectedListener) {
this.onSubjectsSelectedListener = onSubjectsSelectedListener
val eightCategoryView = EightCategoryView(context)
eightCategoryView.setData(mutableList, mAllFilter, onSubjectsSelectedListener)
val eightCategoryView = EightCategoryView(context, false)
eightCategoryView.setData(mutableList, mAllFilter, onSubjectsSelectedListener, false)
view.eight_category_fl.addView(eightCategoryView)
}
......
package com.yidianling.consultant.ui.view.topView
import android.app.Activity
import android.content.Context
import android.util.AttributeSet
import android.util.Log
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.LinearSmoothScroller
import androidx.recyclerview.widget.RecyclerView
import com.yidianling.common.tools.LogUtil
import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.common.tools.RxImageTool
import com.yidianling.consultant.R
import com.yidianling.consultant.adapter.CategoryDetailAdapter
......@@ -25,28 +28,37 @@ class EightCategoryView : LinearLayout, CategoryDetailAdapter.OutAdapterClicklis
EightCategoryAdapter.OnLeftClickListener {
constructor(context: Context) : super(context) {
constructor(context: Context, singleMultiple: Boolean) : super(context) {
mContext = context
initView()
initView(singleMultiple)
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
constructor(context: Context, attrs: AttributeSet, singleMultiple: Boolean) : super(
context,
attrs
) {
mContext = context
initView()
initView(singleMultiple)
}
constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(
constructor(
context: Context,
attrs: AttributeSet,
defStyle: Int,
singleMultiple: Boolean
) : super(
context,
attrs,
defStyle
) {
mContext = context
initView()
initView(singleMultiple)
}
private var mContext: Context? = null
private var mutableList: MutableList<MutableList<ChildrenBean>>? = null
private lateinit var mAllfilter: AllFilter
private var singleMultiple: Boolean = false
private var eightCategoryListBean = mutableListOf(
EightCategoryBean("亲子教育", false, false, false),
EightCategoryBean("情绪压力", false, false, false),
......@@ -62,13 +74,24 @@ class EightCategoryView : LinearLayout, CategoryDetailAdapter.OutAdapterClicklis
private val signList = ArrayList<String>() // 用于埋点
var onSubjectsSelectedListener: OnCategoriesSelectedListener? = null
var isDrag = false
private fun initView() {
layoutParams = LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
RxImageTool.dp2px(466f)
)
var leftmanager: LinearLayoutManager = LinearLayoutManager(context)
private fun initView(singleMultiple: Boolean) {
View.inflate(mContext, R.layout.consultant_layout_category_view, this)
if (singleMultiple) {
layoutParams = LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
)
} else {
layoutParams = LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
RxImageTool.dp2px(466f)
)
ll_view.layoutParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
RxImageTool.dp2px(400f)
)
}
// 重置
btn_reset.setOnClickListener {
reset()
......@@ -76,7 +99,6 @@ class EightCategoryView : LinearLayout, CategoryDetailAdapter.OutAdapterClicklis
// 确定
btnConfirm.setOnClickListener {
onSubjectsSelectedListener?.onCategoriesSelected(signList)
}
}
......@@ -95,20 +117,27 @@ class EightCategoryView : LinearLayout, CategoryDetailAdapter.OutAdapterClicklis
fun setData(
mutableList: MutableList<MutableList<ChildrenBean>>,
mAllFilter: AllFilter,
onSubjectsSelectedListener: OnCategoriesSelectedListener
mAllFilter: AllFilter?,
onSubjectsSelectedListener: OnCategoriesSelectedListener?,
singleMultiple: Boolean
) {
this.mutableList = mutableList
this.mAllfilter = mAllFilter
mAllFilter?.let { this.mAllfilter = it }
if (singleMultiple) {
eightCategoryListBean.add(0, EightCategoryBean("热门推荐", false, false, false))
}
this.onSubjectsSelectedListener = onSubjectsSelectedListener
eightCategoryAdapter = mContext?.let { EightCategoryAdapter(it, eightCategoryListBean) }!!
this.singleMultiple = singleMultiple
ComputeSelected(mutableList, mAllFilter)
eightCategoryAdapter =
mContext?.let { EightCategoryAdapter(it, eightCategoryListBean, singleMultiple) }!!
eightCategoryAdapter.setleftClick(this)
eight_category.layoutManager = LinearLayoutManager(mContext)
eight_category.adapter = eightCategoryAdapter
categoryRightAdapter = CategoryDetailAdapter(mContext!!, mutableList, eightCategoryListBean)
val manager = LinearLayoutManager(mContext)
category_detail.layoutManager = manager
leftmanager = LinearLayoutManager(mContext)
category_detail.layoutManager = leftmanager
category_detail.adapter = categoryRightAdapter
categoryRightAdapter.setOutClicklistener(this)
category_detail.setOnScrollListener(object : RecyclerView.OnScrollListener() {
......@@ -122,7 +151,7 @@ class EightCategoryView : LinearLayout, CategoryDetailAdapter.OutAdapterClicklis
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
if (!isDrag) {
var firstVisibleItem: Int = manager.findFirstVisibleItemPosition()
var firstVisibleItem: Int = leftmanager.findFirstVisibleItemPosition()
eightCategoryListBean.forEachIndexed { index, eightCategoryBean ->
eightCategoryListBean[index].selected = index == firstVisibleItem
}
......@@ -132,67 +161,103 @@ class EightCategoryView : LinearLayout, CategoryDetailAdapter.OutAdapterClicklis
})
}
private fun ComputeSelected(
mutableList: MutableList<MutableList<ChildrenBean>>,
mAllFilter: AllFilter?
) {
mutableList.forEachIndexed { index, mutable ->
mutable.forEachIndexed { indexin, childrenBean ->
if (mAllFilter?.categoryId3List?.contains(childrenBean.cate_id) == true) {
childrenBean.isSelected = true
eightCategoryListBean.get(index).hasData = true
return@ComputeSelected
}
}
}
}
override fun outAdapterClick(outPosition: Int, inPosition: Int) {
//之前的老数据多选分类页。
if (inPosition == 0) {
if (mutableList?.get(outPosition)?.get(0)?.isSelected!!) {
mutableList?.get(outPosition)?.get(0)?.isSelected = false
mAllfilter.categoryId2List.remove(mutableList?.get(outPosition)?.get(0)?.cate_id)
signList.remove(eightCategoryListBean[outPosition].string)
} else {
mutableList?.get(outPosition)?.forEachIndexed { index, _ ->
mutableList?.get(outPosition)?.get(index)?.isSelected = index == 0
if (index == 0) {
mutableList?.get(outPosition)?.get(0)?.cate_id?.let {
mAllfilter.categoryId2List.add(
it
if (!singleMultiple) {
if (inPosition == 0) {
if (mutableList?.get(outPosition)?.get(0)?.isSelected!!) {
mutableList?.get(outPosition)?.get(0)?.isSelected = false
mAllfilter.categoryId2List.remove(
mutableList?.get(outPosition)?.get(0)?.cate_id
)
signList.remove(eightCategoryListBean[outPosition].string)
} else {
mutableList?.get(outPosition)?.forEachIndexed { index, _ ->
mutableList?.get(outPosition)?.get(index)?.isSelected = index == 0
if (index == 0) {
mutableList?.get(outPosition)?.get(0)?.cate_id?.let {
mAllfilter.categoryId2List.add(
it
)
}
signList.add(eightCategoryListBean[outPosition].string)
} else {
mAllfilter.categoryId3List.remove(
mutableList?.get(outPosition)?.get(index)?.cate_id
)
signList.remove(mutableList?.get(outPosition)?.get(index)?.cate_name)
}
signList.add(eightCategoryListBean[outPosition].string)
} else {
mAllfilter.categoryId3List.remove(
mutableList?.get(outPosition)?.get(index)?.cate_id
)
signList.remove(mutableList?.get(outPosition)?.get(index)?.cate_name)
}
}
}
} else {
if (!mutableList?.get(outPosition)?.get(inPosition)?.isSelected!! && mutableList?.get(
outPosition
)?.get(0)?.isSelected!!
) {
mutableList?.get(outPosition)?.get(0)?.isSelected = false
mAllfilter.categoryId2List.remove(mutableList?.get(outPosition)?.get(0)?.cate_id)
signList.remove(eightCategoryListBean[outPosition].string)
}
mutableList?.get(outPosition)?.get(inPosition)?.isSelected =
!mutableList?.get(outPosition)?.get(inPosition)?.isSelected!!
if (mutableList?.get(outPosition)?.get(inPosition)?.isSelected!!) {
mutableList?.get(outPosition)?.get(inPosition)?.cate_id?.let {
mAllfilter.categoryId3List.add(
it
} else {
if (!mutableList?.get(outPosition)
?.get(inPosition)?.isSelected!! && mutableList?.get(
outPosition
)?.get(0)?.isSelected!!
) {
mutableList?.get(outPosition)?.get(0)?.isSelected = false
mAllfilter.categoryId2List.remove(
mutableList?.get(outPosition)?.get(0)?.cate_id
)
signList.remove(eightCategoryListBean[outPosition].string)
}
mutableList?.get(outPosition)?.get(inPosition)?.isSelected =
!mutableList?.get(outPosition)?.get(inPosition)?.isSelected!!
if (mutableList?.get(outPosition)?.get(inPosition)?.isSelected!!) {
mutableList?.get(outPosition)?.get(inPosition)?.cate_id?.let {
mAllfilter.categoryId3List.add(
it
)
}
mutableList?.get(outPosition)
?.get(inPosition)?.cate_name?.let { signList.add(it) }
} else {
mAllfilter.categoryId3List.remove(
mutableList?.get(outPosition)?.get(inPosition)?.cate_id
)
signList.remove(mutableList?.get(outPosition)?.get(inPosition)?.cate_name)
}
mutableList?.get(outPosition)?.get(inPosition)?.cate_name?.let { signList.add(it) }
} else {
mAllfilter.categoryId3List.remove(
mutableList?.get(outPosition)?.get(inPosition)?.cate_id
)
signList.remove(mutableList?.get(outPosition)?.get(inPosition)?.cate_name)
}
}
mutableList?.forEachIndexed { index, mutableList ->
eightCategoryListBean.get(index).hasData = false
mutableList.forEachIndexed { indexin, childrenBean ->
if (childrenBean.isSelected) {
eightCategoryListBean.get(index).hasData = true
return@forEachIndexed
mutableList?.forEachIndexed { index, mutableList ->
eightCategoryListBean.get(index).hasData = false
mutableList.forEachIndexed { indexin, childrenBean ->
if (childrenBean.isSelected) {
eightCategoryListBean.get(index).hasData = true
return@forEachIndexed
}
}
}
eightCategoryAdapter.notifyDataSetChanged()
categoryRightAdapter.notifyDataSetChanged()
} else {
//单选跳转咨询列表页
ARouter.getInstance().build("/consult/list")
.withInt(IYDLRouterConstant.EXTRA_SHOWTYPE, 0)
.withString("cateid3in", mutableList?.get(outPosition)?.get(inPosition)?.cate_id)
.withString(
IYDLRouterConstant.EXTRA_CATETITLE,
mutableList?.get(outPosition)?.get(inPosition)?.cate_name
)
.navigation()
(context as BaseActivity).finish()
}
eightCategoryAdapter.notifyDataSetChanged()
categoryRightAdapter.notifyDataSetChanged()
}
override fun onLeftClick(leftPosition: Int) {
......@@ -201,6 +266,8 @@ class EightCategoryView : LinearLayout, CategoryDetailAdapter.OutAdapterClicklis
}
eightCategoryAdapter.notifyDataSetChanged()
isDrag = true
category_detail.scrollToPosition(leftPosition)
val smoothScroller: LinearSmoothScroller = LinearTopSmoothScroller(context)
smoothScroller.targetPosition = leftPosition
leftmanager.startSmoothScroll(smoothScroller)
}
}
\ No newline at end of file
package com.yidianling.consultant.ui.view.topView
import android.content.Context
import androidx.recyclerview.widget.LinearSmoothScroller
class LinearTopSmoothScroller(context: Context?) : LinearSmoothScroller(context) {
override fun getVerticalSnapPreference(): Int {
return SNAP_TO_START
}
}
\ No newline at end of file
......@@ -8,18 +8,19 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp">
android:id="@+id/ll_view"
android:layout_height="wrap_content">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/eight_category"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:orientation="vertical"></androidx.recyclerview.widget.RecyclerView>
android:orientation="vertical" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/category_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"></androidx.recyclerview.widget.RecyclerView>
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
......
<?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">
<include
layout="@layout/consultant_layout_search_toolbar"
android:layout_width="match_parent"
android:layout_height="48dp" />
<LinearLayout
android:id="@+id/eight_view_ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:gravity="center"
android:orientation="horizontal">
<View
android:id="@+id/single_selected_tag"
android:layout_width="3dp"
android:layout_height="@dimen/platform_dp_20"
android:layout_height="@dimen/platform_dp_15"
android:background="@color/platform_main_theme"
android:visibility="gone"></View>
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/multiple_choise"
......@@ -19,6 +23,9 @@
android:layout_height="wrap_content"
android:background="@drawable/alert_selected"
android:backgroundTint="@color/platform_main_theme"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone">
</ImageView>
......@@ -31,8 +38,12 @@
android:layout_marginTop="@dimen/platform_dp_15"
android:layout_marginBottom="@dimen/platform_dp_15"
android:textColor="@color/color_242424"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:textSize="@dimen/sp_14"
tools:text="情绪压力">
</TextView>
</LinearLayout>
\ No newline at end of file
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -271,11 +271,15 @@ open class HomeBaseImpl : IHomeBaseEvent {
} else if (data.goType.equals("h5")) {
NewH5Activity.start(mContext, H5Params(data.goUrl.toString(), ""))
} else if (data.goType.equals("special_categories")) {
ARouter.getInstance().build("/consult/list")
.withInt(IYDLRouterConstant.EXTRA_SHOWTYPE, 0)
.withString(IYDLRouterConstant.EXTRA_CATETITLE, data.title)
.withSerializable(IYDLRouterConstant.GO_CRITERIA, data.goCriteriaMap)
//全部
ARouter.getInstance().build("/consult/eightcategory")
.navigation()
// ARouter.getInstance().build("/consult/list")
// .withInt(IYDLRouterConstant.EXTRA_SHOWTYPE, 0)
// .withString(IYDLRouterConstant.EXTRA_CATETITLE, data.title)
// .withSerializable(IYDLRouterConstant.GO_CRITERIA, data.goCriteriaMap)
// .navigation()
} else {
ARouter.getInstance().build("/consult/list")
.withInt(IYDLRouterConstant.EXTRA_SHOWTYPE, 0)
......
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