Commit f1271f4c by 霍志良

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

parent 6328d9be
...@@ -7,17 +7,22 @@ ...@@ -7,17 +7,22 @@
android:name=".ExpertSearchActivity" android:name=".ExpertSearchActivity"
android:launchMode="singleTask" android:launchMode="singleTask"
android:screenOrientation="portrait" 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 <activity
android:name=".HotSearchActivity" android:name=".HotSearchActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/consultant_NoTitleTheme"/> android:theme="@style/consultant_NoTitleTheme" />
<activity <activity
android:name=".ConsultAssistantCenterActivity" android:name=".ConsultAssistantCenterActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/consultant_Transparent"/> android:theme="@style/consultant_Transparent" />
<activity android:name=".preview.GridPreviewActivity" <activity android:name=".preview.GridPreviewActivity"
android:screenOrientation="portrait" 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 ...@@ -83,6 +83,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private var locationRegionItem: RegionItem? = null private var locationRegionItem: RegionItem? = null
private var locationList: ArrayList<SubItem>? = arrayListOf() private var locationList: ArrayList<SubItem>? = arrayListOf()
private var locationHistoryList: ArrayList<RegionItem>? = arrayListOf() private var locationHistoryList: ArrayList<RegionItem>? = arrayListOf()
private lateinit var eightcategoryPopup: EightCategoryPopupWindow
override fun showImage(url: String?, imgView: ImageView) { override fun showImage(url: String?, imgView: ImageView) {
YDLImageCacheManager.showImage(ExpertSearchActivity@ this, url, imgView) YDLImageCacheManager.showImage(ExpertSearchActivity@ this, url, imgView)
} }
...@@ -213,6 +215,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -213,6 +215,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private val doctorList = ArrayList<ExpertServiceItem>() private val doctorList = ArrayList<ExpertServiceItem>()
private var hasMore = true private var hasMore = true
private var initCategory = "0" private var initCategory = "0"
private var initCategoryCateid3 = "0"
private var initShowType: Int = 1 private var initShowType: Int = 1
var mapFilter: Map<String, Any>? = null var mapFilter: Map<String, Any>? = null
...@@ -411,6 +414,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -411,6 +414,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
mapFilter = mIntent.getSerializableExtra(GO_CRITERIA) as HashMap<String, Any> mapFilter = mIntent.getSerializableExtra(GO_CRITERIA) as HashMap<String, Any>
} }
initCategory = mIntent.getStringExtra("cateId") ?: "" initCategory = mIntent.getStringExtra("cateId") ?: ""
initCategoryCateid3 = mIntent.getStringExtra("cateid3in") ?: ""
if (!TextUtils.isEmpty(initCategoryCateid3) && initCategoryCateid3 != "0") {
allFilter.categoryId3List.add(initCategoryCateid3)
}
if (mIntent.getStringExtra("cateTitle") != null) { if (mIntent.getStringExtra("cateTitle") != null) {
cateName = mIntent.getStringExtra("cateTitle") cateName = mIntent.getStringExtra("cateTitle")
} }
...@@ -1025,7 +1032,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1025,7 +1032,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
hideSoftInput() hideSoftInput()
appbar_layout.setExpanded(false) appbar_layout.setExpanded(false)
appbar_layout.postDelayed({ appbar_layout.postDelayed({
showSubjectPopupWindow() // showSubjectPopupWindow()
showeightCategoryPopupWindow()
}, 300) }, 300)
} }
...@@ -1665,6 +1673,22 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -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( ...@@ -45,6 +45,13 @@ class CategoryDetailAdapter(
outAdapterClicklistener.outAdapterClick(position, textPosition) 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) { if (categoryNamelList[position].collapse) {
eightCategoryAdapter.setAllVisible() eightCategoryAdapter.setAllVisible()
holder.collapse_hide.text = "收起" holder.collapse_hide.text = "收起"
......
...@@ -86,9 +86,6 @@ class CategoryDetailTextAdapter( ...@@ -86,9 +86,6 @@ class CategoryDetailTextAdapter(
this.textAdapterOnclickListener = adapterOnclickListener this.textAdapterOnclickListener = adapterOnclickListener
} }
/**
* 设置大于第12个之后的标签全部显示
*/
fun setAllVisible() { fun setAllVisible() {
categoryDetailList.forEach { bean -> categoryDetailList.forEach { bean ->
bean.isVisible = true bean.isVisible = true
...@@ -97,12 +94,9 @@ class CategoryDetailTextAdapter( ...@@ -97,12 +94,9 @@ class CategoryDetailTextAdapter(
isVisible = true isVisible = true
} }
/**
* 设置大于第12个之后的标签全部隐藏
*/
fun setGone() { fun setGone() {
categoryDetailList.forEachIndexed { index, bean -> categoryDetailList.forEachIndexed { index, bean ->
if (index > 12) { if (index > 8) {
bean.isVisible = false bean.isVisible = false
} }
} }
......
package com.yidianling.consultant.adapter package com.yidianling.consultant.adapter
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater import android.view.LayoutInflater
...@@ -16,6 +17,7 @@ import kotlinx.android.synthetic.main.eight_category_list_item.view.* ...@@ -16,6 +17,7 @@ import kotlinx.android.synthetic.main.eight_category_list_item.view.*
class EightCategoryAdapter( class EightCategoryAdapter(
private val context: Context, private val context: Context,
private val eightCateList: MutableList<EightCategoryBean>, private val eightCateList: MutableList<EightCategoryBean>,
private val singleMultiple: Boolean
) : RecyclerView.Adapter<EightCategoryAdapter.ViewHolder>() { ) : RecyclerView.Adapter<EightCategoryAdapter.ViewHolder>() {
lateinit var onLeftClickListener: OnLeftClickListener lateinit var onLeftClickListener: OnLeftClickListener
override fun getItemCount(): Int = eightCateList.size override fun getItemCount(): Int = eightCateList.size
...@@ -26,15 +28,35 @@ class EightCategoryAdapter( ...@@ -26,15 +28,35 @@ class EightCategoryAdapter(
return ViewHolder(itemView) return ViewHolder(itemView)
} }
override fun onBindViewHolder(holder: ViewHolder, position: Int) { override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.eight_name.text = eightCateList[position].string holder.eight_name.text = eightCateList[position].string
holder.itemView.setOnClickListener { holder.itemView.setOnClickListener {
onLeftClickListener.onLeftClick(position) onLeftClickListener.onLeftClick(position)
} }
if (eightCateList[position].selected) { if (eightCateList[position].selected) {
holder.itemView.setBackgroundColor(ContextCompat.getColor(context, R.color.white)) 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 { } else {
holder.eight_name.setTextColor(
ContextCompat.getColor(
context,
R.color.platform_color_242424
)
)
holder.single_selected_tag.visibility = View.INVISIBLE
holder.itemView.setBackgroundColor( holder.itemView.setBackgroundColor(
ContextCompat.getColor( ContextCompat.getColor(
context, context,
...@@ -45,7 +67,7 @@ class EightCategoryAdapter( ...@@ -45,7 +67,7 @@ class EightCategoryAdapter(
if (eightCateList[position].hasData) { if (eightCateList[position].hasData) {
holder.multiple_choise.visibility = View.VISIBLE holder.multiple_choise.visibility = View.VISIBLE
} else { } else {
holder.multiple_choise.visibility = View.GONE holder.multiple_choise.visibility = View.INVISIBLE
} }
} }
...@@ -61,6 +83,7 @@ class EightCategoryAdapter( ...@@ -61,6 +83,7 @@ class EightCategoryAdapter(
val eight_name = itemView.eight_name val eight_name = itemView.eight_name
val multiple_choise = itemView.multiple_choise 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 ...@@ -7,10 +7,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlnet.YDLHttpUtils import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.consultant.bean.* import com.yidianling.consultant.bean.*
import com.yidianling.consultant.model.bean.ExpertBean import com.yidianling.consultant.model.bean.*
import com.yidianling.consultant.model.bean.FunctionWordBean
import com.yidianling.consultant.model.bean.HeadData
import com.yidianling.consultant.model.bean.PromptPaymentBean
import io.reactivex.Observable import io.reactivex.Observable
import retrofit2.http.* import retrofit2.http.*
...@@ -42,6 +39,11 @@ interface SearchApi { ...@@ -42,6 +39,11 @@ interface SearchApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun searchConditions(@Query("cateSource") cateSource: Int): Observable<BaseAPIResponse<HeadData>> 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跳转词) //(1热门词,2底纹词,3跳转词)
@POST("function/word/queryList") @POST("function/word/queryList")
......
...@@ -51,8 +51,8 @@ class EightCategoryPopupWindow(context: Context, allFilter: AllFilter) : ...@@ -51,8 +51,8 @@ class EightCategoryPopupWindow(context: Context, allFilter: AllFilter) :
fun setListener(onSubjectsSelectedListener: OnCategoriesSelectedListener) { fun setListener(onSubjectsSelectedListener: OnCategoriesSelectedListener) {
this.onSubjectsSelectedListener = onSubjectsSelectedListener this.onSubjectsSelectedListener = onSubjectsSelectedListener
val eightCategoryView = EightCategoryView(context) val eightCategoryView = EightCategoryView(context, false)
eightCategoryView.setData(mutableList, mAllFilter, onSubjectsSelectedListener) eightCategoryView.setData(mutableList, mAllFilter, onSubjectsSelectedListener, false)
view.eight_category_fl.addView(eightCategoryView) view.eight_category_fl.addView(eightCategoryView)
} }
......
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 @@ ...@@ -8,18 +8,19 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="400dp"> android:id="@+id/ll_view"
android:layout_height="wrap_content">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/eight_category" android:id="@+id/eight_category"
android:layout_width="90dp" android:layout_width="90dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"></androidx.recyclerview.widget.RecyclerView> android:orientation="vertical" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/category_detail" android:id="@+id/category_detail"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"></androidx.recyclerview.widget.RecyclerView> android:layout_height="wrap_content" />
</LinearLayout> </LinearLayout>
<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"?> <?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" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:gravity="center" android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal">
<View <View
android:id="@+id/single_selected_tag" android:id="@+id/single_selected_tag"
android:layout_width="3dp" 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: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 <ImageView
android:id="@+id/multiple_choise" android:id="@+id/multiple_choise"
...@@ -19,6 +23,9 @@ ...@@ -19,6 +23,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/alert_selected" android:background="@drawable/alert_selected"
android:backgroundTint="@color/platform_main_theme" android:backgroundTint="@color/platform_main_theme"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone"> android:visibility="gone">
</ImageView> </ImageView>
...@@ -31,8 +38,12 @@ ...@@ -31,8 +38,12 @@
android:layout_marginTop="@dimen/platform_dp_15" android:layout_marginTop="@dimen/platform_dp_15"
android:layout_marginBottom="@dimen/platform_dp_15" android:layout_marginBottom="@dimen/platform_dp_15"
android:textColor="@color/color_242424" 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" android:textSize="@dimen/sp_14"
tools:text="情绪压力"> tools:text="情绪压力">
</TextView> </TextView>
</LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file \ No newline at end of file
...@@ -271,11 +271,15 @@ open class HomeBaseImpl : IHomeBaseEvent { ...@@ -271,11 +271,15 @@ open class HomeBaseImpl : IHomeBaseEvent {
} else if (data.goType.equals("h5")) { } else if (data.goType.equals("h5")) {
NewH5Activity.start(mContext, H5Params(data.goUrl.toString(), "")) NewH5Activity.start(mContext, H5Params(data.goUrl.toString(), ""))
} else if (data.goType.equals("special_categories")) { } else if (data.goType.equals("special_categories")) {
ARouter.getInstance().build("/consult/list") //全部
.withInt(IYDLRouterConstant.EXTRA_SHOWTYPE, 0) ARouter.getInstance().build("/consult/eightcategory")
.withString(IYDLRouterConstant.EXTRA_CATETITLE, data.title)
.withSerializable(IYDLRouterConstant.GO_CRITERIA, data.goCriteriaMap)
.navigation() .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 { } else {
ARouter.getInstance().build("/consult/list") ARouter.getInstance().build("/consult/list")
.withInt(IYDLRouterConstant.EXTRA_SHOWTYPE, 0) .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