Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
5c3f35b7
Commit
5c3f35b7
authored
May 17, 2022
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:倾诉列表,UI修改
parent
78e215d6
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
88 additions
and
26 deletions
+88
-26
DemoGlobalConfig.java
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
+2
-2
ConfideHomeBodyBean.kt
m-confide/src/main/java/com/ydl/confide/home/bean/ConfideHomeBodyBean.kt
+4
-1
ConfideHomeRecommendView.kt
m-confide/src/main/java/com/ydl/confide/home/widget/ConfideHomeRecommendView.kt
+45
-21
confide_line_1.png
m-confide/src/main/res/drawable-xhdpi/confide_line_1.png
+0
-0
confide_line_1.webp
m-confide/src/main/res/drawable-xhdpi/confide_line_1.webp
+0
-0
confide_line_3.png
m-confide/src/main/res/drawable-xhdpi/confide_line_3.png
+0
-0
confide_recommend_view_new.xml
m-confide/src/main/res/layout/confide_recommend_view_new.xml
+35
-2
colors.xml
m-confide/src/main/res/values/colors.xml
+2
-0
No files found.
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
View file @
5c3f35b7
...
@@ -21,9 +21,9 @@ import java.util.List;
...
@@ -21,9 +21,9 @@ import java.util.List;
public
final
class
DemoGlobalConfig
implements
IConfigModule
{
public
final
class
DemoGlobalConfig
implements
IConfigModule
{
String
APP_DOMAIN
=
"https://api.github.com/"
;
String
APP_DOMAIN
=
"https://api.github.com/"
;
// public static String appEnv = YDLConstants.ENV_AUTO_TEST;
// 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_NEW_TEST;//配置未上传到maven库
public
static
String
appEnv
=
YDLConstants
.
ENV_PROD
;
//
public static String appEnv = YDLConstants.ENV_PROD;
@Override
@Override
public
void
injectAppLifecycle
(
@NotNull
Context
context
,
@NotNull
List
<
IAppLifecycles
>
lifecycles
)
{
public
void
injectAppLifecycle
(
@NotNull
Context
context
,
@NotNull
List
<
IAppLifecycles
>
lifecycles
)
{
lifecycles
.
add
(
new
DemoAppLifecycles
());
lifecycles
.
add
(
new
DemoAppLifecycles
());
...
...
m-confide/src/main/java/com/ydl/confide/home/bean/ConfideHomeBodyBean.kt
View file @
5c3f35b7
...
@@ -115,5 +115,7 @@ data class ConfideHomeBodyBean(
...
@@ -115,5 +115,7 @@ data class ConfideHomeBodyBean(
//接通率
//接通率
val
confideConnection
:
String
?,
val
confideConnection
:
String
?,
//
//
var
bodyData
:
List
<
ConfideHomeBodyBean
>?
var
bodyData
:
List
<
ConfideHomeBodyBean
>?,
var
confidePraiseScore
:
String
?,
//新增评分字段
var
listenFree
:
Boolean
?
//新增倾诉免费标识字段
)
)
\ No newline at end of file
m-confide/src/main/java/com/ydl/confide/home/widget/ConfideHomeRecommendView.kt
View file @
5c3f35b7
...
@@ -2,7 +2,6 @@ package com.ydl.confide.home.widget
...
@@ -2,7 +2,6 @@ package com.ydl.confide.home.widget
import
android.content.Context
import
android.content.Context
import
android.graphics.Color
import
android.graphics.Color
import
android.graphics.Paint
import
android.text.TextUtils
import
android.text.TextUtils
import
android.util.TypedValue
import
android.util.TypedValue
import
android.view.Gravity
import
android.view.Gravity
...
@@ -11,14 +10,17 @@ import android.view.ViewGroup
...
@@ -11,14 +10,17 @@ import android.view.ViewGroup
import
android.widget.FrameLayout
import
android.widget.FrameLayout
import
android.widget.LinearLayout
import
android.widget.LinearLayout
import
android.widget.TextView
import
android.widget.TextView
import
com.ydl.ydl_image.module.GlideApp
import
com.blankj.utilcode.util.SpanUtils
import
com.yidianling.common.tools.RxImageTool
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.engine.DiskCacheStrategy
import
com.ydl.confide.R
import
com.ydl.confide.R
import
com.ydl.confide.home.bean.ConfideHomeBodyBean
import
com.ydl.confide.home.bean.ConfideHomeBodyBean
import
com.ydl.confide.home.config.IConfideHomeConfig
import
com.ydl.confide.home.config.IConfideHomeConfig
import
com.ydl.confide.home.contract.IConfideHomeContract
import
com.ydl.confide.home.contract.IConfideHomeContract
import
com.ydl.confide.home.event.IConfideHomeEvent
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
* @author yuanwai
...
@@ -41,7 +43,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
...
@@ -41,7 +43,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
private
fun
initView
()
{
private
fun
initView
()
{
var
params
=
FrameLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
var
params
=
FrameLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
layoutParams
=
params
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
)
dp96
=
RxImageTool
.
dip2px
(
96f
)
dp16
=
RxImageTool
.
dip2px
(
16f
)
dp16
=
RxImageTool
.
dip2px
(
16f
)
dp4
=
RxImageTool
.
dip2px
(
4f
)
dp4
=
RxImageTool
.
dip2px
(
4f
)
...
@@ -63,21 +65,23 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
...
@@ -63,21 +65,23 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
//设置名称
//设置名称
tv_name
.
text
=
bodyBean
.
confidedName
tv_name
.
text
=
bodyBean
.
confidedName
//设置性别
//设置性别
setSex
(
bodyBean
)
//
setSex(bodyBean)
//设置向TA倾诉文案
//设置向TA倾诉文案
setConfideNum
(
bodyBean
)
setConfideNum
(
bodyBean
)
//设置接通率文案
//设置接通率文案
setConnection
(
bodyBean
)
setConnection
(
bodyBean
)
//设置价格
//设置价格
setPrice
(
bodyBean
)
//
setPrice(bodyBean)
//设置红包、原价
//设置红包、原价
setCoupon
(
bodyBean
)
//
setCoupon(bodyBean)
//设置标签
//设置标签
setConfideTag
(
bodyBean
)
setConfideTag
(
bodyBean
)
//设置咨询师简介
//设置咨询师简介
tv_content
.
text
=
bodyBean
.
confideContent
tv_content
.
text
=
bodyBean
.
confideContent
//设置向TA倾诉按钮状态
//设置向TA倾诉按钮状态
setConfideButton
(
bodyBean
)
setConfideButton
(
bodyBean
)
setListenAndScore
(
bodyBean
)
//设置页面点击事件
//设置页面点击事件
this
.
setOnClickListener
{
this
.
setOnClickListener
{
...
@@ -85,6 +89,26 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
...
@@ -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
...
@@ -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) {
if (bodyBean.confideSex == 1) {
img_sex.setImageResource(R.drawable.confide_new_male)
img_sex.setImageResource(R.drawable.confide_new_male)
} else {
} else {
img_sex.setImageResource(R.drawable.confide_new_female)
img_sex.setImageResource(R.drawable.confide_new_female)
}
}
}
}
*/
/**
/**
* 设置向TA倾诉文案
* 设置向TA倾诉文案
...
@@ -188,15 +212,15 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
...
@@ -188,15 +212,15 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
/**
/**
* 设置价格
* 设置价格
*/
*/
private
fun
setPrice
(
bodyBean
:
ConfideHomeBodyBean
)
{
//
private fun setPrice(bodyBean: ConfideHomeBodyBean) {
val
sb
=
StringBuffer
()
//
val sb = StringBuffer()
if
(
TextUtils
.
isEmpty
(
bodyBean
.
confideFee
))
{
//
if (TextUtils.isEmpty(bodyBean.confideFee)) {
sb
.
append
(
"0"
)
//
sb.append("0")
}
else
{
//
} else {
sb
.
append
(
bodyBean
.
confideFee
)
//
sb.append(bodyBean.confideFee)
}
//
}
tv_price
.
text
=
sb
.
toString
()
//
tv_price.text = sb.toString()
}
//
}
/**
/**
* 设置标签 todo 待优化
* 设置标签 todo 待优化
...
@@ -255,7 +279,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
...
@@ -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)) {
if (!TextUtils.isEmpty(bodyBean.couponText)) {
tvCoupon.text = bodyBean.couponText
tvCoupon.text = bodyBean.couponText
tvCoupon.visibility = View.VISIBLE
tvCoupon.visibility = View.VISIBLE
...
@@ -286,7 +310,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
...
@@ -286,7 +310,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
}
}
}
}
}
}
*/
/**
/**
* 点击事件
* 点击事件
...
...
m-confide/src/main/res/drawable-xhdpi/confide_line_1.png
deleted
100644 → 0
View file @
78e215d6
4.33 KB
m-confide/src/main/res/drawable-xhdpi/confide_line_1.webp
0 → 100644
View file @
5c3f35b7
File added
m-confide/src/main/res/drawable-xhdpi/confide_line_3.png
View replaced file @
78e215d6
View file @
5c3f35b7
6.59 KB
|
W:
|
H:
6.54 KB
|
W:
|
H:
2-up
Swipe
Onion skin
m-confide/src/main/res/layout/confide_recommend_view_new.xml
View file @
5c3f35b7
...
@@ -3,7 +3,9 @@
...
@@ -3,7 +3,9 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
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
<androidx.cardview.widget.CardView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
@@ -150,7 +152,6 @@
...
@@ -150,7 +152,6 @@
android:orientation=
"horizontal"
android:orientation=
"horizontal"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"16dp"
android:layout_height=
"16dp"
app:layout_constraintTop_toBottomOf=
"@id/ll_confide_data"
app:layout_constraintStart_toEndOf=
"@id/img_bg"
app:layout_constraintStart_toEndOf=
"@id/img_bg"
android:layout_marginStart=
"14dp"
android:layout_marginStart=
"14dp"
app:layout_constraintBottom_toBottomOf=
"@id/img_bg"
app:layout_constraintBottom_toBottomOf=
"@id/img_bg"
...
@@ -159,6 +160,7 @@
...
@@ -159,6 +160,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"50元/25分钟"
android:text=
"50元/25分钟"
android:id=
"@+id/price_content"
android:textSize=
"@dimen/platform_sp_12"
android:textSize=
"@dimen/platform_sp_12"
app:layout_constraintStart_toEndOf=
"@id/flowlayout_tag"
app:layout_constraintStart_toEndOf=
"@id/flowlayout_tag"
app:layout_constraintBottom_toBottomOf=
"@id/flowlayout_tag"
app:layout_constraintBottom_toBottomOf=
"@id/flowlayout_tag"
...
@@ -177,4 +179,34 @@
...
@@ -177,4 +179,34 @@
android:layout_marginTop=
"@dimen/platform_dp_15"
android:layout_marginTop=
"@dimen/platform_dp_15"
tools:text=
"没有人一出生就是完美的,只有不断的相信自...己…才能成就自己的梦想。"
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>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
m-confide/src/main/res/values/colors.xml
View file @
5c3f35b7
...
@@ -6,4 +6,6 @@
...
@@ -6,4 +6,6 @@
<color
name=
"confide_category_bg"
>
#FAFAFA
</color>
<color
name=
"confide_category_bg"
>
#FAFAFA
</color>
<color
name=
"confide_61CEAC"
>
#61CEAC
</color>
<color
name=
"confide_61CEAC"
>
#61CEAC
</color>
<color
name=
"confide_48CC95"
>
#48CC95
</color>
<color
name=
"confide_48CC95"
>
#48CC95
</color>
<color
name=
"confide_fe6040"
>
#fe6040
</color>
<color
name=
"confide_aaaeba"
>
#aaaeba
</color>
</resources>
</resources>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment