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
94eeae82
Commit
94eeae82
authored
May 16, 2022
by
万齐军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature: 呼叫按钮的状态
parent
7da17db6
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
129 additions
and
26 deletions
+129
-26
DialStatus.kt
m-confide/src/main/java/com/ydl/confide/home/bean/DialStatus.kt
+6
-0
ConfideHomeApi.kt
m-confide/src/main/java/com/ydl/confide/home/http/ConfideHomeApi.kt
+6
-0
ConfideLineBindingAdapter.kt
m-confide/src/main/java/com/ydl/confide/home/util/ConfideLineBindingAdapter.kt
+20
-0
IntroAdapter.kt
m-confide/src/main/java/com/ydl/confide/intro/IntroAdapter.kt
+26
-0
ItemIntroHolder.kt
m-confide/src/main/java/com/ydl/confide/intro/ItemIntroHolder.kt
+2
-1
ic_confide_call.png
m-confide/src/main/res/drawable-xxhdpi/ic_confide_call.png
+0
-0
confide_line_bg_1.xml
m-confide/src/main/res/drawable/confide_line_bg_1.xml
+8
-0
confide_line_bg_2.xml
m-confide/src/main/res/drawable/confide_line_bg_2.xml
+8
-0
confide_line_bg_3.xml
m-confide/src/main/res/drawable/confide_line_bg_3.xml
+8
-0
item_expert_intro.xml
m-confide/src/main/res/layout/item_expert_intro.xml
+41
-10
BindingAdapter1.kt
ydl-utils/src/main/java/com/yidianling/common/binding/BindingAdapter1.kt
+4
-15
No files found.
m-confide/src/main/java/com/ydl/confide/home/bean/DialStatus.kt
0 → 100644
View file @
94eeae82
package
com.ydl.confide.home.bean
class
DialStatus
{
var
confideLine
:
Int
?
=
null
}
\ No newline at end of file
m-confide/src/main/java/com/ydl/confide/home/http/ConfideHomeApi.kt
View file @
94eeae82
...
...
@@ -2,6 +2,7 @@ package com.ydl.confide.home.http
import
com.ydl.confide.home.bean.ConfideConnectResponse
import
com.ydl.confide.home.bean.ConfideHomeDataBean
import
com.ydl.confide.home.bean.DialStatus
import
com.ydl.ydlcommon.base.config.YDL_DOMAIN
import
com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
...
...
@@ -33,4 +34,8 @@ interface ConfideHomeApi {
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
,
"Content-Type:application/json"
)
@GET
(
"auth/listen/dial"
)
fun
connectJava
(
@QueryMap
params
:
Map
<
String
,
String
>):
Observable
<
BaseAPIResponse
<
ConfideConnectResponse
>>
// 1=在线 3-通话中 2-离线
@GET
(
"auth/listen/dialchangestatus"
)
fun
getDialStatus
(
@Query
(
"doctorId"
)
doctorId
:
String
):
Observable
<
BaseAPIResponse
<
DialStatus
>>
}
\ No newline at end of file
m-confide/src/main/java/com/ydl/confide/home/util/ConfideLineBindingAdapter.kt
0 → 100644
View file @
94eeae82
package
com.ydl.confide.home.util
import
android.widget.TextView
import
androidx.databinding.BindingAdapter
@BindingAdapter
(
"confideLineText"
)
fun
TextView
.
confideLineText
(
line
:
Int
)
{
when
(
line
)
{
1
->
{
text
=
"立即拨打"
}
2
->
{
text
=
"已离线"
}
3
->
{
text
=
"通话中"
}
}
}
\ No newline at end of file
m-confide/src/main/java/com/ydl/confide/intro/IntroAdapter.kt
View file @
94eeae82
...
...
@@ -15,8 +15,14 @@ import androidx.recyclerview.widget.RecyclerView
import
com.dou361.ijkplayer.widget.IjkVideoView
import
com.ydl.confide.R
import
com.ydl.confide.databinding.ItemExpertIntroBinding
import
com.ydl.confide.home.http.ConfideHomeApi
import
com.ydl.confide.home.util.ConfideNetworkUtil
import
com.ydl.ydlcommon.view.dialog.CommonDialog
import
com.ydl.ydlnet.YDLHttpUtils
import
com.yidianling.common.tools.ToastUtil
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.disposables.Disposable
import
io.reactivex.schedulers.Schedulers
internal
class
IntroAdapter
(
private
val
context
:
Context
,
...
...
@@ -30,6 +36,8 @@ internal class IntroAdapter(
private
var
curPos
=
0
private
var
dispose
:
Disposable
?
=
null
init
{
lifecycleOwner
.
lifecycle
.
addObserver
(
this
)
}
...
...
@@ -132,6 +140,24 @@ internal class IntroAdapter(
fun
onSelect
(
position
:
Int
)
{
curPos
=
position
val
confideApi
=
YDLHttpUtils
.
obtainApi
(
ConfideHomeApi
::
class
.
java
)
val
curUid
=
data
[
position
].
uid
if
(
curUid
!=
null
)
{
dispose
?.
dispose
()
dispose
=
confideApi
.
getDialStatus
(
curUid
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
({
resp
->
if
(
resp
.
code
==
"200"
)
{
val
lineStatus
=
resp
.
data
?.
confideLine
?:
2
data
[
position
].
lineStatus
.
set
(
lineStatus
)
}
else
{
if
(!
resp
.
msg
.
isNullOrEmpty
())
{
ToastUtil
.
toastShort
(
resp
.
msg
)
}
}
},
{
throwable
->
throwable
.
printStackTrace
()
})
}
if
(!
ConfideNetworkUtil
.
isWifi
(
context
)
&&
!
hasAgreePlayWithoutWiFi
)
{
return
}
...
...
m-confide/src/main/java/com/ydl/confide/intro/ItemIntroHolder.kt
View file @
94eeae82
...
...
@@ -36,7 +36,7 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
}
fun
onBind
(
item
:
VideoViewModel
)
{
binding
.
btn
Call
.
setOnClickListener
{
}
binding
.
layout
Call
.
setOnClickListener
{
}
binding
.
btnChat
.
setOnClickListener
{
val
aty
=
it
.
context
as
?
Activity
if
(
aty
!=
null
&&
!
item
.
uid
.
isNullOrEmpty
())
{
...
...
@@ -119,6 +119,7 @@ class VideoViewModel {
val
name
=
ObservableField
<
String
>(
""
)
val
avatar
=
ObservableField
<
String
>(
""
)
val
count
=
ObservableInt
()
val
lineStatus
=
ObservableInt
()
val
intro
=
ObservableField
<
String
>(
""
)
val
tag
=
ObservableField
<
String
>(
""
)
var
playUrl
:
String
?
=
null
//"https://video.ydlcdn.com/2020/04/01/ac2e4bb4e3ac8e2f0eca41e2d49c8484.mp4"
...
...
m-confide/src/main/res/drawable-xxhdpi/ic_confide_call.png
0 → 100644
View file @
94eeae82
2.33 KB
m-confide/src/main/res/drawable/confide_line_bg_1.xml
0 → 100644
View file @
94eeae82
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"26dp"
/>
<gradient
android:endColor=
"#48CC95"
android:startColor=
"#61CEAC"
/>
</shape>
\ No newline at end of file
m-confide/src/main/res/drawable/confide_line_bg_2.xml
0 → 100644
View file @
94eeae82
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"26dp"
/>
<gradient
android:endColor=
"#BBC1CD"
android:startColor=
"#D5D6D7"
/>
</shape>
\ No newline at end of file
m-confide/src/main/res/drawable/confide_line_bg_3.xml
0 → 100644
View file @
94eeae82
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"26dp"
/>
<gradient
android:endColor=
"#FF994B"
android:startColor=
"#F6B37F"
/>
</shape>
\ No newline at end of file
m-confide/src/main/res/layout/item_expert_intro.xml
View file @
94eeae82
...
...
@@ -5,6 +5,8 @@
<data>
<import
type=
"android.view.View"
/>
<variable
name=
"item"
type=
"com.ydl.confide.intro.VideoViewModel"
/>
...
...
@@ -42,7 +44,8 @@
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"@+id/tvName"
/>
app:layout_constraintTop_toTopOf=
"@+id/tvName"
tools:visibility=
"gone"
/>
<SeekBar
android:id=
"@+id/seekbar"
...
...
@@ -57,21 +60,49 @@
android:progressDrawable=
"@drawable/confide_seekbar_style"
android:splitTrack=
"false"
android:thumb=
"@drawable/confide_seekbar_thumb"
app:layout_constraintBottom_toTopOf=
"@+id/
btn
Call"
app:layout_constraintBottom_toTopOf=
"@+id/
layout
Call"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
/>
<
TextView
android:id=
"@+id/
btn
Call"
<
androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/
layout
Call"
android:layout_width=
"wrap_content"
android:layout_height=
"4
8
dp"
android:layout_height=
"4
2
dp"
android:layout_marginBottom=
"32dp"
android:background=
"@{item.lineStatus==3?@drawable/confide_line_bg_3:(item.lineStatus==2?@drawable/confide_line_bg_2:@drawable/confide_line_bg_1)}"
android:paddingLeft=
"28dp"
android:paddingRight=
"28dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
tools:background=
"@drawable/confide_line_bg_1"
>
<ImageView
android:id=
"@+id/ivCall"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_marginRight=
"4dp"
android:src=
"@drawable/ic_confide_call"
android:visibility=
"@{item.lineStatus==2?View.GONE:View.VISIBLE}"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toLeftOf=
"@+id/tvCall"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tvCall"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:text=
"通话中"
android:textColor=
"@color/white"
android:textSize=
"17sp"
app:confideLineText=
"@{item.lineStatus}"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
/>
app:layout_constraintLeft_toRightOf=
"@+id/ivCall"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
"通话中"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id=
"@+id/tvTag"
...
...
@@ -82,7 +113,7 @@
android:text=
"@{item.tag}"
android:textColor=
"#99FFFFFF"
android:textSize=
"13sp"
app:layout_constraintBottom_toTopOf=
"@+id/
btn
Call"
app:layout_constraintBottom_toTopOf=
"@+id/
layout
Call"
app:layout_constraintLeft_toLeftOf=
"parent"
tools:text=
"tag|tag|tag"
/>
...
...
@@ -132,7 +163,7 @@
android:text=
"分享"
android:textColor=
"@color/white"
android:textSize=
"11sp"
app:layout_constraintBottom_toTopOf=
"@+id/
btn
Call"
app:layout_constraintBottom_toTopOf=
"@+id/
layout
Call"
app:layout_constraintRight_toRightOf=
"parent"
/>
<TextView
...
...
ydl-utils/src/main/java/com/yidianling/common/binding/BindingAdapter1.kt
View file @
94eeae82
...
...
@@ -2,9 +2,6 @@ package com.yidianling.common.binding
import
android.graphics.Color
import
android.graphics.drawable.GradientDrawable
import
android.graphics.drawable.PaintDrawable
import
android.graphics.drawable.shapes.RectShape
import
android.graphics.drawable.shapes.RoundRectShape
import
android.view.View
import
android.widget.ImageView
import
androidx.databinding.BindingAdapter
...
...
@@ -39,22 +36,14 @@ fun View.setCustomStyle(
}
else
{
background
as
GradientDrawable
}
val
density
=
resources
.
displayMetrics
.
density
gradientDrawable
.
setColor
(
shapeBg
)
gradientDrawable
.
setStroke
(
shapeStrokeWidth
.
toInt
(),
(
shapeStrokeWidth
*
density
)
.
toInt
(),
shapeStrokeColor
)
val
radius
=
resources
.
displayMetrics
.
density
*
shapeRadius
gradientDrawable
.
cornerRadii
=
floatArrayOf
(
radius
,
radius
,
radius
,
radius
,
radius
,
radius
,
radius
,
radius
)
val
radius
=
density
*
shapeRadius
gradientDrawable
.
cornerRadius
=
radius
when
(
shape
)
{
GradientDrawable
.
RECTANGLE
->
gradientDrawable
.
shape
=
GradientDrawable
.
RECTANGLE
GradientDrawable
.
OVAL
->
gradientDrawable
.
shape
=
GradientDrawable
.
OVAL
...
...
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