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
080ea869
Commit
080ea869
authored
May 13, 2022
by
万齐军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature: 倾诉2.0首页改版,事件
parent
0b3f990c
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
43 additions
and
37 deletions
+43
-37
build.gradle
app/build.gradle
+1
-1
build.gradle
build.gradle
+0
-2
build.gradle
m-confide/build.gradle
+1
-1
ConfideHomeAdapter.kt
m-confide/src/main/java/com/ydl/confide/home/adapter/ConfideHomeAdapter.kt
+2
-2
VideoShowAdapter.kt
m-confide/src/main/java/com/ydl/confide/home/adapter/VideoShowAdapter.kt
+11
-4
ConfideHomeDataBean.kt
m-confide/src/main/java/com/ydl/confide/home/bean/ConfideHomeDataBean.kt
+2
-6
IConfideHomeConfig.kt
m-confide/src/main/java/com/ydl/confide/home/config/IConfideHomeConfig.kt
+1
-2
ConfideHomeEventImpl.kt
m-confide/src/main/java/com/ydl/confide/home/event/ConfideHomeEventImpl.kt
+6
-5
IConfideHomeEvent.kt
m-confide/src/main/java/com/ydl/confide/home/event/IConfideHomeEvent.kt
+2
-0
ConfideHomeUtils.kt
m-confide/src/main/java/com/ydl/confide/home/util/ConfideHomeUtils.kt
+2
-12
ConfideHomeRecommendExpertItemView.kt
m-confide/src/main/java/com/ydl/confide/home/widget/ConfideHomeRecommendExpertItemView.kt
+1
-1
ExpertIntroActivity.kt
m-confide/src/main/java/com/ydl/confide/intro/ExpertIntroActivity.kt
+8
-1
Route.kt
m-confide/src/main/modular_api/com/ydl/confide/api/Route.kt
+6
-0
No files found.
app/build.gradle
View file @
080ea869
...
...
@@ -170,7 +170,7 @@ android {
packagingOptions
{
exclude
'META-INF/proguard/coroutines.pro'
}
dataBinding
{
dataBinding
{
enabled
true
}
...
...
build.gradle
View file @
080ea869
...
...
@@ -31,8 +31,6 @@ buildscript {
dependencies
{
classpath
'com.android.tools.build:gradle:3.2.0'
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
//bugly 符号表
classpath
'com.tencent.bugly:symtabfileuploader:2.2.1'
classpath
'com.ydl.plugins:modular:1.0.3'
classpath
'com.ydl:notracepoint-gradle-plugin:0.0.3'
classpath
'com.ydl.plugins:restools:1.0.1'
...
...
m-confide/build.gradle
View file @
080ea869
...
...
@@ -50,7 +50,7 @@ android {
buildConfigField
"String"
,
"AGORA_APPID"
,
'"3387e9b251f3491e9221a9877e8f7830"'
}
}
dataBinding
{
dataBinding
{
enabled
true
}
...
...
m-confide/src/main/java/com/ydl/confide/home/adapter/ConfideHomeAdapter.kt
View file @
080ea869
...
...
@@ -144,7 +144,7 @@ class ConfideHomeAdapter(private val mContext: Context,
LinearLayoutManager
(
holder
.
itemView
.
context
,
RecyclerView
.
HORIZONTAL
,
false
)
val
recentBody
=
mListData
!!
[
position
].
body
val
data
=
recentBody
?.
map
{
ItemVideoShowViewModel
().
mapOf
(
it
)
}
?:
emptyList
()
holder
.
rv
.
adapter
=
RecentConfideAdapter
(
data
)
holder
.
rv
.
adapter
=
RecentConfideAdapter
(
data
,
confideHomeEvent
)
// holder.consultView!!.initData(mListData!![position])
}
else
if
(
holder
is
RecommendViewHolder
&&
null
!=
mListData
!!
[
position
]
&&
null
!=
mListData
!!
[
position
].
body
&&
!
mListData
!!
[
position
].
body
!!
.
isEmpty
())
{
//为你推荐
...
...
@@ -154,7 +154,7 @@ class ConfideHomeAdapter(private val mContext: Context,
LinearLayoutManager
(
holder
.
itemView
.
context
,
RecyclerView
.
HORIZONTAL
,
false
)
val
recentBody
=
mListData
!!
[
position
].
body
val
data
=
recentBody
?.
map
{
ItemVideoShowViewModel
().
mapOf
(
it
)
}
?:
emptyList
()
holder
.
rv
.
adapter
=
VideoShowAdapter
(
data
)
holder
.
rv
.
adapter
=
VideoShowAdapter
(
data
,
confideHomeEvent
)
}
else
if
(
holder
is
EmptyViewHolder
)
{
}
else
{
...
...
m-confide/src/main/java/com/ydl/confide/home/adapter/VideoShowAdapter.kt
View file @
080ea869
...
...
@@ -10,9 +10,10 @@ import com.ydl.confide.databinding.ItemConfideHomeRecentBinding
import
com.ydl.confide.databinding.ItemVideoShowBinding
import
com.ydl.confide.home.bean.ConfideHomeBodyBean
import
com.ydl.confide.home.bean.ConfideHomeDataBean
import
com.ydl.confide.home.event.IConfideHomeEvent
import
com.ydl.confide.intro.BindingViewHolder
class
VideoShowAdapter
(
val
data
:
List
<
ItemVideoShowViewModel
>
)
:
class
VideoShowAdapter
(
private
val
data
:
List
<
ItemVideoShowViewModel
>,
private
val
event
:
IConfideHomeEvent
)
:
RecyclerView
.
Adapter
<
BindingViewHolder
<
ItemVideoShowBinding
>>()
{
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
...
...
@@ -25,14 +26,16 @@ class VideoShowAdapter(val data: List<ItemVideoShowViewModel>) :
}
override
fun
onBindViewHolder
(
holder
:
BindingViewHolder
<
ItemVideoShowBinding
>,
position
:
Int
)
{
holder
.
binding
.
item
=
data
[
position
]
val
itemVideoShowViewModel
=
data
[
position
]
holder
.
binding
.
item
=
itemVideoShowViewModel
holder
.
itemView
.
setOnClickListener
{
event
.
videoShowClick
(
position
)
}
}
override
fun
getItemCount
()
=
data
.
size
}
class
RecentConfideAdapter
(
val
data
:
List
<
ItemVideoShowViewModel
>)
:
class
RecentConfideAdapter
(
val
data
:
List
<
ItemVideoShowViewModel
>
,
private
val
event
:
IConfideHomeEvent
)
:
RecyclerView
.
Adapter
<
BindingViewHolder
<
ItemConfideHomeRecentBinding
>>()
{
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
...
...
@@ -50,13 +53,16 @@ class RecentConfideAdapter(val data: List<ItemVideoShowViewModel>) :
}
override
fun
onBindViewHolder
(
holder
:
BindingViewHolder
<
ItemConfideHomeRecentBinding
>,
position
:
Int
)
{
holder
.
binding
.
item
=
data
[
position
]
val
itemVideoShowViewModel
=
data
[
position
]
holder
.
binding
.
item
=
itemVideoShowViewModel
holder
.
itemView
.
setOnClickListener
{
event
.
consultantClick
(
itemVideoShowViewModel
.
linkUrl
)
}
}
override
fun
getItemCount
()
=
data
.
size
}
class
ItemVideoShowViewModel
{
var
linkUrl
:
String
?
=
null
val
name
=
ObservableField
<
String
>(
""
)
val
coverUrl
=
ObservableField
<
String
>(
""
)
val
videoCoverUrl
=
ObservableField
<
String
>(
""
)
...
...
@@ -68,6 +74,7 @@ internal fun ItemVideoShowViewModel.mapOf(bean: ConfideHomeBodyBean): ItemVideoS
coverUrl
.
set
(
bean
.
confidedIcon
/*coverPicture*/
)
videoCoverUrl
.
set
(
bean
.
confidedIcon
/*coverVideoPicture*/
)
state
.
set
(
bean
.
confideLine
.
toString
())
linkUrl
=
bean
.
linkUrl
return
this
}
...
...
m-confide/src/main/java/com/ydl/confide/home/bean/ConfideHomeDataBean.kt
View file @
080ea869
...
...
@@ -30,8 +30,4 @@ data class ConfideHomeDataBean(
/**
* 为你推荐Id 本地使用 用于区分音频播放区域
*/
var
recommendId
:
Int
,
/**
* 是否显示分割线 0.不显示 1.显示
*/
val
diviLine
:
Int
?)
\ No newline at end of file
var
recommendId
:
Int
)
\ No newline at end of file
m-confide/src/main/java/com/ydl/confide/home/config/IConfideHomeConfig.kt
View file @
080ea869
...
...
@@ -19,9 +19,8 @@ interface IConfideHomeConfig{
const
val
TYPE_RECOMMEND_FILTER
=
4
const
val
TYPE_RECOMMEND
=
5
const
val
TYPE_SOUND
=
6
const
val
TYPE_
CONSULTANT
=
7
const
val
TYPE_
VIDEO_SHOW
=
7
const
val
TYPE_FOOTER
=
999
const
val
TYPE_VIDEO_SHOW
=
8
/**
* section id. 与上面相对应
*/
...
...
m-confide/src/main/java/com/ydl/confide/home/event/ConfideHomeEventImpl.kt
View file @
080ea869
...
...
@@ -5,15 +5,15 @@ import android.app.Activity
import
android.content.Context
import
android.content.Intent
import
android.net.Uri
import
android.os.Build
import
android.text.TextUtils
import
android.view.MotionEvent
import
android.view.View
import
androidx.appcompat.app.AppCompatActivity
import
com.google.android.material.bottomsheet.BottomSheetBehavior
import
com.google.android.material.bottomsheet.BottomSheetDialog
import
com.tencent.smtt.sdk.WebSettings
import
com.ydl.confide.R
import
com.alibaba.android.arouter.launcher.ARouter
import
com.ydl.confide.api.ConfideRoute
import
com.ydl.confide.home.ConfideHomeActivity
import
com.ydl.confide.home.adapter.ConfideHomeAdapter
import
com.ydl.confide.home.bean.ConfideHomeAllFiltersBean
...
...
@@ -185,6 +185,10 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
// link(linkUrl)
}
override
fun
videoShowClick
(
index
:
Int
)
{
ARouter
.
getInstance
().
build
(
ConfideRoute
.
R_VIDEO_SHOW
).
withInt
(
"initPos"
,
index
).
navigation
()
}
/**
* 最佳倾诉榜单--更多情感恋爱专家
* @param linkUrl 跳转地址
...
...
@@ -271,9 +275,6 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
//听声寻人
IConfideHomeConfig
.
TYPE_SOUND
->
{
}
//咨询师推荐
IConfideHomeConfig
.
TYPE_CONSULTANT
->
{
}
}
}
...
...
m-confide/src/main/java/com/ydl/confide/home/event/IConfideHomeEvent.kt
View file @
080ea869
...
...
@@ -75,6 +75,8 @@ interface IConfideHomeEvent {
*/
fun
consultantClick
(
linkUrl
:
String
?)
fun
videoShowClick
(
index
:
Int
)
/**
* 咨询师推荐--更多情感恋爱专家
* @param linkUrl 跳转地址
...
...
m-confide/src/main/java/com/ydl/confide/home/util/ConfideHomeUtils.kt
View file @
080ea869
...
...
@@ -101,7 +101,7 @@ class ConfideHomeUtils {
}
//移除听声寻人数据 放在最后
if
(
dataBean
.
type
==
IConfideHomeConfig
.
TYPE_SOUND
)
{
soundDataBean
=
ConfideHomeDataBean
(
dataBean
.
type
,
dataBean
.
body
,
dataBean
.
head
,
dataBean
.
footer
,
dataBean
.
recommendId
,
dataBean
.
diviLine
)
soundDataBean
=
ConfideHomeDataBean
(
dataBean
.
type
,
dataBean
.
body
,
dataBean
.
head
,
dataBean
.
footer
,
dataBean
.
recommendId
)
list
.
removeAt
(
index
)
}
}
...
...
@@ -124,7 +124,7 @@ class ConfideHomeUtils {
for
(
bodyBean
in
dataBean
.
body
)
{
val
bodyList
:
MutableList
<
ConfideHomeBodyBean
>
=
ArrayList
()
bodyList
.
add
(
bodyBean
)
val
recommendDataBean
=
ConfideHomeDataBean
(
dataBean
.
type
,
bodyList
,
dataBean
.
head
,
dataBean
.
footer
,
dataBean
.
recommendId
,
dataBean
.
diviLine
)
val
recommendDataBean
=
ConfideHomeDataBean
(
dataBean
.
type
,
bodyList
,
dataBean
.
head
,
dataBean
.
footer
,
dataBean
.
recommendId
)
list
.
add
(
recommendDataBean
)
}
return
list
...
...
@@ -174,12 +174,6 @@ class ConfideHomeUtils {
section
.
setData
(
resultBean
)
mConfideAdapter
?.
addSection
(
section
)
}
//最佳倾诉榜单 todo 产品说先隐藏掉
IConfideHomeConfig
.
TYPE_CONSULTANT
->
{
// var section = ConfideHomeRecommendExpertSection(context,mConfideEvent)
// section.setData(resultBean)
// mConfideAdapter?.addSection(section)
}
//为你推荐筛选模块
IConfideHomeConfig
.
TYPE_RECOMMEND_FILTER
->
{
var
section
=
ConfideHomeFilterSection
(
context
,
view
)
...
...
@@ -254,10 +248,6 @@ class ConfideHomeUtils {
IConfideHomeConfig
.
TYPE_SOUND
->
{
listenAndFoundData
=
resultBean
}
//最佳倾听榜单
IConfideHomeConfig
.
TYPE_CONSULTANT
->
{
recommendExpertData
=
resultBean
}
}
}
...
...
m-confide/src/main/java/com/ydl/confide/home/widget/ConfideHomeRecommendExpertItemView.kt
View file @
080ea869
...
...
@@ -153,7 +153,7 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH
if
(
confideIsPlay
)
{
confideHomeEvent
.
pauseVoice
()
}
else
{
confideHomeEvent
.
playVoice
(
IConfideHomeConfig
.
TYPE_
CONSULTANT
,
position
,
bodyBean
.
confideVoice
)
confideHomeEvent
.
playVoice
(
IConfideHomeConfig
.
TYPE_
VIDEO_SHOW
,
position
,
bodyBean
.
confideVoice
)
}
}
}
...
...
m-confide/src/main/java/com/ydl/confide/intro/ExpertIntroActivity.kt
View file @
080ea869
...
...
@@ -7,13 +7,20 @@ import android.view.View
import
androidx.appcompat.app.AppCompatActivity
import
androidx.databinding.DataBindingUtil
import
androidx.viewpager2.widget.ViewPager2
import
com.alibaba.android.arouter.facade.annotation.Autowired
import
com.alibaba.android.arouter.facade.annotation.Route
import
com.ydl.confide.R
import
com.ydl.confide.api.ConfideRoute
import
com.ydl.confide.databinding.ActivityExpertIntroBinding
@Route
(
path
=
"/confide/expert_video"
)
@Route
(
path
=
ConfideRoute
.
R_VIDEO_SHOW
)
class
ExpertIntroActivity
:
AppCompatActivity
()
{
@Autowired
@JvmField
var
initPos
:
Int
=
0
private
lateinit
var
binding
:
ActivityExpertIntroBinding
private
lateinit
var
adapter
:
IntroAdapter
...
...
m-confide/src/main/modular_api/com/ydl/confide/api/Route.kt
0 → 100644
View file @
080ea869
package
com.ydl.confide.api
object
ConfideRoute
{
const
val
R_VIDEO_SHOW
=
"/confide/expert_video"
}
\ No newline at end of file
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