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
d7bd79d8
Commit
d7bd79d8
authored
May 17, 2022
by
万齐军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature: 首页UI布局
parent
94eeae82
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
12 deletions
+52
-12
ConfideHomeActivity.kt
m-confide/src/main/java/com/ydl/confide/home/ConfideHomeActivity.kt
+3
-0
VideoShowAdapter.kt
m-confide/src/main/java/com/ydl/confide/home/adapter/VideoShowAdapter.kt
+6
-5
ConfideLineBindingAdapter.kt
m-confide/src/main/java/com/ydl/confide/home/util/ConfideLineBindingAdapter.kt
+25
-0
item_confide_home_recent.xml
m-confide/src/main/res/layout/item_confide_home_recent.xml
+9
-3
item_video_show.xml
m-confide/src/main/res/layout/item_video_show.xml
+9
-4
No files found.
m-confide/src/main/java/com/ydl/confide/home/ConfideHomeActivity.kt
View file @
d7bd79d8
...
...
@@ -260,6 +260,9 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
NewH5Activity
.
start
(
this
,
h5Paramsqing
)
}
findViewById
<
View
>(
R
.
id
.
img_customer
)
?.
setOnClickListener
{
if
(!
PhoneCallIn
.
loginByOneKeyLogin
(
this
,
true
))
{
return
@setOnClickListener
}
val
imService
=
ARouter
.
getInstance
().
navigation
(
IImService
::
class
.
java
)
imService
?.
startKefuChat
(
this
,
""
,
0
,
0
)
}
...
...
m-confide/src/main/java/com/ydl/confide/home/adapter/VideoShowAdapter.kt
View file @
d7bd79d8
...
...
@@ -4,6 +4,7 @@ import android.view.LayoutInflater
import
android.view.ViewGroup
import
androidx.databinding.DataBindingUtil
import
androidx.databinding.ObservableField
import
androidx.databinding.ObservableInt
import
androidx.recyclerview.widget.RecyclerView
import
com.ydl.confide.R
import
com.ydl.confide.databinding.ItemConfideHomeRecentBinding
...
...
@@ -28,7 +29,7 @@ class VideoShowAdapter(private val data: List<ConfideHomeBodyBean>?, private val
override
fun
onBindViewHolder
(
holder
:
BindingViewHolder
<
ItemVideoShowBinding
>,
position
:
Int
)
{
val
itemVideoShowViewModel
=
dataList
[
position
]
holder
.
binding
.
item
=
itemVideoShowViewModel
holder
.
itemView
.
setOnClickListener
{
event
.
videoShowClick
(
position
,
data
)
}
holder
.
itemView
.
setOnClickListener
{
/*event.videoShowClick(position, data)*/
}
}
override
fun
getItemCount
()
=
dataList
.
size
...
...
@@ -66,14 +67,14 @@ class ItemVideoShowViewModel {
val
name
=
ObservableField
<
String
>(
""
)
val
coverUrl
=
ObservableField
<
String
>(
""
)
val
videoCoverUrl
=
ObservableField
<
String
>(
""
)
val
state
=
Observable
Field
<
String
>(
""
)
val
state
=
Observable
Int
(
)
}
internal
fun
ItemVideoShowViewModel
.
mapOf
(
bean
:
ConfideHomeBodyBean
):
ItemVideoShowViewModel
{
name
.
set
(
bean
.
confidedName
)
coverUrl
.
set
(
bean
.
co
nfidedIcon
/*coverPicture*/
)
videoCoverUrl
.
set
(
bean
.
co
nfidedIcon
/*coverVideoPicture*/
)
state
.
set
(
bean
.
confideLine
.
toString
()
)
coverUrl
.
set
(
bean
.
co
verPicture
)
videoCoverUrl
.
set
(
bean
.
co
verVideoPicture
)
state
.
set
(
bean
.
confideLine
?:
0
)
linkUrl
=
bean
.
linkUrl
return
this
}
...
...
m-confide/src/main/java/com/ydl/confide/home/util/ConfideLineBindingAdapter.kt
View file @
d7bd79d8
...
...
@@ -2,6 +2,7 @@ package com.ydl.confide.home.util
import
android.widget.TextView
import
androidx.databinding.BindingAdapter
import
com.ydl.confide.R
@BindingAdapter
(
"confideLineText"
)
fun
TextView
.
confideLineText
(
line
:
Int
)
{
...
...
@@ -17,3 +18,26 @@ fun TextView.confideLineText(line: Int) {
}
}
}
@BindingAdapter
(
"confideLineRecentText"
)
fun
TextView
.
confideLineRecentText
(
line
:
Int
)
{
when
(
line
)
{
1
->
{
text
=
"空闲"
setBackgroundResource
(
R
.
drawable
.
confide_bg_main_color
)
}
2
->
{
text
=
"离线"
setBackgroundResource
(
R
.
drawable
.
confide_bg_color_666666
)
}
3
->
{
text
=
"通话中"
setBackgroundResource
(
R
.
drawable
.
confide_bg_color_ff8f38
)
}
else
->{
text
=
""
background
=
null
}
}
}
\ No newline at end of file
m-confide/src/main/res/layout/item_confide_home_recent.xml
View file @
d7bd79d8
...
...
@@ -28,7 +28,8 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom|center"
android:layout_marginBottom=
"10dp"
android:layout_marginBottom=
"2dp"
android:maxLines=
"1"
android:text=
"@{item.name}"
android:textColor=
"@color/white"
android:textSize=
"10sp"
/>
...
...
@@ -38,9 +39,14 @@
android:layout_height=
"wrap_content"
android:layout_gravity=
"top|left"
android:layout_marginBottom=
"2dp"
android:text=
"@{item.state}"
android:maxLines=
"1"
android:paddingLeft=
"4dp"
android:paddingTop=
"2dp"
android:paddingRight=
"4dp"
android:paddingBottom=
"2dp"
android:textColor=
"@color/white"
android:textSize=
"7sp"
/>
android:textSize=
"7sp"
app:confideLineRecentText=
"@{item.state}"
/>
</androidx.cardview.widget.CardView>
</layout>
m-confide/src/main/res/layout/item_video_show.xml
View file @
d7bd79d8
...
...
@@ -12,13 +12,19 @@
<androidx.cardview.widget.CardView
android:layout_width=
"180dp"
android:layout_height=
"140dp"
android:layout_marginLeft=
"
5
dp"
android:layout_marginLeft=
"
6
dp"
android:layout_marginTop=
"20dp"
android:layout_marginRight=
"
5
dp"
android:layout_marginRight=
"
6
dp"
android:layout_marginBottom=
"10dp"
app:cardCornerRadius=
"8dp"
app:cardElevation=
"0dp"
>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:scaleType=
"centerCrop"
app:imageUrl=
"@{item.videoCoverUrl}"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
@@ -33,7 +39,6 @@
android:layout_width=
"33dp"
android:layout_height=
"33dp"
android:layout_gravity=
"center"
android:src=
"@drawable/ic_video_play"
app:imageUrl=
"@{item.videoCoverUrl}"
/>
android:src=
"@drawable/ic_video_play"
/>
</androidx.cardview.widget.CardView>
</layout>
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