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 {
"m-consultant" : "0.0.59.0",
"m-fm" : "0.0.29.3",
"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-dynamic" : "0.0.7.5",
......
......@@ -307,7 +307,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
override fun setUserVisibleHint(isVisibleToUser: Boolean) {
super.setUserVisibleHint(isVisibleToUser)
if (isVisibleToUser && isResumed && userVisibleHint) {
if (isVisibleToUser && isResumed) {
showConsultAssistantDialog()
} else {
hideConsultAssistantDialog()
......@@ -315,7 +315,6 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if (isVisibleToUser && isResumed) {
onResume()
}
}
private fun showConsultAssistantDialog() {
......
......@@ -204,14 +204,14 @@ class ConsultAssistantDialogUtils private constructor() {
* 咨询师列表页Fragment隐藏
*/
fun hide() {
consultAssistantFragmentDialog?.hide()
consultAssistantFragmentDialog?.dismiss()
}
/**
* 咨询师列表页Fragment隐藏
*/
fun hideAssistantActivity() {
consultAssistantActivityDialog?.hide()
consultAssistantActivityDialog?.dismiss()
}
/**
......
......@@ -6,14 +6,13 @@ import android.support.v7.widget.RecyclerView
import android.text.TextUtils
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.LinearLayout
import android.widget.*
import com.ydl.ydlcommon.data.PlatformDataManager
import com.yidianling.common.tools.RxImageTool
import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent
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>
......@@ -38,6 +37,8 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
*/
var hasRealTestView: Boolean = false
var mView: View? = null
private var realTestView: HomePagerBannerRealView? = null
/**
* 线
......@@ -55,42 +56,48 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
ViewGroup.LayoutParams.WRAP_CONTENT
)
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()
val ffrom = PlatformDataManager.getRam().getChannelName()
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)
homeModuleButtonBannerSecond.background =
mView!!.findViewById<ImageView>(R.id.homeModuleButtonBannerSecond).background =
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)
homeModuleButtonBannerFourth.background =
mView!!.findViewById<ImageView>(R.id.homeModuleButtonBannerFourth).background =
resources.getDrawable(R.drawable.home_listen_bt_bg_huawei)
homeModuleButtonBannerFirstTitle.setTextColor(Color.WHITE)
tv_first_text.setTextColor(Color.WHITE)
homeModuleButtonBannerFourthTitle.setTextColor(Color.WHITE)
tv_second_text.setTextColor(Color.WHITE)
homeModuleButtonBannerThirdTitle.setTextColor(Color.WHITE)
tv_third_text.setTextColor(Color.WHITE)
homeModuleButtonBannerSecondTitle.setTextColor(Color.WHITE)
tv_fourth_text.setTextColor(Color.WHITE)
mView!!.findViewById<TextView>(R.id.homeModuleButtonBannerFirstTitle).setTextColor(Color.WHITE)
mView!!.findViewById<TextView>(R.id.tv_first_text).setTextColor(Color.WHITE)
mView!!.findViewById<TextView>(R.id.homeModuleButtonBannerFourthTitle).setTextColor(Color.WHITE)
mView!!.findViewById<TextView>(R.id.tv_second_text).setTextColor(Color.WHITE)
mView!!.findViewById<TextView>(R.id.homeModuleButtonBannerThirdTitle).setTextColor(Color.WHITE)
mView!!.findViewById<TextView>(R.id.tv_third_text).setTextColor(Color.WHITE)
mView!!.findViewById<TextView>(R.id.homeModuleButtonBannerSecondTitle).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()
}
homeModuleButtonBannerSecond.setOnClickListener {
mView!!.findViewById<RelativeLayout>(R.id.homeModuleButtonBannerSecond).setOnClickListener {
homeEvent?.nowConfideClick()
}
homeModuleButtonBannerThird.setOnClickListener {
mView!!.findViewById<RelativeLayout>(R.id.homeModuleButtonBannerThird).setOnClickListener {
homeEvent?.psychologyClassClick()
}
homeModuleButtonBannerFourth.setOnClickListener {
mView!!.findViewById<RelativeLayout>(R.id.homeModuleButtonBannerFourth).setOnClickListener {
homeEvent?.psychologyTestClick()
}
}
......@@ -101,8 +108,8 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
homeCategory: List<HomeHeaderBean.AskCategoryDataBean>?
) {
setRealTextView(homeSaleData)
homeEvent?.let { home_category_view.setEvent(it) };
home_category_view.initData(homeCategory)
homeEvent?.let { mView!!.findViewById<HomeModuleCategoryView>(R.id.home_category_view).setEvent(it) };
mView!!.findViewById<HomeModuleCategoryView>(R.id.home_category_view).initData(homeCategory)
}
/**
......@@ -137,9 +144,9 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
private fun setRealTextView(list: List<HomeHeaderBean.HomeSaleDataBean>?) {
if (!hasRealTestView) {
initLineView()
ll_home_module_button.addView(lineView)
mView!!.findViewById<LinearLayout>(R.id.ll_home_module_button).addView(lineView)
initRealTextView()
ll_home_module_button.addView(realTestView)
mView!!.findViewById<LinearLayout>(R.id.ll_home_module_button).addView(realTestView)
val cutOffParams = FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
......@@ -150,7 +157,7 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
cutOffView.setBackgroundColor(resources.getColor(R.color.home_colorBg))
cutOffView.layoutParams = cutOffParams
ll_home_module_button.addView(cutOffView)
mView!!.findViewById<LinearLayout>(R.id.ll_home_module_button).addView(cutOffView)
hasRealTestView = true
}
......
......@@ -5,6 +5,11 @@
android:layout_height="wrap_content"
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
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -141,9 +146,4 @@
</LinearLayout>
<com.yidianling.home.ui.widget.HomeModuleCategoryView
android:id="@+id/home_category_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</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