Commit cd3bc428 by 严久程

Merge branch '咨询加声网' of ssh://gitlab.yidianling.com:2224/app_android_lib/YDL-Component into 咨询加声网

 Conflicts:
	config.gradle
parents 76ea785b 44c7d0a2
...@@ -46,7 +46,7 @@ ext { ...@@ -46,7 +46,7 @@ ext {
"m-consultant" : "0.0.59.0", "m-consultant" : "0.0.59.0",
"m-fm" : "0.0.29.3", "m-fm" : "0.0.29.3",
"m-user" : "0.0.60.4", "m-user" : "0.0.60.4",
"m-home" : "0.0.21.4", "m-home" : "0.0.21.9",
"m-im" : "0.0.18.0", "m-im" : "0.0.18.0",
"m-dynamic" : "0.0.7.5", "m-dynamic" : "0.0.7.5",
......
...@@ -307,7 +307,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -307,7 +307,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
override fun setUserVisibleHint(isVisibleToUser: Boolean) { override fun setUserVisibleHint(isVisibleToUser: Boolean) {
super.setUserVisibleHint(isVisibleToUser) super.setUserVisibleHint(isVisibleToUser)
if (isVisibleToUser && isResumed && userVisibleHint) { if (isVisibleToUser && isResumed) {
showConsultAssistantDialog() showConsultAssistantDialog()
} else { } else {
hideConsultAssistantDialog() hideConsultAssistantDialog()
...@@ -315,7 +315,6 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -315,7 +315,6 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if (isVisibleToUser && isResumed) { if (isVisibleToUser && isResumed) {
onResume() onResume()
} }
} }
private fun showConsultAssistantDialog() { private fun showConsultAssistantDialog() {
......
...@@ -204,14 +204,14 @@ class ConsultAssistantDialogUtils private constructor() { ...@@ -204,14 +204,14 @@ class ConsultAssistantDialogUtils private constructor() {
* 咨询师列表页Fragment隐藏 * 咨询师列表页Fragment隐藏
*/ */
fun hide() { fun hide() {
consultAssistantFragmentDialog?.hide() consultAssistantFragmentDialog?.dismiss()
} }
/** /**
* 咨询师列表页Fragment隐藏 * 咨询师列表页Fragment隐藏
*/ */
fun hideAssistantActivity() { fun hideAssistantActivity() {
consultAssistantActivityDialog?.hide() consultAssistantActivityDialog?.dismiss()
} }
/** /**
......
...@@ -6,14 +6,13 @@ import android.support.v7.widget.RecyclerView ...@@ -6,14 +6,13 @@ import android.support.v7.widget.RecyclerView
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.FrameLayout import android.widget.*
import android.widget.LinearLayout
import com.ydl.ydlcommon.data.PlatformDataManager import com.ydl.ydlcommon.data.PlatformDataManager
import com.yidianling.common.tools.RxImageTool import com.yidianling.common.tools.RxImageTool
import com.yidianling.home.R import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeHeaderBean import com.yidianling.home.model.bean.HomeHeaderBean
import kotlinx.android.synthetic.xlzx.home_button_banner_view.view.* import com.yidianling.home.ui.widget.HomeModuleCategoryView
/** /**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a> * @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
...@@ -38,6 +37,8 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent: ...@@ -38,6 +37,8 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
*/ */
var hasRealTestView: Boolean = false var hasRealTestView: Boolean = false
var mView: View? = null
private var realTestView: HomePagerBannerRealView? = null private var realTestView: HomePagerBannerRealView? = null
/** /**
* 线 * 线
...@@ -55,42 +56,48 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent: ...@@ -55,42 +56,48 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
ViewGroup.LayoutParams.WRAP_CONTENT ViewGroup.LayoutParams.WRAP_CONTENT
) )
layoutParams = params layoutParams = params
View.inflate(mContext, R.layout.home_button_banner_view, this)
val ffrom = PlatformDataManager.getRam().getChannelName()
if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
mView = View.inflate(mContext, R.layout.home_button_banner_view_huawei, this)
} else {
mView = View.inflate(mContext, R.layout.home_button_banner_view, this)
}
// initButtonView() // initButtonView()
val ffrom = PlatformDataManager.getRam().getChannelName()
if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) { if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
homeModuleButtonBannerFirst.background = mView!!.findViewById<ImageView>(R.id.homeModuleButtonBannerFirst).background =
resources.getDrawable(R.drawable.home_dcotor_bt_bg_huawei) resources.getDrawable(R.drawable.home_dcotor_bt_bg_huawei)
homeModuleButtonBannerSecond.background = mView!!.findViewById<ImageView>(R.id.homeModuleButtonBannerSecond).background =
resources.getDrawable(R.drawable.home_test_bt_bg_hauwei) resources.getDrawable(R.drawable.home_test_bt_bg_hauwei)
homeModuleButtonBannerThird.background = mView!!.findViewById<ImageView>(R.id.homeModuleButtonBannerThird).background =
resources.getDrawable(R.drawable.home_course_bt_bg_huawei) resources.getDrawable(R.drawable.home_course_bt_bg_huawei)
homeModuleButtonBannerFourth.background = mView!!.findViewById<ImageView>(R.id.homeModuleButtonBannerFourth).background =
resources.getDrawable(R.drawable.home_listen_bt_bg_huawei) resources.getDrawable(R.drawable.home_listen_bt_bg_huawei)
homeModuleButtonBannerFirstTitle.setTextColor(Color.WHITE) mView!!.findViewById<TextView>(R.id.homeModuleButtonBannerFirstTitle).setTextColor(Color.WHITE)
tv_first_text.setTextColor(Color.WHITE) mView!!.findViewById<TextView>(R.id.tv_first_text).setTextColor(Color.WHITE)
homeModuleButtonBannerFourthTitle.setTextColor(Color.WHITE) mView!!.findViewById<TextView>(R.id.homeModuleButtonBannerFourthTitle).setTextColor(Color.WHITE)
tv_second_text.setTextColor(Color.WHITE) mView!!.findViewById<TextView>(R.id.tv_second_text).setTextColor(Color.WHITE)
homeModuleButtonBannerThirdTitle.setTextColor(Color.WHITE) mView!!.findViewById<TextView>(R.id.homeModuleButtonBannerThirdTitle).setTextColor(Color.WHITE)
tv_third_text.setTextColor(Color.WHITE) mView!!.findViewById<TextView>(R.id.tv_third_text).setTextColor(Color.WHITE)
homeModuleButtonBannerSecondTitle.setTextColor(Color.WHITE) mView!!.findViewById<TextView>(R.id.homeModuleButtonBannerSecondTitle).setTextColor(Color.WHITE)
tv_fourth_text.setTextColor(Color.WHITE) mView!!.findViewById<TextView>(R.id.tv_fourth_text).setTextColor(Color.WHITE)
} }
homeModuleButtonBannerFirst.setOnClickListener { mView!!.findViewById<RelativeLayout>(R.id.homeModuleButtonBannerFirst).setOnClickListener {
homeEvent?.reservationExpertsClick() homeEvent?.reservationExpertsClick()
} }
homeModuleButtonBannerSecond.setOnClickListener { mView!!.findViewById<RelativeLayout>(R.id.homeModuleButtonBannerSecond).setOnClickListener {
homeEvent?.nowConfideClick() homeEvent?.nowConfideClick()
} }
homeModuleButtonBannerThird.setOnClickListener { mView!!.findViewById<RelativeLayout>(R.id.homeModuleButtonBannerThird).setOnClickListener {
homeEvent?.psychologyClassClick() homeEvent?.psychologyClassClick()
} }
homeModuleButtonBannerFourth.setOnClickListener { mView!!.findViewById<RelativeLayout>(R.id.homeModuleButtonBannerFourth).setOnClickListener {
homeEvent?.psychologyTestClick() homeEvent?.psychologyTestClick()
} }
} }
...@@ -101,8 +108,8 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent: ...@@ -101,8 +108,8 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
homeCategory: List<HomeHeaderBean.AskCategoryDataBean>? homeCategory: List<HomeHeaderBean.AskCategoryDataBean>?
) { ) {
setRealTextView(homeSaleData) setRealTextView(homeSaleData)
homeEvent?.let { home_category_view.setEvent(it) }; homeEvent?.let { mView!!.findViewById<HomeModuleCategoryView>(R.id.home_category_view).setEvent(it) };
home_category_view.initData(homeCategory) mView!!.findViewById<HomeModuleCategoryView>(R.id.home_category_view).initData(homeCategory)
} }
/** /**
...@@ -137,9 +144,9 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent: ...@@ -137,9 +144,9 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
private fun setRealTextView(list: List<HomeHeaderBean.HomeSaleDataBean>?) { private fun setRealTextView(list: List<HomeHeaderBean.HomeSaleDataBean>?) {
if (!hasRealTestView) { if (!hasRealTestView) {
initLineView() initLineView()
ll_home_module_button.addView(lineView) mView!!.findViewById<LinearLayout>(R.id.ll_home_module_button).addView(lineView)
initRealTextView() initRealTextView()
ll_home_module_button.addView(realTestView) mView!!.findViewById<LinearLayout>(R.id.ll_home_module_button).addView(realTestView)
val cutOffParams = FrameLayout.LayoutParams( val cutOffParams = FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT,
...@@ -150,7 +157,7 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent: ...@@ -150,7 +157,7 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
cutOffView.setBackgroundColor(resources.getColor(R.color.home_colorBg)) cutOffView.setBackgroundColor(resources.getColor(R.color.home_colorBg))
cutOffView.layoutParams = cutOffParams cutOffView.layoutParams = cutOffParams
ll_home_module_button.addView(cutOffView) mView!!.findViewById<LinearLayout>(R.id.ll_home_module_button).addView(cutOffView)
hasRealTestView = true hasRealTestView = true
} }
......
...@@ -5,6 +5,11 @@ ...@@ -5,6 +5,11 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<com.yidianling.home.ui.widget.HomeModuleCategoryView
android:id="@+id/home_category_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -141,9 +146,4 @@ ...@@ -141,9 +146,4 @@
</LinearLayout> </LinearLayout>
<com.yidianling.home.ui.widget.HomeModuleCategoryView
android:id="@+id/home_category_view"
android:layout_width="match_parent"
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:id="@+id/ll_home_module_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="8dp"
android:layout_marginRight="15dp"
android:gravity="center_horizontal"
android:paddingBottom="12dp"
android:orientation="horizontal">
<RelativeLayout
android:id="@+id/homeModuleButtonBannerFirst"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_weight="1"
android:background="@drawable/home_dcotor_bt_bg"
android:gravity="center_horizontal">
<TextView
android:id="@+id/homeModuleButtonBannerFirstTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:text="预约咨询"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_first_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleButtonBannerFirstTitle"
android:text="1W+师资"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_11" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/homeModuleButtonBannerFourth"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_weight="1"
android:background="@drawable/home_listen_bt_bg"
android:gravity="center_horizontal">
<TextView
android:id="@+id/homeModuleButtonBannerFourthTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:text="心理测试"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_second_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleButtonBannerFourthTitle"
android:text="专业权威"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_11" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/homeModuleButtonBannerThird"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_weight="1"
android:background="@drawable/home_course_bt_bg"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/homeModuleButtonBannerThirdTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:text="心理课堂"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_third_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleButtonBannerThirdTitle"
android:text="学习与成长"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_11" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/homeModuleButtonBannerSecond"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_weight="1"
android:background="@drawable/home_test_bt_bg"
android:gravity="center_horizontal">
<TextView
android:id="@+id/homeModuleButtonBannerSecondTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="7dp"
android:text="即时倾诉"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_fourth_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleButtonBannerSecondTitle"
android:layout_centerVertical="true"
android:text="专业解忧"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_11" />
</RelativeLayout>
</LinearLayout>
<com.yidianling.home.ui.widget.HomeModuleCategoryView
android:id="@+id/home_category_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
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