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
cad1c67e
Commit
cad1c67e
authored
May 20, 2020
by
ydl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backup
parent
0fd403d0
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
52 additions
and
28 deletions
+52
-28
DemoGlobalConfig.java
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
+2
-2
config.gradle
config.gradle
+1
-1
HomeConsultView.kt
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeConsultView.kt
+5
-4
HomeCourseItemView.kt
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeCourseItemView.kt
+20
-3
HomeTestItemView.kt
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeTestItemView.kt
+10
-3
HomeTestView.kt
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeTestView.kt
+3
-3
home_consult_chat_rest_bg.xml
m-home/src/xlzx/res/drawable/home_consult_chat_rest_bg.xml
+2
-1
home_button_banner_view.xml
m-home/src/xlzx/res/layout/home_button_banner_view.xml
+4
-4
home_course_item_view.xml
m-home/src/xlzx/res/layout/home_course_item_view.xml
+1
-1
home_layout_home_module_input.xml
m-home/src/xlzx/res/layout/home_layout_home_module_input.xml
+2
-2
home_test_item_view.xml
m-home/src/xlzx/res/layout/home_test_item_view.xml
+2
-3
home_test_top_item_view.xml
m-home/src/xlzx/res/layout/home_test_top_item_view.xml
+0
-1
No files found.
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
View file @
cad1c67e
...
...
@@ -20,8 +20,8 @@ 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_PROD;
//
public static String appEnv = YDLConstants.ENV_TEST;
public
static
String
appEnv
=
YDLConstants
.
ENV_PROD
;
@Override
public
void
injectAppLifecycle
(
@NotNull
Context
context
,
@NotNull
List
<
IAppLifecycles
>
lifecycles
)
{
...
...
config.gradle
View file @
cad1c67e
ext
{
kotlin_version
=
"1.3.21"
dev_mode
=
fals
e
dev_mode
=
tru
e
ydlPublishVersion
=
[
// -------------- 业务模块 --------------
...
...
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeConsultView.kt
View file @
cad1c67e
...
...
@@ -43,6 +43,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
private
var
listener
:
ConsultTabSelectedListener
?
=
null
private
var
dp5
:
Int
=
0
private
var
dp7
:
Int
=
0
private
var
dp10
:
Int
=
0
private
var
dp16
:
Int
=
0
...
...
@@ -52,6 +53,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
private
fun
initView
()
{
dp5
=
RxImageTool
.
dp2px
(
5f
)
dp7
=
RxImageTool
.
dp2px
(
7f
)
dp10
=
RxImageTool
.
dp2px
(
10f
)
dp16
=
RxImageTool
.
dp2px
(
16f
)
...
...
@@ -126,7 +128,6 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
cacheInfoViewList
=
ArrayList
()
}
// TODO xj
//创建HomeConsultItemView:每个tab最多显示四个专家
if
(
cacheInfoViewList
!!
.
size
>=
list
.
size
)
{
for
(
index
in
0
until
list
!!
.
size
)
{
...
...
@@ -144,7 +145,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
}
else
{
for
(
index
in
0
until
list
!!
.
size
)
{
if
(
index
>
3
)
{
//只取前
三
条数据
//只取前
四
条数据
break
}
//数据大于缓存view数量,创建view
...
...
@@ -223,12 +224,12 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
if
(!
isSelected
)
{
txtView
.
textSize
=
12f
txtView
.
setTextColor
(
Color
.
parseColor
(
"#999999"
))
txtView
.
setPadding
(
dp10
,
dp5
,
dp10
,
dp
5
)
txtView
.
setPadding
(
dp10
,
dp5
,
dp10
,
dp
7
)
txtView
.
setBackgroundResource
(
R
.
drawable
.
home_consult_tab_item_unselected_bg
)
}
else
{
txtView
.
textSize
=
12f
txtView
.
setTextColor
(
Color
.
parseColor
(
"#FD9B0A"
))
txtView
.
setPadding
(
dp10
,
dp5
,
dp10
,
dp
5
)
txtView
.
setPadding
(
dp10
,
dp5
,
dp10
,
dp
7
)
txtView
.
setBackgroundResource
(
R
.
drawable
.
home_consult_tab_item_selected_bg
)
}
...
...
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeCourseItemView.kt
View file @
cad1c67e
package
com.yidianling.home.ui.view
import
android.annotation.SuppressLint
import
android.content.Context
import
android.view.View
import
android.view.ViewGroup
...
...
@@ -36,6 +37,7 @@ class HomeCourseItemView(private val mContext: Context, private var homeEvent: I
/**
* 刷新数据
*/
@SuppressLint
(
"SetTextI18n"
)
fun
updateData
(
bean
:
HomeCourseBean
.
ListBean
?)
{
YDLImageCacheManager
.
showImage
(
mContext
,
bean
?.
pic
,
homeModuleCourseItemViewImg
)
...
...
@@ -48,15 +50,29 @@ class HomeCourseItemView(private val mContext: Context, private var homeEvent: I
}
else
{
if
(
bean
?.
isPromotion
==
1
)
{
homeModuleCourseItemViewExpensePrice
.
text
=
"¥"
+
String
.
format
(
"%.2f"
,
bean
?.
promotionApplyFee
!!
)
"¥"
+
getLastPrice
(
String
.
format
(
"%.2f"
,
bean
?.
promotionApplyFee
?:
0
)
)
}
else
{
homeModuleCourseItemViewExpensePrice
.
text
=
"¥"
+
String
.
format
(
"%.2f"
,
bean
?.
applyFee
!!
)
"¥"
+
getLastPrice
(
String
.
format
(
"%.2f"
,
bean
?.
applyFee
?:
0
)
)
}
}
setOnClickListener
{
homeEvent
?.
courseItemClick
(
bean
)
bean
?.
let
{
homeEvent
?.
courseItemClick
(
bean
)
}
}
}
fun
getLastPrice
(
price
:
String
):
String
{
if
(
price
.
length
>
3
)
{
if
(
"0"
.
equals
(
price
[
price
.
lastIndex
])
&&
"0"
.
equals
(
price
[
price
.
lastIndex
-
1
])
&&
"."
.
equals
(
price
[
price
.
lastIndex
-
2
]
)
)
{
return
price
.
substring
(
0
,
price
.
length
-
3
)
}
}
return
price
}
}
\ No newline at end of file
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeTestItemView.kt
View file @
cad1c67e
...
...
@@ -44,7 +44,13 @@ class HomeTestItemView(private val mContext: Context, private var homeEvent: IHo
*/
fun
updateData
(
bean
:
HomeTestItemBean
,
isLast
:
Boolean
)
{
tv_test_item_name
.
text
=
bean
.
name
tv_tested_count
.
text
=
bean
.
testNum
.
toString
()
var
numStr
=
""
if
(
bean
.
testNum
>=
10000
)
{
numStr
=
String
.
format
(
"%.1f"
,
(
bean
.
testNum
/
10000.0
))
+
"万"
}
else
{
numStr
=
bean
.
testNum
.
toString
()
}
tv_tested_count
.
text
=
numStr
YDLImageCacheManager
.
showImage
(
mContext
,
bean
?.
shareImage
,
iv_test_item
)
this
.
setOnClickListener
{
...
...
@@ -57,7 +63,7 @@ class HomeTestItemView(private val mContext: Context, private var homeEvent: IHo
* 电台第二个item会有一个marginTop值
*/
fun
setTopMargin
()
{
params
?.
topMargin
=
RxImageTool
.
dp2px
(
1
6
f
)
params
?.
topMargin
=
RxImageTool
.
dp2px
(
1
5
f
)
layoutParams
=
params
}
...
...
@@ -65,7 +71,7 @@ class HomeTestItemView(private val mContext: Context, private var homeEvent: IHo
* 电台最后一个item会有一个marginBottom值
*/
fun
setBottomMargin
()
{
params
?.
bottomMargin
=
RxImageTool
.
dp2px
(
1
6
f
)
params
?.
bottomMargin
=
RxImageTool
.
dp2px
(
1
5
f
)
layoutParams
=
params
}
}
\ No newline at end of file
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeTestView.kt
View file @
cad1c67e
...
...
@@ -55,9 +55,9 @@ class HomeTestView(private val mContext: Context, private var homeEvent: HomeImp
if
(
index
==
1
)
{
itemView
.
setTopMargin
()
}
// else
if (index == homeModuleIntelligentViewAddLayout.childCount -1) {
//
itemView.setBottomMargin()
//
}
if
(
index
==
homeModuleIntelligentViewAddLayout
.
childCount
-
1
)
{
itemView
.
setBottomMargin
()
}
itemView
.
updateData
(
list
[
index
],
index
==
list
.
size
-
1
)
}
else
if
(
itemView
is
HomeTestTopItemView
)
{
itemView
.
updateData
(
list
[
index
])
...
...
m-home/src/xlzx/res/drawable/home_consult_chat_rest_bg.xml
View file @
cad1c67e
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"@color/platform_color_F
5F5F5
"
/>
<solid
android:color=
"@color/platform_color_F
6F6F6
"
/>
<corners
android:radius=
"@dimen/platform_dp_14"
/>
</shape>
\ No newline at end of file
m-home/src/xlzx/res/layout/home_button_banner_view.xml
View file @
cad1c67e
...
...
@@ -33,7 +33,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"咨询沟通"
android:layout_marginTop=
"
7
dp"
android:layout_marginTop=
"
3
dp"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"13dp"
/>
</LinearLayout>
...
...
@@ -56,7 +56,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"心理测试"
android:layout_marginTop=
"
7
dp"
android:layout_marginTop=
"
3
dp"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"13dp"
/>
</LinearLayout>
...
...
@@ -79,7 +79,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"主题阅读"
android:layout_marginTop=
"
7
dp"
android:layout_marginTop=
"
3
dp"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"13dp"
/>
</LinearLayout>
...
...
@@ -102,7 +102,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"人生答疑"
android:layout_marginTop=
"
7
dp"
android:layout_marginTop=
"
3
dp"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"13dp"
/>
</LinearLayout>
...
...
m-home/src/xlzx/res/layout/home_course_item_view.xml
View file @
cad1c67e
...
...
@@ -28,7 +28,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/homeModuleCourseItemViewImgCardView"
android:textSize=
"@dimen/platform_dp_1
6
"
android:textSize=
"@dimen/platform_dp_1
5
"
android:textColor=
"@color/platform_color_242424"
android:textStyle=
"bold"
android:maxLines=
"2"
...
...
m-home/src/xlzx/res/layout/home_layout_home_module_input.xml
View file @
cad1c67e
...
...
@@ -79,8 +79,8 @@
android:orientation=
"vertical"
android:gravity=
"center"
>
<ImageView
android:layout_width=
"2
3.3
dp"
android:layout_height=
"2
1.3
dp"
android:layout_width=
"2
4
dp"
android:layout_height=
"2
4
dp"
android:src=
"@drawable/home_module_top_xiaoyi_icon"
/>
</LinearLayout>
...
...
m-home/src/xlzx/res/layout/home_test_item_view.xml
View file @
cad1c67e
...
...
@@ -5,12 +5,12 @@
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:layout_marginBottom=
"30dp"
>
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"15dp"
android:layout_marginBottom=
"12dp"
android:layout_marginLeft=
"15dp"
android:layout_marginRight=
"15dp"
...
...
@@ -72,7 +72,6 @@
android:layout_height=
"wrap_content"
android:textColor=
"@color/platform_color_999999"
android:textSize=
"@dimen/platform_dp_12"
android:textStyle=
"bold"
tools:text=
"2486"
/>
...
...
m-home/src/xlzx/res/layout/home_test_top_item_view.xml
View file @
cad1c67e
...
...
@@ -4,7 +4,6 @@
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
...
...
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