Commit a6cf9f10 by ydl

首页改版部分布局修改

parent fbf458b1
......@@ -105,13 +105,17 @@ class YdlHomeAdapter(
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): RecyclerView.ViewHolder {
when (viewType) {
//顶部图片banner
YdlHomeViewHolderConstract.HOME_IMAGE_BANNER -> {
return HomeImageBannerViewHolder(HomeImageBannerView(mContext, homeEvent))
}
//顶部预约专家,即时倾诉,心理测试按钮模块
YdlHomeViewHolderConstract.BUTTON_BANNER_VIEW -> {
return HomeButtonBannerViewHolder(HomeButtonBannerView(mContext, homeEvent))
}
//倾诉*排解模块
YdlHomeViewHolderConstract.CONFIDE_VIEW -> {
return HomeConfideViewHolder(HomeConfideView(mContext, homeEvent))
return HomeEmptyViewHolder(HomeEmptyView(mContext))
}
//课程*成长模块
YdlHomeViewHolderConstract.COURSE_VIEW -> {
......@@ -143,6 +147,9 @@ class YdlHomeAdapter(
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
when (holder) {
is HomeImageBannerViewHolder -> {
holder.imageBannerView.initData(list[position])
}
//顶部预约专家,即时倾诉,心理课堂,心理测试按钮模块
is HomeButtonBannerViewHolder -> {
holder.buttonBannerView.initData(
......@@ -150,20 +157,20 @@ class YdlHomeAdapter(
)
}
//倾诉*排解模块
is HomeConfideViewHolder -> {
if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
val parm = holder.itemView.layoutParams
parm.height = 0
holder.itemView.layoutParams = parm
} else {
holder.confideViewView.setTitle(
list[position].headerBean?.listenCategoryDate,
confideSelectPosition
)
holder.confideViewView.setConfideExpertInfoView(list[position].confideBean?.body)
confidePosition = position
}
}
// is HomeConfideViewHolder -> {
// if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
// val parm = holder.itemView.layoutParams
// parm.height = 0
// holder.itemView.layoutParams = parm
// } else {
// holder.confideViewView.setTitle(
// list[position].headerBean?.listenCategoryDate,
// confideSelectPosition
// )
// holder.confideViewView.setConfideExpertInfoView(list[position].confideBean?.body)
// confidePosition = position
// }
// }
//课程*成长模块
is HomeCourseViewHolder -> {
if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
......@@ -218,6 +225,9 @@ class YdlHomeAdapter(
return list.size
}
inner class HomeImageBannerViewHolder(val imageBannerView: HomeImageBannerView) :
RecyclerView.ViewHolder(imageBannerView)
/**
* 顶部预约专家,即时倾诉,心理测试按钮模块 ViewHolder
*/
......@@ -236,6 +246,9 @@ class YdlHomeAdapter(
inner class HomeConfideViewHolder(val confideViewView: HomeConfideView) :
RecyclerView.ViewHolder(confideViewView)
inner class HomeEmptyViewHolder(val emptyView: HomeEmptyView) :
RecyclerView.ViewHolder(emptyView)
/**
* 课程*成长模块 ViewHolder
*/
......
......@@ -10,6 +10,10 @@ package com.yidianling.home.constract
class YdlHomeViewHolderConstract {
companion object {
/**
* 顶部banner
*/
val HOME_IMAGE_BANNER = 10000
/**
* 顶部ViewPager与分类模块
*/
val PAGER_BANNER_VIEW = 10001
......@@ -22,17 +26,18 @@ class YdlHomeViewHolderConstract {
*/
val CONSULT_VIEW = 10003
/**
* 课程*成长模块
* 测试模块
*/
val COURSE_VIEW = 10004
val TEST_VIEW = 10004
/**
* 倾诉*排解模块
*/
val CONFIDE_VIEW = 10005
/**
* 测试模块
* 课程*成长模块
*/
val TEST_VIEW = 10006
val COURSE_VIEW = 10006
/**
* 解忧*问答模块
*/
......
......@@ -36,9 +36,7 @@ import com.yidianling.home.ui.view.CouponDialog
import com.yidianling.user.api.service.IUserService
import kotlinx.android.synthetic.xlzx.home_fragment_home_module.*
import kotlinx.android.synthetic.xlzx.home_layout_home_module_content.*
import kotlinx.android.synthetic.xlzx.home_layout_home_module_head_bg.*
import kotlinx.android.synthetic.xlzx.home_layout_home_module_input.*
import kotlinx.android.synthetic.xlzx.home_layout_home_module_toolbar.*
/**
......@@ -114,53 +112,53 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
home_swipe_refresh_layout.isEnabled = false
etSearch.setOnClickListener { homeEvent?.searchTvClick("") }
val inputLayoutParams = ll_search.layoutParams as CoordinatorLayout.LayoutParams
val inputOriginMargin = inputLayoutParams.leftMargin
var inputOffset = DisplayUtils.dp2px(context, 20).toFloat()
appbar_layout.addOnOffsetChangedListener { appBarLayout, i ->
home_swipe_refresh_layout.isEnabled = i >= 0
val scale = java.lang.Float.valueOf(Math.abs(i).toFloat())!! / java.lang.Float.valueOf(
appBarLayout.totalScrollRange.toFloat()
)!!
view_search_toolbar_bg.alpha = scale
val leftMargin = inputOriginMargin - inputOffset * scale
val rightMargin = inputOriginMargin - inputOffset * scale
inputLayoutParams.setMargins(leftMargin.toInt(), 0, rightMargin.toInt(), 0)
ll_search.layoutParams = inputLayoutParams
val zheZhaoAlpha = ((1 - (0.2 * scale)).toFloat())
//以下判断是因为toolbar和遮罩层拦截住了点击事件,导致banner不好点击
if (zheZhaoAlpha == 1f) {
title_layout.visibility = View.GONE
toolbar.visibility = View.GONE
} else {
title_layout.visibility = View.VISIBLE
toolbar.visibility = View.VISIBLE
}
view_search_input_bg.alpha = zheZhaoAlpha
}
initStatus()
// val inputLayoutParams = ll_search.layoutParams as CoordinatorLayout.LayoutParams
// val inputOriginMargin = inputLayoutParams.leftMargin
// var inputOffset = DisplayUtils.dp2px(context, 20).toFloat()
//
// appbar_layout.addOnOffsetChangedListener { appBarLayout, i ->
// home_swipe_refresh_layout.isEnabled = i >= 0
//
// val scale = java.lang.Float.valueOf(Math.abs(i).toFloat())!! / java.lang.Float.valueOf(
// appBarLayout.totalScrollRange.toFloat()
// )!!
// view_search_toolbar_bg.alpha = scale
// val leftMargin = inputOriginMargin - inputOffset * scale
// val rightMargin = inputOriginMargin - inputOffset * scale
// inputLayoutParams.setMargins(leftMargin.toInt(), 0, rightMargin.toInt(), 0)
// ll_search.layoutParams = inputLayoutParams
// val zheZhaoAlpha = ((1 - (0.2 * scale)).toFloat())
// //以下判断是因为toolbar和遮罩层拦截住了点击事件,导致banner不好点击
// if (zheZhaoAlpha == 1f) {
// title_layout.visibility = View.GONE
// toolbar.visibility = View.GONE
// } else {
// title_layout.visibility = View.VISIBLE
// toolbar.visibility = View.VISIBLE
// }
// view_search_input_bg.alpha = zheZhaoAlpha
// }
// initStatus()
}
/**
* 初始化状态栏位置
*/
private fun initStatus() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {//4.4以下不支持状态栏变色
val statusBarHeight = StatusBarUtils.getStatusBarHeight(activity)
var homeTitleBarHeight = resources.getDimension(R.dimen.home_home_title_bar_height)
val lp1 = view_search_toolbar_bg.layoutParams as RelativeLayout.LayoutParams
lp1.height = (homeTitleBarHeight + statusBarHeight).toInt()
view_search_toolbar_bg.layoutParams = lp1
val lp2 = toolbar.layoutParams as CollapsingToolbarLayout.LayoutParams
lp2.topMargin = statusBarHeight
toolbar.layoutParams = lp2
}
}
// private fun initStatus() {
//
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {//4.4以下不支持状态栏变色
// val statusBarHeight = StatusBarUtils.getStatusBarHeight(activity)
// var homeTitleBarHeight = resources.getDimension(R.dimen.home_home_title_bar_height)
// val lp1 = view_search_toolbar_bg.layoutParams as RelativeLayout.LayoutParams
// lp1.height = (homeTitleBarHeight + statusBarHeight).toInt()
// view_search_toolbar_bg.layoutParams = lp1
//
// val lp2 = toolbar.layoutParams as CollapsingToolbarLayout.LayoutParams
// lp2.topMargin = statusBarHeight
// toolbar.layoutParams = lp2
// }
// }
override fun initDataAndEventLazy() {
}
......@@ -265,9 +263,9 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
override fun homeDataResponse(list: MutableList<HomePagerDataBean>) {
home_swipe_refresh_layout.isRefreshing = false
//更新首页数据
initHeader(list)
//移除header条目
list.removeAt(0)
if (list.size > 0) {
list[0].type = YdlHomeViewHolderConstract.HOME_IMAGE_BANNER
}
adapter?.updateItems(list)
//每次全局更新后重置下标位
confideLastSelectPosition = 0
......@@ -281,38 +279,6 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
}
}
private fun initHeader(list: MutableList<HomePagerDataBean>) {
var headerBean = list[0].headerBean;
// homeEvent?.let { home_category_view.setEvent(it) };
// home_category_view.initData(headerBean?.askCategoryData)
var focusListBean = headerBean?.focusList;
//临时缓存集合
val cacheList = ArrayList<HomeHeaderBean.FocusListBean>()
if (null != focusListBean && focusListBean.isNotEmpty()) {
var imageViews = ArrayList<String>()
//产品说取前8个
if (focusListBean.size > 8) {
cacheList.addAll(focusListBean.subList(0, 8))
} else {
cacheList.addAll(focusListBean)
}
for (item in cacheList) {
imageViews.add(item.imageUrl!!)
}
banner_search.setImageLoader(GlideImageLoader(R.drawable.home_image_default_back))
.setImages(imageViews).start()
banner_search.setOnBannerListener {
homeEvent?.bannerClick(cacheList!![it])
YdlBuryPointUtil.sendClick(
"ydl-xinlizixun-home-banner$it",
"${cacheList[it].imageUrl}"
)
}
banner_search.setIndicatorBottomPadding(20)
}
}
override fun confideDataResponse(data: HomeConfideBean, selectPosition: Int) {
//更新倾述列表数据
adapter?.updateConfideData(data, selectPosition)
......
......@@ -37,7 +37,6 @@ class HomeArticleItemView(private val mContext: Context, private var homeEvent:
fun updateData(bean: HomeArticleBean.Bean?) {
homeModuleArticleItemViewTitle.text = bean?.title
homeModuleArticleItemViewContent.text = bean?.desc
homeModuleArticleItemViewAuthor.text = bean?.name
homeModuleArticleItemViewGreatNum.text = bean?.countOfFavorite.toString()
homeModuleArticleItemViewLookNum.text = bean?.readNum.toString()
YDLImageCacheManager.showImage(mContext, bean?.imgUrl, homeModuleArticleItemViewImg)
......
......@@ -45,31 +45,20 @@ class HomeAssuageGriefItemView(
}
private fun initView() {
val params = LinearLayout.LayoutParams(
val params = LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
)
params.setMargins(
(15 * RxDeviceTool.getScreenDensity(mContext)).toInt()
, (0 * RxDeviceTool.getScreenDensity(mContext)).toInt()
, (15 * RxDeviceTool.getScreenDensity(mContext)).toInt()
, (16 * RxDeviceTool.getScreenDensity(mContext)).toInt()
)
layoutParams = params
View.inflate(mContext, R.layout.home_assuage_grief_item_view, this)
}
fun updateData(bean: HomeAskBean.DataBean, position: Int, index: Int) {
fun updateData(bean: HomeAskBean.DataBean, position: Int, index: Int, isBottomItem: Boolean) {
this.setOnClickListener {
homeEvent?.askItemClick(bean)
}
YDLImageCacheManager.showImage(mContext, bean?.header, homeModuleAssuageGriefViewPersonImg)
homeModuleAssuageGriefViewPersonName.text = bean?.name
// homeModuleAssuageGriefViewTime.text = bean?.timeStr
MoonUtil.identifyFaceExpression(
mContext, homeModuleAssuageGriefViewContent,
bean?.content, ImageSpan.ALIGN_BOTTOM
......@@ -78,6 +67,17 @@ class HomeAssuageGriefItemView(
homeModuleAssuageGriefViewCommentsCount.text = bean?.commentsCount.toString()
homeModuleAssuageGriefViewZanCount.text = bean?.zanCount.toString()
if (isBottomItem) {
homeModuleAssuageGriefViewBottomLine.visibility = View.GONE
homeModuleAssuageGriefViewBottomBtn.visibility = View.VISIBLE
homeModuleAssuageGriefViewBottomBtn.setOnClickListener {
homeEvent?.askMoreClick()
}
} else {
homeModuleAssuageGriefViewBottomLine.visibility = View.VISIBLE
homeModuleAssuageGriefViewBottomBtn.visibility = View.GONE
}
/**
* 点赞
......@@ -103,39 +103,6 @@ class HomeAssuageGriefItemView(
}
}
homeModuleAssuageGriefItemViewIsFollow.setOnClickListener {
if (bean.isFocused == 1) {
homeEvent?.askItemClick(bean)
} else {
if (!Utils.isFastClick()) {
if (!ModularServiceManager.provide(IUserService::class.java).isLogin()) {
//跳转登录
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MINE_LOGIN)
return@setOnClickListener
}
bean.isFocused = if (bean.isFocused == 1) 0 else 1
setFollowType(bean.isFocused == 1)
//防止连击
homeEvent?.askItemFocusClick(position, bean.uid.toString())
}
}
}
if (bean.uid == 0) {
//匿名,隐藏关注按钮
homeModuleAssuageGriefItemViewIsFollow.visibility = View.GONE
} else {
/**
* 关注
*/
if (bean.isFocused == 1) {
setFollowType(true)
} else {
setFollowType(false)
}
}
/**
* 标题
*/
......@@ -158,17 +125,20 @@ class HomeAssuageGriefItemView(
*/
if (null != bean?.smallAttach && bean?.smallAttach!!.isNotEmpty()) {
if (homeAssuageGriefImageItemView != null) {
homeModuleAssuageGriefViewChildLayout.removeView(homeAssuageGriefImageItemView)
homeModuleAssuageGriefItemImageItemLL.removeAllViews()
homeModuleAssuageGriefItemImageItemLL.visibility = View.GONE
}
homeAssuageGriefImageItemView = HomeAssuageGriefImageItemView(
mContext,
bean?.smallAttach as List<String>,
homeEvent
)
homeModuleAssuageGriefViewChildLayout.addView(homeAssuageGriefImageItemView, 1)
homeModuleAssuageGriefItemImageItemLL.addView(homeAssuageGriefImageItemView)
homeModuleAssuageGriefItemImageItemLL.visibility = View.VISIBLE
} else {
if (null != homeAssuageGriefImageItemView) {
homeModuleAssuageGriefViewChildLayout.removeView(homeAssuageGriefImageItemView)
homeModuleAssuageGriefItemImageItemLL.removeAllViews()
homeModuleAssuageGriefItemImageItemLL.visibility = View.GONE
}
}
......@@ -179,16 +149,6 @@ class HomeAssuageGriefItemView(
}
private fun setFollowType(boolean: Boolean) {
if (boolean) {
homeModuleAssuageGriefItemViewFollow.visibility = View.VISIBLE
homeModuleAssuageGriefItemViewUnFollow.visibility = View.GONE
} else {
homeModuleAssuageGriefItemViewFollow.visibility = View.GONE
homeModuleAssuageGriefItemViewUnFollow.visibility = View.VISIBLE
}
}
private fun initComment(bean: HomeAskBean.DataBean) {
if (bean?.commentsCount > 0) {
homeModuleAssuageGriefViewComment.visibility = View.VISIBLE
......@@ -196,96 +156,22 @@ class HomeAssuageGriefItemView(
var index: Int = 0
var commentBean = bean?.comments!![0]
YDLImageCacheManager.showImage(mContext, commentBean.userHead, homeModuleAssuageGriefViewHotViewHeader)
if (null != commentBean.name && commentBean.name!!.isNotEmpty())
setPartTextColor(
homeModuleAssuageGriefViewHotViewComment, commentBean.name,
0, commentBean.name?.length!!, Color.parseColor("#1DA1F2")
)
homeModuleAssuageGriefViewHotViewComment.text = commentBean.name?:""
// userType为2 ,专家
if (commentBean.userType == 2) {
setImage(
mContext, homeModuleAssuageGriefViewHotViewComment, "vip",
R.drawable.home_assuage_grief_item_user_type_v,
RxImageTool.dp2px(13f),
RxImageTool.dp2px(13f)
)
}
setAppendPartTextColor(
homeModuleAssuageGriefViewHotViewComment, ":",
0,
1
, Color.parseColor("#1DA1F2")
)
MoonUtil.identifyFaceExpression(
mContext, homeModuleAssuageGriefViewHotViewCommentContent,
commentBean.content, ImageSpan.ALIGN_BOTTOM
)
var emptyString = ""
if (null != commentBean.name && commentBean.name!!.isNotEmpty()) {
if (commentBean.userType == 2) {
emptyString += "缩"
}
for (index in 0 until commentBean.name!!.length) {
emptyString += commentBean.name!![index]
}
emptyString += "缩"
}
val span =
SpannableStringBuilder(emptyString + homeModuleAssuageGriefViewHotViewCommentContent.text)
span.setSpan(
ForegroundColorSpan(Color.TRANSPARENT), 0, emptyString.length,
Spanned.SPAN_INCLUSIVE_EXCLUSIVE
)
homeModuleAssuageGriefViewHotViewCommentContent.text = span
}
homeModuleAssuageGriefViewHotViewVip.visibility = View.VISIBLE
} else {
homeModuleAssuageGriefViewHotViewVip.visibility = View.GONE
}
fun setPartTextColor(
textView: TextView, text: String?,
start: Int, end: Int, colorId: Int
) {
var ss: SpannableString = SpannableString(text)
ss.setSpan(
ForegroundColorSpan(colorId), start, end,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
)
textView.text = ss
}
homeModuleAssuageGriefViewHotViewCommentContent.text = commentBean.name?:""
fun setAppendPartTextColor(
textView: TextView, text: String?,
start: Int, end: Int, colorId: Int
) {
var ss: SpannableString = SpannableString(text)
ss.setSpan(
ForegroundColorSpan(colorId), start, end,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
)
textView.append(ss)
} else {
homeModuleAssuageGriefViewComment.visibility = View.GONE
}
fun setImage(
context: Context,
textView: TextView,
bitmapText: String,
resId: Int,
width: Int,
height: Int
) {
var ss: SpannableString = SpannableString(bitmapText)
var drawable: Drawable = context.resources.getDrawable(resId)
drawable.setBounds(0, 0, width, height)
var imageSpan: ImageSpan = ImageSpan(drawable, ImageSpan.ALIGN_BASELINE)
ss.setSpan(
imageSpan, 0, bitmapText.length,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
)
textView.append(ss)
}
}
\ No newline at end of file
......@@ -34,7 +34,7 @@ class HomeAssuageGriefView(private val mContext: Context, private var homeEvent:
)
layoutParams = params
View.inflate(mContext, R.layout.home_assuage_grief_view, this)
homeModuleAssuageGriefViewHomeCommonTitleView.setTitle("解忧·问答")
homeModuleAssuageGriefViewHomeCommonTitleView.setTitle("人生答疑")
homeModuleAssuageGriefViewHomeCommonTitleView.setOnClickListener {
homeEvent?.askMoreClick()
}
......@@ -54,8 +54,8 @@ class HomeAssuageGriefView(private val mContext: Context, private var homeEvent:
//刷新数据
for (index in 0..childCount) {
val itemView = getChildAt(index)
if (itemView is HomeAssuageGriefItemView) {
itemView.updateData(list[index - 1], position, index - 1)
if (itemView != null && itemView is HomeAssuageGriefItemView) {
itemView.updateData(list[index - 1], position, index - 1, index == childCount - 1)
}
}
}
......
......@@ -49,7 +49,7 @@ class HomeConfideView(private val mContext: Context, private var homeEvent: Home
layoutParams = params
orientation = VERTICAL
View.inflate(mContext, R.layout.home_confide_view, this)
homeModuleConfideViewHomeCommonTitleView.setTitle("人生答疑")
homeModuleConfideViewHomeCommonTitleView.setTitle("倾诉·排解")
homeModuleConfideViewHomeCommonTitleView.setOnClickListener {
homeEvent?.confideMoreClick()
}
......
......@@ -50,17 +50,16 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
setHead(bean)
//设置名称
tv_consult_name.text = bean.name
//咨询师标签
tag_view.initData(StringUtils.strToList(bean.tags))
//设置向TA倾诉人数
setConfideNum(bean)
//设置咨询师级别
tv_consult_jibie.text = bean.profesBack
//设置接通率文案
setConnection(bean)
//设置向TA倾诉按钮状态
//设置向TA咨询人数
setConfideNum(bean)
//设置向TA咨询按钮状态
setConfideButton(bean)
//设置红包、原价
setPrice(bean)
this.setOnClickListener {
setOnClickListener {
val url = URLUtils.appendParmas(bean.linkUrl, "cateId", cateId)
homeEvent!!.consultItemClick(url, bean.doctorId)
}
......@@ -74,15 +73,13 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
}
/**
* 设置向TA倾诉人数
* 设置向TA咨询人数
*/
private fun setConfideNum(bodyBean: HomeConsultBean.ListBean) {
if (TextUtils.isEmpty(bodyBean.zixunOrderNum.toString())) {
tv_consult_num.visibility = View.GONE
tv_tv_consult_num_content.visibility = View.GONE
} else {
tv_consult_num.visibility = View.VISIBLE
tv_tv_consult_num_content.visibility = View.VISIBLE
tv_consult_num.text = bodyBean.zixunOrderNum.toString()
}
}
......@@ -93,13 +90,10 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
private fun setConnection(bodyBean: HomeConsultBean.ListBean) {
if (TextUtils.isEmpty(bodyBean.feedbackRate.toString())) {
tv_feedback_rate.visibility = View.INVISIBLE
tv_feedback_rate_content.visibility = View.INVISIBLE
} else {
tv_feedback_rate.visibility = View.VISIBLE
tv_feedback_rate_content.visibility = View.VISIBLE
try {
val dd = bodyBean.feedbackRate / 5.00f
val str = String.format("%.2f", dd * 100f) + "%"
val str = String.format("%.1f", bodyBean.feedbackRate / 10f)
tv_feedback_rate.text = str
} catch (e: Exception) {
e.printStackTrace()
......@@ -112,17 +106,8 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
*/
private fun setConfideButton(bodyBean: HomeConsultBean.ListBean) {
//私聊文案
if (TextUtils.isEmpty(bodyBean.chatBtnText)) {
tv_consult_chat.text = "私聊"
tv_consult_chat.setTextColor(
ContextCompat.getColor(
context,
R.color.platform_color_222222
)
)
tv_consult_chat.background =
ContextCompat.getDrawable(context, R.drawable.home_consult_chat_bg)
} else {
if (!TextUtils.isEmpty(bodyBean.chatBtnText)) {
tv_consult_chat.visibility = View.VISIBLE
tv_consult_chat.text = bodyBean.chatBtnText
tv_consult_chat.setTextColor(
ContextCompat.getColor(
......@@ -137,9 +122,4 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
homeEvent!!.consultChatClick(bodyBean.uid.toString())
}
}
private fun setPrice(bodyBean: HomeConsultBean.ListBean) {
val confideFee = bodyBean.minBookingPrice
tv_consult_price.text = "¥$confideFee"
}
}
package com.yidianling.home.ui.view
import android.content.Context
import android.graphics.Color
import android.graphics.Typeface
import android.os.Build
import android.support.design.widget.TabLayout
......@@ -11,11 +12,13 @@ import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.TextView
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxImageTool
import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeConsultBean
import com.yidianling.home.model.bean.HomeHeaderBean
import kotlinx.android.synthetic.xlzx.home_confide_view.view.*
import java.lang.Exception
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
......@@ -36,11 +39,17 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
*/
private var listener: ConsultTabSelectedListener? = null
private var dp5: Int = 0
private var dp10: Int = 0
init {
initView()
}
private fun initView() {
dp5 = RxImageTool.dp2px(5f)
dp10 = RxImageTool.dp2px(10f)
val params = RecyclerView.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
......@@ -70,19 +79,23 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
mLastPosition = lastPosition
tab_layout.removeAllTabs()
for ((index, bean) in list.withIndex()) {
tab_layout.addTab(tab_layout.newTab().setText(bean.name), index == lastPosition)
val textView = updateText(TextView(mContext), index == lastPosition)
textView.text = bean.name
val newTab = tab_layout.newTab().setCustomView(textView)
tab_layout.addTab(newTab, index == lastPosition)
}
listener = ConsultTabSelectedListener(list, tab_layout)
tab_layout.addOnTabSelectedListener(listener!!)
var textView =
((tab_layout!!.getChildAt(0) as LinearLayout).getChildAt(lastPosition) as LinearLayout).getChildAt(
1
)
try {
var textView = tab_layout.getTabAt(0) as TextView
if (textView != null && textView is TextView) {
textView.textSize = 26f
textView.setTextColor(ContextCompat.getColor(mContext, R.color.platform_color_242424))
textView.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
updateText(textView, true)
}
} catch (e: Exception) {}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
tab_layout.setOnScrollChangeListener { v, scrollX, scrollY, oldScrollX, oldScrollY ->
LogUtil.e("scrollX=$scrollX")
......@@ -108,7 +121,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
cacheInfoViewList = ArrayList()
}
//创建HomeConsultItemView:每个tab最多显示个专家
//创建HomeConsultItemView:每个tab最多显示个专家
if (cacheInfoViewList!!.size >= list.size) {
for (index in 0 until list!!.size) {
//设置数据
......@@ -123,7 +136,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
}
} else {
for (index in 0 until list!!.size) {
if (index > 2) {
if (index > 3) {
//只取前三条数据
break
}
......@@ -166,18 +179,10 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
}
override fun onTabUnselected(tab: TabLayout.Tab?) {
var textView =
((tabLayout!!.getChildAt(0) as LinearLayout).getChildAt(tab!!.position) as LinearLayout).getChildAt(
1
)
var textView = tabLayout?.getTabAt(tab?.position!!)?.customView as TextView
if (textView != null && textView is TextView) {
textView.textSize = 14f
textView.setTextColor(
ContextCompat.getColor(
mContext,
R.color.platform_color_333333
)
)
updateText(textView, false)
}
}
......@@ -185,21 +190,28 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
if (mLastPosition == tab!!.position) {
return
}
var textView =
((tabLayout!!.getChildAt(0) as LinearLayout).getChildAt(tab!!.position) as LinearLayout).getChildAt(
1
)
var textView = tabLayout?.getTabAt(tab?.position!!)?.customView as TextView
if (textView != null && textView is TextView) {
textView.textSize = 26f
textView.setTextColor(
ContextCompat.getColor(
mContext,
R.color.platform_color_242424
)
)
textView.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
updateText(textView, true)
}
homeEvent!!.getConsultData(list!![tab!!.position], tab!!.position)
}
}
fun updateText(txtView: TextView, isSelected: Boolean): TextView {
if (!isSelected) {
txtView.textSize = 12f
txtView.setTextColor(Color.parseColor("#999999"))
txtView.setPadding(dp10, dp5, dp10, dp5)
txtView.setBackgroundResource(R.drawable.home_consult_tab_item_unselected_bg)
} else {
txtView.textSize = 12f
txtView.setTextColor(Color.parseColor("#FD9B0A"))
txtView.setPadding(dp10, dp5, dp10, dp5)
txtView.setBackgroundResource(R.drawable.home_consult_tab_item_selected_bg)
}
return txtView
}
}
......@@ -27,7 +27,7 @@ class HomeCourseView(private val mContext: Context, private var homeEvent: IHome
private fun initView() {
orientation = VERTICAL
val params = LinearLayout.LayoutParams(
val params = LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
)
......@@ -51,10 +51,10 @@ class HomeCourseView(private val mContext: Context, private var homeEvent: IHome
updateHomeCourseItemViewNumber()
}
//刷新数据
for (index in 0 until childCount) {
val itemView = getChildAt(index)
for (index in 0 until homeModuleCourseViewScrollLL.childCount) {
val itemView = homeModuleCourseViewScrollLL.getChildAt(index)
if (itemView is HomeCourseItemView) {
itemView.updateData(list[index - 1])
itemView.updateData(cacheList[index])
}
}
}
......@@ -63,13 +63,13 @@ class HomeCourseView(private val mContext: Context, private var homeEvent: IHome
* 更新itemView的数量以适应新的数据集
*/
private fun updateHomeCourseItemViewNumber() {
var childCountRecord = childCount - 1 //减1是因为第一个子View是标题View
var childCountRecord = homeModuleCourseViewScrollLL.childCount //减1是因为第一个子View是标题View
while (cacheList.size > childCountRecord) {
addView(HomeCourseItemView(mContext, homeEvent))
homeModuleCourseViewScrollLL.addView(HomeCourseItemView(mContext, homeEvent))
childCountRecord++
}
while (cacheList.size < childCountRecord && getChildAt(childCountRecord - 1) is HomeCourseItemView) {
removeViewAt(childCountRecord - 1)
while (cacheList.size < childCountRecord && homeModuleCourseViewScrollLL.getChildAt(childCountRecord - 1) is HomeCourseItemView) {
homeModuleCourseViewScrollLL.removeViewAt(childCountRecord - 1)
childCountRecord--
}
}
......
package com.yidianling.home.ui.view
import android.content.Context
import android.widget.LinearLayout
class HomeEmptyView(private val mContext: Context) : LinearLayout(mContext) {
init {
initView()
}
fun initView() {
layoutParams = LayoutParams(0,0)
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.support.v7.widget.RecyclerView
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.ydl.ydlcommon.utils.YdlBuryPointUtil
import com.ydl.ydlcommon.view.banner.GlideImageLoader
import com.yidianling.common.tools.RxDeviceTool
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 com.yidianling.home.model.bean.HomePagerDataBean
import kotlinx.android.synthetic.xlzx.home_image_banner_view.view.*
class HomeImageBannerView(val mContext: Context, val homeEvent: IHomeBaseEvent) : LinearLayout(mContext) {
init {
initView()
}
fun initView() {
val params = LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
((RxDeviceTool.getScreenWidth(mContext) - RxImageTool.dp2px(16f + 16f)) * 139f / 345f).toInt()
) as MarginLayoutParams
params.topMargin = RxImageTool.dp2px(12f)
params.leftMargin = RxImageTool.dp2px(16f)
params.rightMargin = RxImageTool.dp2px(16f)
layoutParams = params
View.inflate(mContext, R.layout.home_image_banner_view, this)
}
fun initData(bean: HomePagerDataBean) {
var headerBean = bean.headerBean
var focusListBean = headerBean?.focusList
//临时缓存集合
val cacheList = ArrayList<HomeHeaderBean.FocusListBean>()
if (null != focusListBean && focusListBean.isNotEmpty()) {
var imageViews = ArrayList<String>()
//产品说取前8个
if (focusListBean.size > 8) {
cacheList.addAll(focusListBean.subList(0, 8))
} else {
cacheList.addAll(focusListBean)
}
for (item in cacheList) {
imageViews.add(item.imageUrl!!)
}
banner_search.setImageLoader(GlideImageLoader(R.drawable.home_image_default_back))
.setImages(imageViews).start()
banner_search.setOnBannerListener {
homeEvent?.bannerClick(cacheList!![it])
YdlBuryPointUtil.sendClick(
"ydl-xinlizixun-home-banner$it",
"${cacheList[it].imageUrl}"
)
}
banner_search.setIndicatorBottomPadding(20)
}
}
}
\ No newline at end of file
......@@ -47,11 +47,6 @@ class HomeTestItemView(private val mContext: Context, private var homeEvent: IHo
tv_tested_count.text = bean.testNum.toString()
YDLImageCacheManager.showImage(mContext, bean?.shareImage, iv_test_item)
if (isLast) {
view_test_line.visibility = View.GONE
} else {
view_test_line.visibility = View.VISIBLE
}
this.setOnClickListener {
homeEvent?.testItemClick(bean.recommendLinkUrl)
......
......@@ -44,6 +44,7 @@ class HomeModuleCategoryView : FrameLayout {
*/
var imageViewHeight: Int = 0
var dp1: Int = 0
var dp3: Int = 0
var dp12: Int = 0
/**
......@@ -87,6 +88,7 @@ class HomeModuleCategoryView : FrameLayout {
categoryWidth = ScreenUtil.screenWidth - RxImageTool.dp2px(12f + 3f + 3f + 12f)
imageViewWidth = categoryWidth / 3
imageViewHeight = imageViewWidth * 52 / 107
dp1 = RxImageTool.dip2px(1f)
dp3 = RxImageTool.dip2px(3f)
dp12 = RxImageTool.dip2px(12f)
}
......@@ -162,7 +164,7 @@ class HomeModuleCategoryView : FrameLayout {
if (i > 2) {
//第二行
imageParams.topMargin = imageViewHeight
imageParams.topMargin = imageViewHeight + dp1
imageParams.leftMargin = dp12 + dp3 * (i - 3) + imageViewWidth * (i - 3)
} else {
//第一行
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#F7F7F7" />
<corners android:radius="@dimen/platform_dp_4"/>
</shape>
\ No newline at end of file
......@@ -2,12 +2,11 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/platform_color_F7F7F7" />
<solid android:color="@color/platform_color_FFFFFF" />
<corners android:radius="@dimen/platform_dp_4"/>
<stroke android:width="1dp"
android:color="@color/platform_color_FFFFFF"
/>
android:color="#CCCCCC" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#F8F8F8" />
<corners android:radius="@dimen/platform_dp_4"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="40dp"/>
<solid android:color="@android:color/white" />
<stroke android:width="1px" android:color="#E6E6E6"/>
<corners android:radius="18dp"/>
<solid android:color="#F7F7F7" />
</shape>
\ No newline at end of file
......@@ -5,12 +5,5 @@
android:startColor="#F0F0F0"
android:endColor="#F0F0F0"/>
<corners android:radius="@dimen/platform_dp_12" />
<padding
android:bottom="@dimen/platform_dp_3"
android:left="@dimen/platform_dp_10"
android:right="@dimen/platform_dp_10"
android:top="@dimen/platform_dp_3" />
<stroke android:color="#F0F0F0"/>
<corners android:radius="@dimen/platform_dp_3" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#19FFBC4A"/>
<corners android:radius="4dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#F8F8F8"/>
<corners android:radius="4dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/platform_color_FFFFFF"/>
<corners android:radius="8dp"/>
<stroke android:width="0.5dp"
android:color="#EBEBEB"/>
</shape>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/platform_color_FFFFFF"/>
<solid android:color="#37000000"/>
<corners android:radius="14dp"/>
......
......@@ -7,8 +7,8 @@
android:endColor="#7DACCA"/>
<corners
android:topRightRadius="@dimen/platform_dp_10"
android:topLeftRadius="@dimen/platform_dp_10"
android:topRightRadius="@dimen/platform_dp_8"
android:topLeftRadius="@dimen/platform_dp_8"
/>
</shape>
\ No newline at end of file
......@@ -8,6 +8,11 @@
android:paddingRight="@dimen/platform_dp_15"
android:paddingTop="@dimen/platform_dp_15">
<RelativeLayout
android:id="@+id/homeModuleArticleItemViewRl"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/homeModuleArticleItemViewCardImg"
android:layout_width="@dimen/platform_dp_127"
......@@ -29,10 +34,10 @@
android:layout_height="wrap_content"
android:maxLines="2"
android:ellipsize="end"
android:textSize="@dimen/platform_dp_18"
android:textSize="@dimen/platform_dp_17"
android:textStyle="bold"
android:layout_marginTop="-2dp"
android:textColor="@color/platform_color_222222"
android:textColor="@color/platform_color_242424"
android:layout_alignParentTop="true"
android:lineSpacingExtra="@dimen/platform_dp_1"
tools:text="喧嚣的世界中,你的重要何以而来?喧嚣的世界中,你的重要何以而来?"
......@@ -44,7 +49,7 @@
android:id="@+id/homeModuleArticleItemViewContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="2"
android:maxLines="1"
android:ellipsize="end"
android:textSize="@dimen/platform_dp_13"
android:layout_marginTop="@dimen/platform_dp_6"
......@@ -61,68 +66,57 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_below="@+id/homeModuleArticleItemViewCardImg"
android:layout_marginTop="@dimen/platform_dp_16">
<ImageView
android:id="@+id/homeModuleArticleItemViewIcon"
android:layout_width="@dimen/platform_dp_12"
android:layout_height="@dimen/platform_dp_12"
android:src="@drawable/home_article_item_icon"
android:layout_marginTop="1dp"
android:layout_alignParentLeft="true"/>
<TextView
android:id="@+id/homeModuleArticleItemViewAuthor"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_242424"
android:layout_marginLeft="@dimen/platform_dp_3"
android:textStyle="bold"
tools:text="赵秀英"/>
android:layout_below="@+id/homeModuleArticleItemViewContent"
android:layout_marginTop="@dimen/platform_dp_10">
<TextView
android:id="@+id/homeModuleArticleItemViewGreatNum"
android:id="@+id/homeModuleArticleItemViewLookNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="3327"
tools:text="2656"
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_242424"/>
android:textColor="@color/platform_color_999999"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="点赞"
android:text=" 浏览"
android:textSize="@dimen/platform_dp_11"
android:layout_marginRight="@dimen/platform_dp_12"
android:textColor="@color/platform_color_666666"/>
android:textColor="@color/platform_color_999999"/>
<View
android:layout_width="1dp"
android:layout_height="10dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="7dp"
android:background="#EBEBEB"/>
<TextView
android:id="@+id/homeModuleArticleItemViewLookNum"
android:id="@+id/homeModuleArticleItemViewGreatNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="2656"
tools:text="3327"
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_242424"/>
android:textColor="@color/platform_color_999999"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="浏览"
android:text=" 点赞"
android:textSize="@dimen/platform_dp_11"
android:textColor="@color/platform_color_666666"/>
android:textColor="@color/platform_color_999999"/>
</LinearLayout>
</RelativeLayout>
<View
android:id="@+id/homeModuleArticleItemViewBottomLine"
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/platform_color_EBEBEB"
android:layout_centerInParent="true"
android:layout_below="@+id/homeModuleArticleItemViewBottomLayout"
android:layout_marginTop="@dimen/platform_dp_20"/>
android:layout_below="@+id/homeModuleArticleItemViewRl"
android:layout_marginTop="@dimen/platform_dp_15"
android:layout_marginRight="124dp"/>
</RelativeLayout>
......@@ -6,89 +6,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/platform_dp_20"
android:paddingTop="@dimen/platform_dp_18"
android:paddingLeft="@dimen/platform_dp_15"
android:paddingRight="@dimen/platform_dp_15"
android:background="@drawable/home_view_shadow_bg">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/platform_dp_18">
<RelativeLayout
android:id="@+id/homeModuleAssuageGriefViewPersonCardView"
android:layout_width="38dp"
android:layout_height="38dp"
android:background="@drawable/home_assuage_grief_stroke_line">
<android.support.v7.widget.CardView
android:layout_width="@dimen/platform_dp_36"
android:layout_height="@dimen/platform_dp_36"
app:cardCornerRadius="@dimen/platform_dp_18"
app:cardElevation="0dp"
android:layout_centerInParent="true">
<ImageView
android:id="@+id/homeModuleAssuageGriefViewPersonImg"
android:layout_width="@dimen/platform_dp_36"
android:layout_height="@dimen/platform_dp_36"
android:src="@drawable/platform_icon_country"
android:scaleType="centerCrop"/>
</android.support.v7.widget.CardView>
</RelativeLayout>
<TextView
android:id="@+id/homeModuleAssuageGriefViewPersonName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="Zoe Miller"
android:textSize="@dimen/platform_dp_14"
android:textColor="@color/platform_color_242424"
android:textStyle="bold"
android:gravity="center"
android:layout_alignTop="@+id/homeModuleAssuageGriefViewPersonCardView"
android:layout_alignBottom="@+id/homeModuleAssuageGriefViewPersonCardView"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/homeModuleAssuageGriefViewPersonCardView"
android:layout_marginLeft="@dimen/platform_dp_8"
/>
<TextView
android:id="@+id/homeModuleAssuageGriefViewTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="今天 15:05"
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_999999"
android:layout_toRightOf="@+id/homeModuleAssuageGriefViewPersonCardView"
android:layout_alignBottom="@+id/homeModuleAssuageGriefViewPersonCardView"
android:layout_marginLeft="@dimen/platform_dp_8"
android:layout_marginBottom="0.5dp"
android:visibility="gone"/>
<RelativeLayout
android:id="@+id/homeModuleAssuageGriefItemViewIsFollow"
android:layout_width="@dimen/platform_dp_60"
android:layout_height="@dimen/platform_dp_24"
android:layout_centerVertical="true"
android:layout_alignParentRight="true">
<ImageView
android:id="@+id/homeModuleAssuageGriefItemViewFollow"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/home_focus_en"
android:layout_centerInParent="true"/>
<ImageView
android:id="@+id/homeModuleAssuageGriefItemViewUnFollow"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/home_focus_un"
android:layout_centerInParent="true"/>
</RelativeLayout>
</RelativeLayout>
android:paddingTop="@dimen/platform_dp_20">
<!-- 标题,默认隐藏-->
<TextView
......@@ -102,6 +20,8 @@
android:textSize="@dimen/platform_dp_18"
android:layout_marginBottom="@dimen/platform_dp_6"
android:textStyle="bold"
android:paddingLeft="@dimen/platform_dp_16"
android:paddingRight="@dimen/platform_dp_16"
tools:text="可是除了你,没人能左右我的情绪可是除了你,没人能左右我的情绪"/>
<TextView
......@@ -111,56 +31,91 @@
android:maxLines="3"
android:ellipsize="end"
android:lineSpacingExtra="@dimen/platform_dp_5"
android:paddingLeft="@dimen/platform_dp_16"
android:paddingRight="@dimen/platform_dp_16"
tools:text="在我空闲的时间里,我想起了许久没有联系的露娜,给她打了一通电话。我没有说很多,可她还是感觉出了我的不对劲,竟然不顾雪夜寒冷与路途遥远,一个多钟在我空闲的时间里,我想起了许久没有联系的露娜,给她打了一通电话。我没有说很多,可她还是感觉出了我的不对劲,竟然不顾雪夜寒冷与路途遥远,一个多钟..."
android:textSize="@dimen/platform_dp_13"
android:textColor="@color/platform_color_666666"/>
android:textSize="@dimen/platform_dp_15"
android:textColor="@color/platform_color_242424"/>
<LinearLayout
android:id="@+id/homeModuleAssuageGriefItemImageItemLL"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:visibility="gone"
android:paddingLeft="@dimen/platform_dp_16"
android:paddingRight="@dimen/platform_dp_16"
android:orientation="vertical">
</LinearLayout>
<!-- 评论内容,默认隐藏-->
<RelativeLayout
android:id="@+id/homeModuleAssuageGriefViewComment"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/platform_dp_12"
android:padding="@dimen/platform_dp_12"
android:layout_marginTop="@dimen/platform_dp_16"
android:background="@drawable/home_assuage_grief_item_view_tab_back">
android:visibility="gone"
android:layout_marginLeft="@dimen/platform_dp_16"
android:layout_marginRight="@dimen/platform_dp_16"
android:background="@drawable/home_assuage_grief_item_view_tab_comment_back">
<android.support.v7.widget.CardView
android:id="@+id/homeModuleAssuageGriefViewHotViewHeaderCard"
android:layout_width="30dp"
android:layout_height="30dp"
app:cardCornerRadius="15dp"
app:cardElevation="0dp">
<ImageView
android:id="@+id/homeModuleAssuageGriefViewHotView"
android:layout_height="@dimen/platform_dp_14"
android:layout_width="@dimen/platform_dp_28"
android:src="@drawable/home_comment_hot_icon"/>
android:id="@+id/homeModuleAssuageGriefViewHotViewHeader"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/platform_head_place_hold_pic"
android:scaleType="centerCrop"/>
</android.support.v7.widget.CardView>
<TextView
android:id="@+id/homeModuleAssuageGriefViewHotViewComment"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/platform_dp_15"
android:layout_marginLeft="@dimen/platform_dp_15"
android:layout_marginLeft="@dimen/platform_dp_8"
tools:text="劳蘸酱:"
android:textStyle="bold"
android:textSize="@dimen/platform_dp_13"
android:textColor="@color/platform_color_444444"
android:maxLines="2"
android:gravity="center_vertical"
android:textSize="@dimen/platform_dp_15"
android:layout_toRightOf="@+id/homeModuleAssuageGriefViewHotViewHeaderCard"
android:textColor="#282829"
android:maxLines="1"
android:ellipsize="end"
android:layout_below="@+id/homeModuleAssuageGriefViewHotView"
android:layout_marginTop="@dimen/platform_dp_5"
android:layout_alignTop="@+id/homeModuleAssuageGriefViewHotViewHeaderCard"
android:layout_alignBottom="@+id/homeModuleAssuageGriefViewHotViewHeaderCard"
/>
<ImageView
android:id="@+id/homeModuleAssuageGriefViewHotViewVip"
android:layout_width="13dp"
android:layout_height="13dp"
android:visibility="gone"
android:layout_marginLeft="4dp"
android:layout_toRightOf="@+id/homeModuleAssuageGriefViewHotViewComment"
android:layout_alignTop="@+id/homeModuleAssuageGriefViewHotViewHeaderCard"
android:layout_alignBottom="@+id/homeModuleAssuageGriefViewHotViewHeaderCard"
android:src="@drawable/home_assuage_grief_item_user_type_v"
android:scaleType="centerInside"/>
<TextView
android:id="@+id/homeModuleAssuageGriefViewHotViewCommentContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/platform_dp_15"
android:layout_marginLeft="@dimen/platform_dp_15"
android:lineSpacingExtra="@dimen/platform_dp_4"
tools:text="劳蘸酱:人生的旅途中,我们总是在不断的相遇和告别中前行。生活总会让我们经历着或多或少我们总是在不断的相遇和告别中前行我们总是在不断的相遇和告别中前行"
tools:text="人生的旅途中,我们总是在不断的相遇和告别中前行。生活总会让我们经历着或多或少我们总是在不断的相遇和告别中前行我们总是在不断的相遇和告别中前行"
android:textSize="@dimen/platform_dp_13"
android:textColor="@color/platform_color_444444"
android:textColor="@color/platform_color_666666"
android:maxLines="2"
android:ellipsize="end"
android:layout_below="@+id/homeModuleAssuageGriefViewHotView"
android:layout_marginTop="@dimen/platform_dp_5"
android:layout_marginTop="@dimen/platform_dp_6"
android:layout_below="@+id/homeModuleAssuageGriefViewHotViewHeaderCard"
/>
</RelativeLayout>
......@@ -169,20 +124,22 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@dimen/platform_dp_20">
android:paddingLeft="@dimen/platform_dp_16"
android:paddingRight="@dimen/platform_dp_16"
android:layout_marginTop="@dimen/platform_dp_12">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="28dp"
android:orientation="horizontal"
android:paddingLeft="@dimen/platform_dp_7"
android:paddingRight="@dimen/platform_dp_7"
android:paddingTop="@dimen/platform_dp_4"
android:paddingBottom="@dimen/platform_dp_4"
android:gravity="center_vertical"
android:paddingLeft="@dimen/platform_dp_8"
android:paddingRight="@dimen/platform_dp_8"
android:paddingTop="@dimen/platform_dp_6"
android:paddingBottom="@dimen/platform_dp_6"
android:gravity="center"
android:background="@drawable/home_assuage_grief_item_view_tab_back">
<ImageView
android:layout_width="11.36dp"
android:layout_height="10.72dp"
android:layout_width="14dp"
android:layout_height="14dp"
android:src="@drawable/home_assuage_grief_item_view_tab_icon"/>
<TextView
android:id="@+id/homeModuleAssuageGriefViewTag"
......@@ -190,7 +147,7 @@
android:layout_height="wrap_content"
tools:text="情感倾诉"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_12"
android:textSize="@dimen/platform_dp_11"
android:layout_marginLeft="@dimen/platform_dp_3"/>
</LinearLayout>
<View
......@@ -236,8 +193,28 @@
android:textSize="@dimen/platform_dp_14"
android:textColor="@color/platform_color_242424"
android:layout_marginLeft="@dimen/platform_dp_5"/>
</LinearLayout>
</LinearLayout>
<View
android:id="@+id/homeModuleAssuageGriefViewBottomLine"
android:layout_width="match_parent"
android:layout_height="4dp"
android:background="@color/platform_color_F6F6F6"
android:layout_marginTop="16dp"/>
<TextView
android:id="@+id/homeModuleAssuageGriefViewBottomBtn"
android:layout_width="match_parent"
android:layout_marginLeft="16dp"
android:visibility="gone"
android:layout_marginRight="16dp"
android:layout_height="44dp"
android:text="查看更多"
android:textSize="15dp"
android:textColor="#FD9B0A"
android:gravity="center"
android:layout_marginTop="27dp"
android:background="@drawable/home_assuage_grief_item_bottom_btn_bg"/>
</LinearLayout>
......@@ -3,7 +3,9 @@
android:id="@+id/ll_home_module_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="vertical"
android:layout_marginBottom="17dp"
android:layout_marginTop="17dp">
<LinearLayout
android:layout_width="match_parent"
......@@ -17,7 +19,7 @@
<LinearLayout
android:id="@+id/homeModuleButtonBannerFirst"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
......@@ -40,7 +42,7 @@
<LinearLayout
android:id="@+id/homeModuleButtonBannerFourth"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
......@@ -63,7 +65,7 @@
<LinearLayout
android:id="@+id/homeModuleButtonBannerThird"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
......@@ -86,7 +88,7 @@
<LinearLayout
android:id="@+id/homeModuleButtonBannerSecond"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
......
......@@ -28,25 +28,16 @@
android:layout_height="40dp"
app:tabGravity="fill"
app:tabIndicatorHeight="0dp"
android:layout_marginLeft="12dp"
app:tabMode="scrollable"
app:tabPaddingStart="4dp"
app:tabPaddingEnd="4dp"
app:tabSelectedTextColor="@color/platform_color_242424"
app:tabTextAppearance="@style/TabLayoutTextSize"
app:tabTextColor="#333"/>
<View
android:layout_alignParentRight="true"
android:background="@drawable/home_consult_head_border"
android:layout_width="20dp"
android:layout_height="match_parent"/>
</RelativeLayout>
<ImageView
android:layout_width="5dp"
android:layout_height="10dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:src="@drawable/home_sale_arrow"/>
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/platform_dp_15"
android:layout_marginRight="@dimen/platform_dp_15"
android:layout_marginBottom="@dimen/platform_dp_15"
android:background="@drawable/home_view_shadow_bg"
android:padding="@dimen/platform_dp_15"
>
android:orientation="vertical"
android:gravity="center_horizontal"
android:background="@drawable/home_view_shadow_bg">
<RelativeLayout
android:layout_centerVertical="true"
android:id="@+id/rl_consult_head"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<View
android:layout_width="103dp"
android:layout_height="105dp"
android:background="@drawable/home_consult_head_border"
/>
android:layout_height="64dp"
android:layout_marginTop="19dp">
<android.support.v7.widget.CardView
android:layout_width="102dp"
android:layout_height="104dp"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_centerInParent="true"
app:cardCornerRadius="@dimen/platform_dp_4"
app:cardElevation="1dp">
app:cardCornerRadius="32dp"
app:cardElevation="0dp"
android:layout_centerHorizontal="true">
<ImageView
android:id="@+id/img_consult_head"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"/>
android:scaleType="centerCrop"
android:src="@drawable/platform_head_place_hold_pic"/>
</android.support.v7.widget.CardView>
<TextView
android:id="@+id/tv_consult_chat"
android:layout_width="wrap_content"
android:layout_height="@dimen/platform_dp_15"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="@drawable/home_consult_chat_rest_bg"
android:gravity="center"
android:paddingLeft="9dp"
android:paddingRight="9dp"
tools:text="休息中"
android:textColor="@color/platform_color_666666"
android:textSize="10dp"
android:visibility="gone"/>
</RelativeLayout>
<LinearLayout
android:id="@+id/tv_name_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/rl_consult_head"
android:layout_marginStart="16dp"
android:layout_toEndOf="@+id/rl_consult_head"
android:layout_marginTop="13dp"
android:gravity="center_vertical"
android:orientation="horizontal">
......@@ -72,116 +70,46 @@
</LinearLayout>
<com.ydl.ydlcommon.view.TagView
android:id="@+id/tag_view"
android:layout_width="match_parent"
android:layout_height="@dimen/platform_dp_16"
android:layout_below="@+id/tv_name_layout"
android:layout_marginStart="@dimen/platform_dp_16"
android:layout_marginTop="6dp"
android:layout_marginEnd="@dimen/platform_dp_10"
android:layout_toEndOf="@+id/rl_consult_head"
android:orientation="horizontal"/>
<TextView
android:id="@+id/tv_tv_consult_num_content"
android:id="@+id/tv_consult_jibie"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tag_view"
android:layout_alignLeft="@+id/tv_name_layout"
android:layout_marginTop="8dp"
android:text="咨询次数 "
android:layout_marginTop="2dp"
android:layout_marginBottom="9dp"
android:textColor="@color/platform_color_666666"
android:textSize="10sp"
tools:ignore="SpUsage"/>
<TextView
android:id="@+id/tv_consult_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tag_view"
android:layout_marginTop="5dp"
android:layout_toRightOf="@+id/tv_tv_consult_num_content"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"
tools:ignore="SpUsage"
tools:text="8000"/>
android:textSize="@dimen/platform_dp_13"
tools:text="二级心理咨询师"/>
<TextView
android:id="@+id/tv_feedback_rate_content"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tag_view"
android:layout_toRightOf="@+id/tv_consult_num"
android:layout_marginTop="8dp"
android:layout_marginLeft="12dp"
android:text="好评率 "
android:textColor="@color/platform_color_666666"
android:textSize="10sp"
tools:ignore="SpUsage"
/>
android:orientation="horizontal"
android:layout_marginBottom="20dp">
<TextView
android:id="@+id/tv_feedback_rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tag_view"
android:layout_toRightOf="@+id/tv_feedback_rate_content"
android:layout_marginTop="5dp"
android:textColor="@color/platform_color_242424"
android:textSize="12sp"
android:textColor="#FF5B46"
android:textSize="15dp"
android:textStyle="bold"
tools:ignore="SpUsage"
tools:text="83%"/>
tools:text="9.8"/>
<TextView
android:id="@+id/tv_consult_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_consult_num"
android:layout_marginStart="@dimen/platform_dp_16"
android:layout_marginTop="7dp"
android:layout_toEndOf="@+id/rl_consult_head"
android:layout_alignBottom="@+id/rl_consult_head"
android:gravity="bottom"
android:textColor="#FF5A4C"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold"
tools:ignore="SpUsage"
tools:text="¥199"
android:layout_marginBottom="2dp"
/>
android:textColor="#FF5B46"
android:textSize="14dp"
tools:text="分"/>
<TextView
android:id="@+id/tv_price_tips"
android:id="@+id/tv_consult_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/tv_consult_price"
android:layout_marginLeft="2dp"
android:layout_marginBottom="2dp"
android:layout_toRightOf="@+id/tv_consult_price"
android:gravity="center"
android:text="起"
android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_12"/>
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_13"
tools:text="8000次咨询"
android:layout_marginLeft="4dp"/>
</LinearLayout>
<TextView
android:id="@+id/tv_consult_chat"
android:layout_width="wrap_content"
android:layout_height="@dimen/platform_dp_22"
android:layout_alignBottom="@+id/tv_consult_price"
android:layout_alignParentRight="true"
android:background="@drawable/home_consult_chat_bg"
android:gravity="center"
android:paddingLeft="17dp"
android:paddingTop="3dp"
android:paddingRight="17dp"
android:paddingBottom="3dp"
android:text="私聊"
android:textColor="@color/platform_color_222222"
android:textSize="12sp"
android:textStyle="bold"/>
</LinearLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/platform_dp_99"
android:layout_width="166dp"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_marginLeft="@dimen/platform_dp_15"
android:layout_marginRight="@dimen/platform_dp_15"
android:layout_marginBottom="@dimen/platform_dp_13"
android:layout_marginTop="@dimen/platform_dp_3"
android:padding="@dimen/platform_dp_15"
android:background="@drawable/home_view_shadow_bg">
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp">
<android.support.v7.widget.CardView
android:id="@+id/homeModuleCourseItemViewImgCardView"
android:layout_width="127dp"
android:layout_height="69dp"
app:cardCornerRadius="6dp"
android:layout_width="166dp"
android:layout_height="90.3dp"
app:cardCornerRadius="4dp"
app:cardElevation="0dp">
<ImageView
android:id="@+id/homeModuleCourseItemViewImg"
android:layout_width="127dp"
android:layout_height="69dp"
android:layout_width="166dp"
android:layout_height="90.3dp"
android:scaleType="centerCrop"
android:src="@drawable/home_image_default_back"/>
......@@ -30,18 +27,25 @@
android:id="@+id/homeModuleCourseItemViewTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView"
android:layout_marginLeft="@dimen/platform_dp_12"
android:layout_below="@+id/homeModuleCourseItemViewImgCardView"
android:textSize="@dimen/platform_dp_16"
android:textColor="@color/platform_color_242424"
android:textStyle="bold"
android:maxLines="2"
android:ellipsize="end"
android:layout_marginTop="-2dp"
android:layout_marginTop="12dp"
tools:text="深度睡眠速效药丸丨帮你
像婴儿般安稳入睡深度睡眠速效药丸丨帮你
像婴儿般安稳入睡"/>
<RelativeLayout
android:id="@+id/homeModuleCourseItemViewPriceRl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleCourseItemViewTitle">
<TextView
android:layout_marginTop="5dp"
android:id="@+id/homeModuleCourseItemViewFreePrice"
android:visibility="gone"
android:layout_width="wrap_content"
......@@ -50,51 +54,48 @@
android:textSize="@dimen/platform_dp_15"
android:textStyle="bold"
android:textColor="@color/platform_color_34CD65"
android:layout_alignBottom="@+id/homeModuleCourseItemViewImgCardView"
android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView"
android:layout_marginLeft="@dimen/platform_dp_12"/>
/>
<RelativeLayout
android:layout_marginTop="5dp"
android:id="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/homeModuleCourseItemViewImgCardView"
android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView"
android:layout_marginLeft="@dimen/platform_dp_12"
android:layout_marginBottom="-2dp">
android:layout_height="wrap_content">
<TextView
android:id="@+id/homeModuleCourseItemViewExpensePrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="¥688"
android:textStyle="bold"
android:textSize="16dp"
android:textColor="@color/platform_color_FF5A4C"/>
android:textSize="15dp"
android:textColor="#ED7474"/>
</RelativeLayout>
</RelativeLayout>
<TextView
android:id="@+id/homeModuleCourseItemViewPersonText"
android:id="@+id/homeModuleCourseItemViewPersonNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="人气"
android:textSize="@dimen/platform_dp_11"
tools:text="3109"
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_999999"
android:layout_marginLeft="7dp"
android:layout_toRightOf="@+id/homeModuleCourseItemViewPriceRl"
android:layout_alignBottom="@+id/homeModuleCourseItemViewPriceRl"
android:gravity="center"
android:textColor="@color/platform_color_666666"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_alignBottom="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_marginBottom="-1dp"
android:layout_marginBottom="2dp"
/>
<TextView
android:id="@+id/homeModuleCourseItemViewPersonNum"
android:id="@+id/homeModuleCourseItemViewPersonText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="3109"
android:text="人气"
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_242424"
android:layout_toLeftOf="@+id/homeModuleCourseItemViewPersonText"
android:layout_alignBottom="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_alignTop="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:gravity="center"
android:layout_marginBottom="-1dp"
android:textStyle="bold"
android:textColor="@color/platform_color_999999"
android:layout_toRightOf="@+id/homeModuleCourseItemViewPersonNum"
android:layout_alignBottom="@+id/homeModuleCourseItemViewPriceRl"
android:layout_marginBottom="2dp"
/>
</RelativeLayout>
......@@ -8,4 +8,24 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<HorizontalScrollView
android:id="@+id/homeModuleCourseViewScrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none"
>
<LinearLayout
android:id="@+id/homeModuleCourseViewScrollLL"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="11dp"
android:paddingRight="11dp"
android:orientation="horizontal"/>
</HorizontalScrollView>
<View
android:layout_width="match_parent"
android:layout_height="8dp"
android:background="#F8F8F8"
android:layout_marginTop="13dp"/>
</merge>
\ No newline at end of file
......@@ -8,58 +8,68 @@
android:clipChildren="false"
android:clipToPadding="false">
<android.support.design.widget.CoordinatorLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/home_colorBg"
android:clipChildren="false"
android:clipToPadding="false"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
>
<!-- <android.support.design.widget.CoordinatorLayout-->
<!-- android:id="@+id/container"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:background="@color/home_colorBg"-->
<!-- android:clipChildren="false"-->
<!-- android:clipToPadding="false"-->
<!-- app:layout_behavior="@string/appbar_scrolling_view_behavior"-->
<!-- >-->
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/home_colorBg"
android:clipChildren="false"
android:clipToPadding="false"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:elevation="0dp">
<!-- <android.support.design.widget.AppBarLayout-->
<!-- android:id="@+id/appbar_layout"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:background="@color/home_colorBg"-->
<!-- android:clipChildren="false"-->
<!-- android:clipToPadding="false"-->
<!-- android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"-->
<!-- app:elevation="0dp">-->
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<!-- <android.support.design.widget.CollapsingToolbarLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:clipChildren="false"-->
<!-- android:clipToPadding="false"-->
<!-- app:layout_scrollFlags="scroll|exitUntilCollapsed">-->
<include layout="@layout/home_layout_home_module_head_bg"/>
<!-- <include layout="@layout/home_layout_home_module_head_bg"/>-->
<include
layout="@layout/home_layout_home_module_head_middle"/>
<!-- <include-->
<!-- layout="@layout/home_layout_home_module_head_middle"/>-->
<!-- <android.support.v7.widget.Toolbar-->
<!-- android:id="@+id/toolbar"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="@dimen/home_home_title_bar_height"-->
<!-- android:alpha="0"-->
<!-- android:background="@android:color/white"-->
<!-- android:tag="toolbar"-->
<!-- android:visibility="gone"-->
<!-- app:layout_collapseMode="pin"-->
<!-- app:popupTheme="@style/Widget.AppCompat.Toolbar"/>-->
<!-- <include layout="@layout/home_layout_home_module_toolbar"/>-->
<!-- </android.support.design.widget.CollapsingToolbarLayout>-->
<!-- </android.support.design.widget.AppBarLayout>-->
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/home_home_title_bar_height"
android:alpha="0"
android:background="@android:color/white"
android:tag="toolbar"
android:visibility="gone"
app:layout_collapseMode="pin"
app:popupTheme="@style/Widget.AppCompat.Toolbar"/>
<include layout="@layout/home_layout_home_module_toolbar"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<!-- </android.support.design.widget.CoordinatorLayout>-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/home_layout_home_module_input" />
<include layout="@layout/home_layout_home_module_content"/>
</LinearLayout>
<include layout="@layout/home_layout_home_module_input"/>
</android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.SwipeRefreshLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="8dp"
app:cardElevation="0dp"
>
<com.ydl.ydlcommon.view.banner.Banner
android:id="@+id/banner_search"
android:layout_width="match_parent"
android:layout_height="@dimen/home_head_bg_height"
app:pa_indicator_different_width="14dp"
app:pa_indicator_drawable_selected="@drawable/home_banner_tip_select"
app:pa_indicator_drawable_unselected="@drawable/home_banner_tip_unselect"
app:pa_indicator_height="5dp"
app:pa_indicator_margin="1.25dp"
app:pa_is_selected_same_unselected="false"
android:scaleType="centerCrop"
android:tag="overScroll"
/>
</android.support.v7.widget.CardView>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ll_search"
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_marginLeft="35dp"
android:layout_marginRight="35dp"
android:tag="tag_search_input"
app:layout_anchor="@+id/middle_but_layout"
app:layout_anchorGravity="top"
android:layout_height="44dp"
android:paddingLeft="16dp"
android:paddingRight="6dp"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:background="@color/white"
android:focusableInTouchMode="true"
>
......@@ -23,39 +21,40 @@
android:visibility="gone" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="36dp">
<View
android:id="@+id/view_search_input_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/home_bg_home_module_input"
android:tag="tag_search_input_bg"
android:layout_marginRight="@dimen/platform_dp_14"
/>
<ImageView
android:id="@+id/iv_search_icon"
android:layout_marginLeft="15dp"
android:layout_marginRight="10dp"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginLeft="18dp"
android:layout_marginRight="11dp"
android:layout_width="18dp"
android:layout_height="18dp"
android:scaleType="centerCrop"
android:layout_centerVertical="true"
android:tag="tag_search_input_img"
android:src="@drawable/home_search"/>
android:src="@drawable/home_module_top_search_icon"/>
<EditText
android:editable="false"
android:id="@+id/etSearch"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="@dimen/platform_dp_10"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/iv_search_icon"
android:background="@null"
android:focusable="true"
android:focusableInTouchMode="true"
android:hint="搜索专家姓名"
android:hint="抑郁症有哪些前兆"
android:imeOptions="actionSearch"
android:singleLine="true"
android:textColor="@color/platform_color_444444"
......@@ -66,5 +65,16 @@
/>
</RelativeLayout>
<LinearLayout
android:layout_width="44dp"
android:layout_height="44dp"
android:orientation="vertical"
android:gravity="center"
android:background="#14FF0000">
<ImageView
android:layout_width="23.3dp"
android:layout_height="21.3dp"
android:src="@drawable/home_module_top_xiaoyi_icon"/>
</LinearLayout>
</LinearLayout>
......@@ -6,7 +6,5 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/platform_white"
android:paddingLeft="15dp"
android:paddingRight="15dp"
/>
</merge>
\ No newline at end of file
......@@ -5,23 +5,23 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="vertical"
android:layout_marginBottom="30dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingTop="@dimen/platform_dp_8"
android:paddingBottom="@dimen/platform_dp_8"
>
<android.support.v7.widget.CardView
android:layout_width="70dp"
android:layout_height="50dp"
app:cardCornerRadius="@dimen/platform_dp_6"
android:layout_width="44dp"
android:layout_height="44dp"
app:cardCornerRadius="@dimen/platform_dp_4"
app:cardElevation="0dp">
<ImageView
......@@ -47,7 +47,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16"
android:textSize="@dimen/platform_dp_17"
android:textStyle="bold"
tools:text="2018倒计时,这一年你过2018倒计时,这一年你过的…"/>
......@@ -60,11 +60,17 @@
android:orientation="horizontal"
android:paddingRight="@dimen/platform_dp_10">
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_marginRight="3dp"
android:src="@drawable/home_test_item_person_test"/>
<TextView
android:id="@+id/tv_tested_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_444444"
android:textColor="@color/platform_color_999999"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"
tools:text="2486"
......@@ -74,30 +80,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="人已测"
android:textColor="@color/platform_color_666666"
android:textColor="@color/platform_color_999999"
android:textSize="@dimen/platform_dp_12"
/>
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/tv_go"
android:layout_width="@dimen/platform_dp_32"
android:layout_height="@dimen/platform_dp_32"
android:background="@drawable/home_test_item_go_bg"
android:gravity="center"
android:text="GO"
android:textSize="13sp"
android:textColor="@color/platform_color_222222"
android:textStyle="bold"/>
</LinearLayout>
<View
android:visibility="gone"
android:layout_marginBottom="@dimen/platform_dp_12"
android:id="@+id/view_test_line"
style="@style/viewline"
android:layout_marginLeft="82dp"
android:background="@color/platform_color_EBEBEB"/>
</LinearLayout>
......@@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="92dp"
android:layout_marginBottom="30dp"
android:background="@drawable/home_test_top_view_layout_back">
<TextView
......@@ -35,7 +36,7 @@
android:layout_width="64dp"
android:layout_height="28dp"
android:text="测试"
android:textColor="#FBAA0E"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="13dp"
android:gravity="center"
android:layout_alignParentRight="true"
......
......@@ -16,6 +16,7 @@
android:layout_marginLeft="@dimen/platform_dp_15"
android:layout_marginRight="@dimen/platform_dp_15"
android:layout_marginTop="@dimen/platform_dp_2"
android:orientation="vertical"/>
android:orientation="vertical"
android:background="@drawable/home_test_module_bg"/>
</merge>
\ No newline at end of file
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