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
b4e9ad37
Commit
b4e9ad37
authored
Apr 14, 2022
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:首页数据修改
parent
a8d106fc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
9 deletions
+33
-9
config.gradle
config.gradle
+2
-2
YdlHomeAdapter.kt
m-home/src/ydl/java/com/yidianling/home/adapter/YdlHomeAdapter.kt
+25
-6
YdlHomeFragment.kt
m-home/src/ydl/java/com/yidianling/home/ui/fragment/YdlHomeFragment.kt
+4
-1
HomeButtonBannerView.kt
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeButtonBannerView.kt
+2
-0
No files found.
config.gradle
View file @
b4e9ad37
...
...
@@ -9,7 +9,7 @@ ext {
"m-consultant"
:
"0.0.60.11"
,
"m-fm"
:
"0.0.30.04"
,
"m-user"
:
"0.0.62.01"
,
"m-home"
:
"0.0.2
2.95
"
,
"m-home"
:
"0.0.2
3.10
"
,
"m-im"
:
"0.0.21.18"
,
"m-dynamic"
:
"0.0.7.35"
,
"m-article"
:
"0.0.0.10"
,
...
...
@@ -93,7 +93,7 @@ ext {
"m-consultant"
:
"0.0.60.11"
,
"m-fm"
:
"0.0.30.07"
,
"m-user"
:
"0.0.62.01"
,
"m-home"
:
"0.0.22.9
5
"
,
"m-home"
:
"0.0.22.9
8
"
,
"m-im"
:
"0.0.21.18"
,
"m-dynamic"
:
"0.0.7.35"
,
"m-article"
:
"0.0.0.8"
,
...
...
m-home/src/ydl/java/com/yidianling/home/adapter/YdlHomeAdapter.kt
View file @
b4e9ad37
...
...
@@ -13,6 +13,7 @@ import com.yidianling.home.constract.HomeViewConfig
import
com.yidianling.home.event.HomeImpl
import
com.yidianling.home.model.bean.*
import
com.yidianling.home.ui.view.*
import
kotlin.properties.Delegates
/**
...
...
@@ -61,20 +62,19 @@ class YdlHomeAdapter(private val mContext: Context,
/*
倾诉免费标识
* */
var
listenFree
:
Boolean
?=
false
var
listenFree
:
Boolean
?=
false
fun
updateItems
(
list
:
MutableList
<
HomePagerDataBean
>)
{
if
(
null
==
this
.
list
||
this
.
list
!!
.
isEmpty
())
{
this
.
list
=
ArrayList
()
}
else
{
this
.
list
.
clear
()
}
this
.
list
.
addAll
(
list
)
this
.
listenFree
=
list
[
0
]
?.
headerBean
?.
listenFree
this
.
listenFree
=
list
[
0
]
?.
headerBean
?.
listenFree
!!
//重置标记位
confidePosition
=
-
1
consultPosition
=
-
1
updateConfideFreeData
(
null
)
notifyDataSetChanged
()
LogUtil
.
e
(
"aaaaaaaaupdateItems"
+
listenFree
)
}
...
...
@@ -88,6 +88,21 @@ class YdlHomeAdapter(private val mContext: Context,
list
[
confidePosition
].
confideBean
=
data
this
.
confideSelectPosition
=
selectPosition
notifyItemChanged
(
confidePosition
)
LogUtil
.
e
(
"aaaaaaaaupdateConfideData"
+
listenFree
)
}
/**
* 更新倾诉免费标识
*/
fun
updateConfideFreeData
(
data
:
HomeHeaderBean
?)
{
if
(
data
!=
null
){
list
[
1
].
headerBean
=
data
}
notifyItemChanged
(
1
)
LogUtil
.
e
(
"aaaaaaaaupdateupdateConfideFreeData"
+
listenFree
)
}
/**
...
...
@@ -100,6 +115,7 @@ class YdlHomeAdapter(private val mContext: Context,
list
[
consultPosition
].
consultBean
=
data
this
.
consultSelectPosition
=
selectPosition
notifyItemChanged
(
consultPosition
)
LogUtil
.
e
(
"aaaaaaaaupdateConsultData"
+
listenFree
)
notifyItemChanged
(
1
)
}
...
...
@@ -110,6 +126,8 @@ class YdlHomeAdapter(private val mContext: Context,
fun
updateAskData
(
data
:
HomeAskBean
,
position
:
Int
)
{
list
[
position
].
askBean
=
data
// notifyItemChanged(position)
LogUtil
.
e
(
"aaaaaaaupdateAskData"
+
listenFree
)
}
override
fun
getItemViewType
(
position
:
Int
):
Int
{
...
...
@@ -122,6 +140,7 @@ class YdlHomeAdapter(private val mContext: Context,
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
RecyclerView
.
ViewHolder
{
LogUtil
.
e
(
"aaaaaaaaaa"
+
viewType
+
listenFree
)
when
(
viewType
)
{
//顶部ViewPager与分类模块
HomeViewConfig
.
getOrder
().
bannerIndex
->
{
...
...
m-home/src/ydl/java/com/yidianling/home/ui/fragment/YdlHomeFragment.kt
View file @
b4e9ad37
...
...
@@ -307,6 +307,8 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
}
override
fun
homeHeadResponse
(
homeHeaderBean
:
HomeHeaderBean
)
{
//更新倾述列表数据
adapter
?.
updateConfideFreeData
(
homeHeaderBean
)
//展示活动数据
val
act
=
homeHeaderBean
.
activityResponse
...
...
@@ -363,7 +365,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
home_swipe_refresh_layout
.
isRefreshing
=
false
//更新首页数据
adapter
?.
updateItems
(
list
)
adapter
?.
notifyDataSetChanged
()
if
(!
TextUtils
.
isEmpty
(
list
[
0
].
headerBean
?.
doctorName
))
{
doctorName
=
list
[
0
].
headerBean
?.
doctorName
!!
initSearchBar
()
...
...
@@ -527,6 +529,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
isFromCreate
=
false
mPresenter
?.
loadHomeData
()
}
else
{
mPresenter
?.
loadHomeData
()
mPresenter
?.
getConsultData
(
consultLastSelectType
,
consultLastSelectPosition
)
mPresenter
?.
getConfideData
(
confideLastSelectType
,
confideLastSelectPosition
)
}
...
...
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeButtonBannerView.kt
View file @
b4e9ad37
...
...
@@ -8,6 +8,7 @@ import android.widget.LinearLayout
import
androidx.recyclerview.widget.RecyclerView
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.engine.DiskCacheStrategy
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.home.R
import
com.yidianling.home.event.IHomeBaseEvent
import
com.yidianling.common.tools.RxDeviceTool
...
...
@@ -31,6 +32,7 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
}
private
fun
initView
()
{
LogUtil
.
e
(
"aaaaa"
+
listenFree
)
val
params
=
RecyclerView
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
layoutParams
=
params
View
.
inflate
(
mContext
,
R
.
layout
.
home_button_banner_view
,
this
)
...
...
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