Commit fbf458b1 by ydl

首页改版部分布局修改

parent 4b50b6e0
ext {
kotlin_version = "1.3.21"
dev_mode = false
dev_mode = true
ydl_app = [
appName : "心理咨询壹点灵",
......
......@@ -146,7 +146,6 @@ class YdlHomeAdapter(
//顶部预约专家,即时倾诉,心理课堂,心理测试按钮模块
is HomeButtonBannerViewHolder -> {
holder.buttonBannerView.initData(
list[position].headerBean?.homeSaleData,
list[position].headerBean?.askCategoryData
)
}
......
......@@ -34,7 +34,8 @@ class HomeArticleView(private val mContext: Context, private var homeEvent: IHom
)
layoutParams = params
View.inflate(mContext, R.layout.home_article_view, this)
homeModuleArticleViewHomeCommonTitleView.setTitle("文章·阅读")
homeModuleArticleViewHomeCommonTitleView.setTitle("主题阅读")
homeModuleArticleViewHomeCommonTitleView.setMoreText("更多阅读")
homeModuleArticleViewHomeCommonTitleView.setOnClickListener {
homeEvent?.articleMoreClick()
}
......
......@@ -25,26 +25,6 @@ import kotlinx.android.synthetic.xlzx.home_button_banner_view.view.*
*/
class HomeButtonBannerView(private val mContext: Context, private var homeEvent: IHomeBaseEvent?) :
LinearLayout(mContext) {
/**
* 数据缓存
*/
var mDataList: ArrayList<HomeHeaderBean.AskCategoryDataBean>? = null
/**
* 间隔
*/
var margin: Int = 0
/**
* 是否添加了实时测试状态View
*/
var hasRealTestView: Boolean = false
private var realTestView: HomePagerBannerRealView? = null
/**
* 线
*/
private var lineView: View? = null
private var buttonParams: LinearLayout.LayoutParams? = null
init {
initView()
......@@ -58,46 +38,14 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
layoutParams = params
View.inflate(mContext, R.layout.home_button_banner_view, this)
// initButtonView()
val ffrom = PlatformDataManager.getRam().getChannelName()
if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
homeModuleButtonBannerThird.visibility = View.GONE
homeModuleButtonBannerSecond.visibility = View.GONE
homeModuleButtonBannerFirst.background =
resources.getDrawable(R.drawable.home_dcotor_bt_bg_huawei)
homeModuleButtonBannerSecond.background =
resources.getDrawable(R.drawable.home_test_bt_bg_hauwei)
homeModuleButtonBannerThird.background =
resources.getDrawable(R.drawable.home_course_bt_bg_huawei)
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)
homeModuleButtonBannerFirstTitle.textSize = 18f
tv_first_text.textSize = 13f
homeModuleButtonBannerFourthTitle.textSize = 18f
tv_second_text.textSize = 13f
}
homeModuleButtonBannerFirst.setOnClickListener {
homeEvent?.reservationExpertsClick()
}
homeModuleButtonBannerSecond.setOnClickListener {
homeEvent?.nowConfideClick()
homeEvent?.askMoreClick()
}
homeModuleButtonBannerThird.setOnClickListener {
homeEvent?.psychologyClassClick()
homeEvent?.articleMoreClick()
}
homeModuleButtonBannerFourth.setOnClickListener {
homeEvent?.psychologyTestClick()
......@@ -106,71 +54,11 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
fun initData(
homeSaleData: List<HomeHeaderBean.HomeSaleDataBean>?,
homeCategory: List<HomeHeaderBean.AskCategoryDataBean>?
) {
setRealTextView(homeSaleData)
homeEvent?.let { home_category_view.setEvent(it) }
home_category_view.initData(homeCategory)
val ffrom = PlatformDataManager.getRam().getChannelName()
if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
home_category_view.visibility = View.GONE
} else {
homeEvent?.let { home_category_view.setEvent(it) }
home_category_view.initData(homeCategory)
}
}
/**
* 初始化实时测评状态View
*/
private fun initRealTextView() {
if (null == realTestView) {
var realTestParam = FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
)
realTestView = HomePagerBannerRealView(context, homeEvent!!)
realTestView!!.layoutParams = realTestParam
}
}
private fun initLineView() {
var lineParam =
FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, RxImageTool.dip2px(0.5f))
var dp15 = RxImageTool.dip2px(15f)
lineParam.leftMargin = dp15
lineParam.rightMargin = dp15
lineView = View(context)
lineView!!.setBackgroundColor(resources.getColor(R.color.home_category_view_test_line))
lineView!!.layoutParams = lineParam
}
/**
* 实时测评状态赋值
*/
private fun setRealTextView(list: List<HomeHeaderBean.HomeSaleDataBean>?) {
if (!hasRealTestView) {
initLineView()
ll_home_module_button.addView(lineView)
initRealTextView()
ll_home_module_button.addView(realTestView)
val cutOffParams = FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
RxImageTool.dip2px(0.5f)
)
cutOffParams.height = RxImageTool.dip2px(10f)
val cutOffView = View(context)
cutOffView.setBackgroundColor(resources.getColor(R.color.home_colorBg))
cutOffView.layoutParams = cutOffParams
ll_home_module_button.addView(cutOffView)
hasRealTestView = true
}
realTestView!!.initData(list)
}
}
\ No newline at end of file
......@@ -30,13 +30,10 @@ class HomeCommonTitleView(private val mContext: Context, private val attributeSe
fun setTitle(title: String) {
homeModuleCommonTitleViewTitle.text = title
}
val isFromXinliZiXunHuawei =
!TextUtils.isEmpty(ffrom) && ffrom.startsWith("ATK_7") && ffrom.endsWith("huawei")
if (isFromXinliZiXunHuawei) {
view_line.visibility = View.GONE
}
fun setMoreText(text: String) {
homeModuleCommonTitleViewMorell.visibility = View.VISIBLE
homeModuleCommonTitleViewMoreText.text = text
}
}
\ No newline at end of file
......@@ -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()
}
......
......@@ -48,7 +48,8 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
layoutParams = params
orientation = VERTICAL
View.inflate(mContext, R.layout.home_confide_view, this)
homeModuleConfideViewHomeCommonTitleView.setTitle("咨询·理解")
homeModuleConfideViewHomeCommonTitleView.setTitle("心理咨询")
homeModuleConfideViewHomeCommonTitleView.setMoreText("更多咨询")
homeModuleConfideViewHomeCommonTitleView.setOnClickListener {
homeEvent?.consultMoreClick()
}
......
......@@ -33,7 +33,8 @@ class HomeCourseView(private val mContext: Context, private var homeEvent: IHome
)
layoutParams = params
View.inflate(mContext, R.layout.home_course_view, this)
homeModuleCourseViewHomeCommonTitleView.setTitle("学习·成长")
homeModuleCourseViewHomeCommonTitleView.setTitle("未知潜能")
homeModuleCourseViewHomeCommonTitleView.setMoreText("更多课程")
homeModuleCourseViewHomeCommonTitleView.setOnClickListener {
homeEvent?.courseMreClick()
}
......
......@@ -39,20 +39,9 @@ class HomePagerBannerView(private val mContext: Context, private var homeEvent:
View.inflate(mContext, R.layout.home_pager_banner_view, this)
initBannerLayout()
// val addLayoutParams = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
// addLayoutParams.setMargins(0, (ScreenUtil.screenWidth * (356f / 750f)).toInt(),0,0)
// homeModulePagerBannerViewAddLayout.layoutParams = addLayoutParams
// if (null == homePagerBannerCategoryView) {
// homePagerBannerCategoryView = HomePagerBannerCategoryView(mContext, homeEvent!!)
// homeModulePagerBannerViewAddLayout.addView(homePagerBannerCategoryView)
// }
}
private fun initBannerLayout() {
// var screenWidth = RxDeviceTool.getScreenWidth(mContext)
// var viewHeight = screenWidth * 508 / 750
// val params = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, viewHeight)
// homeModulePagerBannerViewBanner.layoutParams = params
homeModulePagerBannerViewBanner.setIndicatorBottomPadding(50)
}
......
......@@ -15,15 +15,14 @@ import kotlinx.android.synthetic.xlzx.home_test_item_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 心灵电台模块item
* @描述: 测评模块item
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/14
*/
class HomeTestItemView(private val mContext: Context, private var homeEvent: IHomeBaseEvent?) :
LinearLayout(mContext) {
private val ffrom = PlatformDataManager.getRam().getChannelName()
private var params: LinearLayout.LayoutParams? = null
private var params: LayoutParams? = null
init {
initView()
......@@ -31,17 +30,12 @@ class HomeTestItemView(private val mContext: Context, private var homeEvent: IHo
private fun initView() {
orientation = VERTICAL
params = LinearLayout.LayoutParams(
params = LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
)
layoutParams = params
View.inflate(mContext, R.layout.home_test_item_view, this)
val isFromXinliZiXunHuawei =
!TextUtils.isEmpty(ffrom) && ffrom.startsWith("ATK_7") && ffrom.endsWith("huawei")
if (isFromXinliZiXunHuawei) {
tv_go.visibility = View.GONE
}
}
......
package com.yidianling.home.ui.view
import android.content.Context
import android.text.TextUtils
import android.view.View
import android.widget.LinearLayout
import com.ydl.ydl_image.config.ISimpleImageOpConfig
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydlcommon.data.PlatformDataManager
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.HomeTestItemBean
......@@ -17,59 +10,29 @@ import kotlinx.android.synthetic.xlzx.home_test_top_item_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 心灵电台模块item--顶部item
* @描述: 测评模块item--顶部item
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/15
*/
class HomeTestTopItemView(private val mContext: Context, private var homeEvent: IHomeBaseEvent?) :
LinearLayout(mContext) {
private val ffrom = PlatformDataManager.getRam().getChannelName()
init {
initView()
}
private fun initView() {
orientation = VERTICAL
var screenWidth = RxDeviceTool.getScreenWidth(mContext)
var viewWidth = (screenWidth - 2 * 15 * RxDeviceTool.getScreenDensity(mContext)).toInt()
var viewHeight = viewWidth * 143 / 345
val params = LinearLayout.LayoutParams(viewWidth, viewHeight)
layoutParams = params
View.inflate(mContext, R.layout.home_test_top_item_view, this)
val isFromXinliZiXunHuawei =
!TextUtils.isEmpty(ffrom) && ffrom.startsWith("ATK_7") && ffrom.endsWith("huawei")
if (isFromXinliZiXunHuawei) {
ll_day_test.visibility = View.GONE
}
}
/**
* 刷新数据
*/
fun updateData(bean: HomeTestItemBean) {
var screenWidth = RxDeviceTool.getScreenWidth(mContext)
var viewWidth = (screenWidth - RxImageTool.dip2px(30f))
var viewHeight = viewWidth * 143 / 345
val sp = SimpleImageOpConfiger()
sp.loadingPic = R.drawable.platform_default_img
sp.errorPic = R.drawable.platform_default_img
sp.scaleType = ISimpleImageOpConfig.CENTER_CROP
sp.isCacheOnDisk = true
YDLImageCacheManager.showImage(
mContext,
bean?.shareImage,
homeModuleIntelligentTopViewImage,
viewWidth,
viewHeight,
sp
)
homeModuleIntelligentTopViewTitle.text = bean.name
homeModuleIntelligentTopViewHits.text = bean.testNum.toString()
homeModuleTestTopViewTitle.text = bean.name
homeModuleTestTopViewHits.text = bean.testNum.toString() + "已测"
this.setOnClickListener {
homeEvent?.testItemClick(bean.recommendLinkUrl)
......
......@@ -30,7 +30,8 @@ class HomeTestView(private val mContext: Context, private var homeEvent: HomeImp
val params = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(mContext, R.layout.home_test_view, this)
homeModuleIntelligentViewHomeCommonTitleView.setTitle("测试·分析")
homeModuleIntelligentViewHomeCommonTitleView.setTitle("测试分析")
homeModuleIntelligentViewHomeCommonTitleView.setMoreText("更多测试")
homeModuleIntelligentViewHomeCommonTitleView.setOnClickListener {
homeEvent?.testMoreClick()
}
......
......@@ -42,20 +42,10 @@ class HomeModuleCategoryView : FrameLayout {
/**
* 文本宽度
*/
var textViewWidth: Int = 0
/**
* 文本高度
*/
var textViewHeight: Int = 0
/**
* 间隔
*/
var margin: Int = 0
var imageViewHeight: Int = 0
var dp8: Int = 0
private var realTestView: HomePagerBannerRealView? = null
var dp3: Int = 0
var dp12: Int = 0
/**
* 倍数
*/
......@@ -82,11 +72,10 @@ class HomeModuleCategoryView : FrameLayout {
*/
private fun initView() {
View.inflate(context, R.layout.home_pager_banner_category_view, this)
val params = FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.WRAP_CONTENT
val params = LayoutParams(
LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT
)
// params.topMargin = ScreenUtil.screenHeight * (356f / 750f).toInt()
layoutParams = params
initArgs()
}
......@@ -95,13 +84,11 @@ class HomeModuleCategoryView : FrameLayout {
* 初始化变量
*/
private fun initArgs() {
categoryWidth = ScreenUtil.screenWidth - RxImageTool.dp2px(30f)
textViewWidth = categoryWidth / 4
imageViewWidth = RxImageTool.dip2px(38f)
margin = (categoryWidth - 4 * imageViewWidth) / 8
dp8 = RxImageTool.dip2px(8f)
//高度=文字12dp+16dp间距
textViewHeight = RxImageTool.dip2px(28f)
categoryWidth = ScreenUtil.screenWidth - RxImageTool.dp2px(12f + 3f + 3f + 12f)
imageViewWidth = categoryWidth / 3
imageViewHeight = imageViewWidth * 52 / 107
dp3 = RxImageTool.dip2px(3f)
dp12 = RxImageTool.dip2px(12f)
}
fun initData(askCategoryDataBean: List<HomeHeaderBean.AskCategoryDataBean>?) {
......@@ -149,23 +136,18 @@ class HomeModuleCategoryView : FrameLayout {
homeModulePagerBannerFlRoot.removeAllViews()
var i = 0
for (item in mDataList!!) {
if (i > 7) {
if (i > 5) {
break
}
val imageView = createIcon(i)
val textView = createText(i)
homeModulePagerBannerFlRoot.addView(imageView)
homeModulePagerBannerFlRoot.addView(textView)
imageView.setOnClickListener {
homeEvent!!.categoryClick(item)
}
textView.setOnClickListener {
homeEvent!!.categoryClick(item)
}
bindIconData(imageView, item)
bindTextData(textView, item)
i++
}
}
......@@ -174,21 +156,20 @@ class HomeModuleCategoryView : FrameLayout {
* 创建图标
*/
private fun createIcon(i: Int): ImageView {
val imageParams = FrameLayout.LayoutParams(imageViewWidth, imageViewWidth)
val imageParams = LayoutParams(imageViewWidth, imageViewHeight)
val imageView = ImageView(context)
imageView.scaleType = ImageView.ScaleType.CENTER_CROP
if (i > 3) {
multiple = 2
imageParams.topMargin =
imageViewWidth + dp8 + textViewHeight + dp8 + RxImageTool.dip2px(1f)
imageParams.leftMargin = margin * (i - 3) + (i - 4) * (imageViewWidth + margin)
if (i > 2) {
//第二行
imageParams.topMargin = imageViewHeight
imageParams.leftMargin = dp12 + dp3 * (i - 3) + imageViewWidth * (i - 3)
} else {
multiple = 1
imageParams.leftMargin = margin * (i + 1) + i * (imageViewWidth + margin)
//第一行
imageParams.topMargin = 0
imageParams.leftMargin = dp12 + dp3 * i + imageViewWidth * i
}
imageView.layoutParams = imageParams
return imageView
}
......@@ -199,46 +180,7 @@ class HomeModuleCategoryView : FrameLayout {
imageView: ImageView,
categoryBean: HomeHeaderBean.AskCategoryDataBean
) {
GlideApp.with(context).load(categoryBean.coverUrl)
.centerCrop().into(imageView)
}
/**
* 创建文本
*/
private fun createText(index: Int): TextView {
val textParams = FrameLayout.LayoutParams(textViewWidth, textViewHeight)
val textView = TextView(context)
textView.setTextColor(Color.parseColor("#444444"))
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12f)
textView.gravity = Gravity.CENTER_HORIZONTAL
if (index > 3) {
textParams.topMargin = 2 * (imageViewWidth + dp8) + textViewHeight + dp8
textParams.leftMargin = textViewWidth * (index - 4)
} else {
textParams.topMargin = imageViewWidth + dp8
textParams.leftMargin = textViewWidth * (index)
}
textView.layoutParams = textParams
return textView
}
/**
* 设置文本
*/
private fun bindTextData(textView: TextView, categoryBean: HomeHeaderBean.AskCategoryDataBean) {
textView.text = categoryBean.cateTitle
}
fun onDestory() {
if (null == realTestView) {
return
}
realTestView!!.onDestory()
}
}
\ No newline at end of file
......@@ -7,6 +7,6 @@
android:width="0.5dp"/>
<corners
android:radius="@dimen/platform_dp_12"/>
android:radius="@dimen/platform_dp_14"/>
</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="@color/platform_color_FFFFFF"/>
<corners android:radius="14dp"/>
</shape>
\ No newline at end of file
......@@ -2,12 +2,13 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/platform_color_70FFFFFF" />
<gradient
android:startColor="#82A1D4"
android:endColor="#7DACCA"/>
<corners
android:bottomLeftRadius="@dimen/platform_dp_20"
android:bottomRightRadius="@dimen/platform_dp_20"
android:topRightRadius="@dimen/platform_dp_20"
android:topRightRadius="@dimen/platform_dp_10"
android:topLeftRadius="@dimen/platform_dp_10"
/>
</shape>
\ No newline at end of file
......@@ -5,11 +5,6 @@
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"
......@@ -19,127 +14,103 @@
android:orientation="horizontal"
android:paddingBottom="12dp">
<RelativeLayout
<LinearLayout
android:id="@+id/homeModuleButtonBannerFirst"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_weight="1"
android:background="@drawable/home_dcotor_bt_bg"
android:gravity="center_horizontal">
android:orientation="vertical"
android:gravity="center">
<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" />
<ImageView
android:layout_width="54dp"
android:layout_height="38dp"
android:src="@drawable/home_banner_first_icon"
android:scaleType="fitXY"/>
<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>
android:text="咨询沟通"
android:layout_marginTop="7dp"
android:textColor="@color/platform_color_242424"
android:textSize="13dp"/>
</LinearLayout>
<RelativeLayout
<LinearLayout
android:id="@+id/homeModuleButtonBannerFourth"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:background="@drawable/home_listen_bt_bg"
android:gravity="center_horizontal">
android:orientation="vertical"
android:gravity="center">
<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" />
<ImageView
android:layout_width="54dp"
android:layout_height="38dp"
android:src="@drawable/home_banner_fourth_icon"
android:scaleType="fitXY"/>
<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>
android:text="心理测试"
android:layout_marginTop="7dp"
android:textColor="@color/platform_color_242424"
android:textSize="13dp"/>
</LinearLayout>
<RelativeLayout
<LinearLayout
android:id="@+id/homeModuleButtonBannerThird"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:background="@drawable/home_course_bt_bg"
android:gravity="center_horizontal"
android:orientation="vertical">
android:orientation="vertical"
android:gravity="center">
<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" />
<ImageView
android:layout_width="54dp"
android:layout_height="38dp"
android:src="@drawable/home_banner_third_icon"
android:scaleType="fitXY"/>
<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>
android:text="主题阅读"
android:layout_marginTop="7dp"
android:textColor="@color/platform_color_242424"
android:textSize="13dp"/>
</LinearLayout>
<RelativeLayout
<LinearLayout
android:id="@+id/homeModuleButtonBannerSecond"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:background="@drawable/home_test_bt_bg"
android:gravity="center_horizontal">
android:orientation="vertical"
android:gravity="center">
<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" />
<ImageView
android:layout_width="54dp"
android:layout_height="38dp"
android:src="@drawable/home_banner_second_icon"
android:scaleType="fitXY"/>
<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>
android:text="人生答疑"
android:layout_marginTop="7dp"
android:textColor="@color/platform_color_242424"
android:textSize="13dp"/>
</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>
......@@ -4,56 +4,44 @@
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:paddingTop="@dimen/platform_dp_24"
android:paddingBottom="@dimen/platform_dp_14">
<View
android:id="@+id/view_line"
android:layout_width="0dp"
android:layout_height="5dp"
android:background="@drawable/home_common_title_gradient_back"
app:layout_constraintLeft_toLeftOf="@+id/homeModuleCommonTitleViewTitle"
app:layout_constraintRight_toRightOf="@+id/homeModuleCommonTitleViewTitle"
app:layout_constraintBottom_toBottomOf="@+id/homeModuleCommonTitleViewTitle"
android:layout_marginBottom="2dp"/>
android:paddingTop="@dimen/platform_dp_20"
android:paddingBottom="@dimen/platform_dp_6">
<TextView
android:id="@+id/homeModuleCommonTitleViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="@dimen/platform_dp_1"
tools:text="通用.标题"
android:textSize="24dp"
tools:text="通用标题"
android:textSize="20dp"
android:textStyle="bold"
android:textColor="@color/platform_color_333333"
android:textColor="@color/platform_color_242424"
android:layout_marginLeft="@dimen/platform_dp_15"
app:layout_constraintLeft_toLeftOf="parent"/>
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
<LinearLayout
android:layout_width="66dp"
android:layout_height="@dimen/platform_dp_24"
android:id="@+id/homeModuleCommonTitleViewMorell"
android:layout_width="74dp"
android:layout_height="@dimen/platform_dp_28"
android:orientation="horizontal"
android:gravity="center"
android:layout_marginBottom="@dimen/platform_dp_3"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginRight="@dimen/platform_dp_15"
android:background="@drawable/home_show_more_line">
android:background="@drawable/home_show_more_line"
android:visibility="gone">
<TextView
android:id="@+id/homeModuleCommonTitleViewMoreText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="更多"
android:text="更多选择"
android:layout_marginLeft="@dimen/platform_dp_2"
android:textColor="@color/platform_color_444444"
android:textSize="13sp"/>
<ImageView
android:layout_height="8dp"
android:layout_width="4dp"
android:src="@drawable/home_sale_arrow"
android:layout_marginLeft="3dp"/>
android:textColor="@color/platform_color_666666"
android:textSize="12dp"/>
</LinearLayout>
......
......@@ -3,109 +3,44 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.CardView
android:id="@+id/homeModuleIntelligentTopViewImageCardView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="@dimen/platform_dp_7"
app:cardElevation="0dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/homeModuleIntelligentTopViewImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/home_image_default_back"
android:scaleType="centerCrop" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="45" />
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="55"
android:background="@drawable/home_intelligent_gradient_back" />
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
android:layout_height="92dp"
android:background="@drawable/home_test_top_view_layout_back">
<TextView
android:id="@+id/homeModuleIntelligentTopViewTitle"
android:id="@+id/homeModuleTestTopViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginTop="24dp"
android:layout_marginLeft="@dimen/platform_dp_14"
android:layout_marginRight="@dimen/platform_dp_115"
android:layout_marginBottom="@dimen/platform_dp_35"
android:layout_marginRight="100dp"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_24"
android:textSize="@dimen/platform_dp_18"
android:textStyle="bold"
tools:text="先结婚还是先买先结婚还是先买房" />
<LinearLayout
android:id="@+id/homeModuleIntelligentTopViewDescLayout"
<TextView
android:id="@+id/homeModuleTestTopViewHits"
android:layout_width="wrap_content"
android:layout_height="@dimen/platform_dp_18"
android:layout_alignLeft="@+id/homeModuleIntelligentTopViewTitle"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/platform_dp_14"
android:background="@drawable/home_test_top_view_layout_back"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/platform_dp_10"
android:paddingRight="@dimen/platform_dp_10">
<TextView
android:id="@+id/homeModuleIntelligentTopViewHits"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"
tools:text="2486" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="已测"
android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_12" />
</LinearLayout>
android:layout_height="wrap_content"
android:layout_marginTop="53dp"
android:layout_marginLeft="16dp"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_12"
tools:text="2486已测" />
<RelativeLayout
android:id="@+id/ll_day_test"
android:layout_width="@dimen/platform_dp_64"
android:layout_height="@dimen/platform_dp_20"
<TextView
android:layout_width="64dp"
android:layout_height="28dp"
android:text="测试"
android:textColor="#FBAA0E"
android:textSize="13dp"
android:gravity="center"
android:layout_alignParentRight="true"
android:background="@drawable/home_intelligent_top_view_recommend_back">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="每日一测"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold" />
</RelativeLayout>
android:layout_marginTop="25dp"
android:layout_marginRight="14dp"
android:background="@drawable/home_test_top_btn_bg"/>
</RelativeLayout>
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