Commit 5c3f35b7 by 霍志良

feat:倾诉列表,UI修改

parent 78e215d6
......@@ -21,9 +21,9 @@ import java.util.List;
public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/";
// public static String appEnv = YDLConstants.ENV_AUTO_TEST;
// public static String appEnv = YDLConstants.ENV_TEST;
public static String appEnv = YDLConstants.ENV_TEST;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
public static String appEnv = YDLConstants.ENV_PROD;
// public static String appEnv = YDLConstants.ENV_PROD;
@Override
public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) {
lifecycles.add(new DemoAppLifecycles());
......
......@@ -115,5 +115,7 @@ data class ConfideHomeBodyBean(
//接通率
val confideConnection : String?,
//
var bodyData : List<ConfideHomeBodyBean>?
var bodyData : List<ConfideHomeBodyBean>?,
var confidePraiseScore:String?,//新增评分字段
var listenFree:Boolean?//新增倾诉免费标识字段
)
\ No newline at end of file
......@@ -2,7 +2,6 @@ package com.ydl.confide.home.widget
import android.content.Context
import android.graphics.Color
import android.graphics.Paint
import android.text.TextUtils
import android.util.TypedValue
import android.view.Gravity
......@@ -11,14 +10,17 @@ import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.LinearLayout
import android.widget.TextView
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.common.tools.RxImageTool
import com.blankj.utilcode.util.SpanUtils
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.config.IConfideHomeConfig
import com.ydl.confide.home.contract.IConfideHomeContract
import com.ydl.confide.home.event.IConfideHomeEvent
import kotlinx.android.synthetic.main.confide_recommend_view.view.*
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.common.tools.RxImageTool
import kotlinx.android.synthetic.main.confide_recommend_view_new.view.*
/**
* @author yuanwai
......@@ -41,7 +43,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
private fun initView() {
var params = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(context, R.layout.confide_recommend_view, this)
View.inflate(context, R.layout.confide_recommend_view_new, this)
dp96 = RxImageTool.dip2px(96f)
dp16 = RxImageTool.dip2px(16f)
dp4 = RxImageTool.dip2px(4f)
......@@ -63,21 +65,23 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
//设置名称
tv_name.text = bodyBean.confidedName
//设置性别
setSex(bodyBean)
// setSex(bodyBean)
//设置向TA倾诉文案
setConfideNum(bodyBean)
//设置接通率文案
setConnection(bodyBean)
//设置价格
setPrice(bodyBean)
// setPrice(bodyBean)
//设置红包、原价
setCoupon(bodyBean)
// setCoupon(bodyBean)
//设置标签
setConfideTag(bodyBean)
//设置咨询师简介
tv_content.text = bodyBean.confideContent
//设置向TA倾诉按钮状态
setConfideButton(bodyBean)
setListenAndScore(bodyBean)
//设置页面点击事件
this.setOnClickListener {
......@@ -85,6 +89,26 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
}
}
private fun setListenAndScore(bodyBean: ConfideHomeBodyBean) {
SpanUtils.with(price_content).append(bodyBean.confideFee.toString())
.setForegroundColor(resources.getColor(R.color.confide_fe6040)).setFontSize(18, true)
.append("元").setForegroundColor(resources.getColor(R.color.confide_fe6040))
.setFontSize(11, true)
.append("/25分钟").setForegroundColor(resources.getColor(R.color.confide_aaaeba))
.setFontSize(11, true)
.create()
tv_score.text = bodyBean.confidePraiseScore
if (bodyBean.listenFree == true) {
confide_free_logo.visibility = VISIBLE
Glide.with(context)
.load(R.drawable.confide__free)
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.into(confide_free_logo)
} else {
confide_free_logo.visibility = GONE
}
}
/**
* 设置在线状态
*/
......@@ -149,13 +173,13 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
/**
* 设置性别
*/
private fun setSex(bodyBean: ConfideHomeBodyBean) {
/*private fun setSex(bodyBean: ConfideHomeBodyBean) {
if (bodyBean.confideSex == 1) {
img_sex.setImageResource(R.drawable.confide_new_male)
} else {
img_sex.setImageResource(R.drawable.confide_new_female)
}
}
}*/
/**
* 设置向TA倾诉文案
......@@ -188,15 +212,15 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
/**
* 设置价格
*/
private fun setPrice(bodyBean: ConfideHomeBodyBean) {
val sb = StringBuffer()
if (TextUtils.isEmpty(bodyBean.confideFee)) {
sb.append("0")
} else {
sb.append(bodyBean.confideFee)
}
tv_price.text = sb.toString()
}
// private fun setPrice(bodyBean: ConfideHomeBodyBean) {
// val sb = StringBuffer()
// if (TextUtils.isEmpty(bodyBean.confideFee)) {
// sb.append("0")
// } else {
// sb.append(bodyBean.confideFee)
// }
// tv_price.text = sb.toString()
// }
/**
* 设置标签 todo 待优化
......@@ -255,7 +279,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
/**
* 设置红包、原价
*/
private fun setCoupon(bodyBean: ConfideHomeBodyBean) {
/*private fun setCoupon(bodyBean: ConfideHomeBodyBean) {
if (!TextUtils.isEmpty(bodyBean.couponText)) {
tvCoupon.text = bodyBean.couponText
tvCoupon.visibility = View.VISIBLE
......@@ -286,7 +310,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
}
}
}
}*/
/**
* 点击事件
......
......@@ -3,7 +3,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/white"
>
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -150,7 +152,6 @@
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="16dp"
app:layout_constraintTop_toBottomOf="@id/ll_confide_data"
app:layout_constraintStart_toEndOf="@id/img_bg"
android:layout_marginStart="14dp"
app:layout_constraintBottom_toBottomOf="@id/img_bg"
......@@ -159,6 +160,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="50元/25分钟"
android:id="@+id/price_content"
android:textSize="@dimen/platform_sp_12"
app:layout_constraintStart_toEndOf="@id/flowlayout_tag"
app:layout_constraintBottom_toBottomOf="@id/flowlayout_tag"
......@@ -177,4 +179,34 @@
android:layout_marginTop="@dimen/platform_dp_15"
tools:text="没有人一出生就是完美的,只有不断的相信自...己…才能成就自己的梦想。"
/>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
>
<TextView
android:id="@+id/tv_confide"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="@dimen/platform_dp_15"
android:layout_marginEnd="@dimen/platform_dp_15"
android:gravity="center"
tools:background="@drawable/confide_line_1"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/confide_free_logo"
android:layout_marginTop="@dimen/platform_dp_5"
android:layout_marginStart="@dimen/platform_dp_8"
>
</ImageView>
</FrameLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
app:layout_constraintTop_toBottomOf="@id/tv_content"
android:layout_marginTop="@dimen/platform_dp_12"
android:layout_marginLeft="@dimen/confide_dp_15"
android:background="@color/confide_line"/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -6,4 +6,6 @@
<color name="confide_category_bg">#FAFAFA</color>
<color name="confide_61CEAC">#61CEAC</color>
<color name="confide_48CC95">#48CC95</color>
<color name="confide_fe6040">#fe6040</color>
<color name="confide_aaaeba">#aaaeba</color>
</resources>
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