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
e34dcd42
Commit
e34dcd42
authored
Aug 31, 2022
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:显示四个半item
parent
22deae9b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
ConsultantTopAdapter.kt
m-consultant/src/main/java/com/yidianling/consultant/adapter/ConsultantTopAdapter.kt
+7
-3
No files found.
m-consultant/src/main/java/com/yidianling/consultant/adapter/ConsultantTopAdapter.kt
View file @
e34dcd42
package
com.yidianling.consultant.adapter
package
com.yidianling.consultant.adapter
import
android.content.Context
import
android.content.Context
import
androidx.recyclerview.widget.RecyclerView
import
android.view.LayoutInflater
import
android.view.LayoutInflater
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
androidx.recyclerview.widget.RecyclerView
import
com.ydl.webview.H5Params
import
com.ydl.webview.H5Params
import
com.ydl.webview.NewH5Activity
import
com.ydl.webview.NewH5Activity
import
com.ydl.ydl_image.module.GlideApp
import
com.ydl.ydl_image.module.GlideApp
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.consultant.R
import
com.yidianling.consultant.R
import
com.yidianling.consultant.model.bean.ConsultantTopBannerBean
import
com.yidianling.consultant.model.bean.ConsultantTopBannerBean
import
kotlinx.android.synthetic.main.consultant_top_banner_item.view.*
import
kotlinx.android.synthetic.main.consultant_top_banner_item.view.*
...
@@ -18,7 +17,7 @@ import kotlinx.android.synthetic.main.consultant_top_banner_item.view.*
...
@@ -18,7 +17,7 @@ import kotlinx.android.synthetic.main.consultant_top_banner_item.view.*
*/
*/
class
ConsultantTopAdapter
(
class
ConsultantTopAdapter
(
private
val
context
:
Context
,
private
val
context
:
Context
,
private
val
consultList
:
MutableList
<
ConsultantTopBannerBean
>
,
private
val
consultList
:
MutableList
<
ConsultantTopBannerBean
>
)
:
RecyclerView
.
Adapter
<
ConsultantTopAdapter
.
ViewHolder
>()
{
)
:
RecyclerView
.
Adapter
<
ConsultantTopAdapter
.
ViewHolder
>()
{
override
fun
getItemCount
():
Int
=
consultList
.
size
override
fun
getItemCount
():
Int
=
consultList
.
size
...
@@ -30,6 +29,11 @@ class ConsultantTopAdapter(
...
@@ -30,6 +29,11 @@ class ConsultantTopAdapter(
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
{
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
{
val
layoutParams
=
ViewGroup
.
LayoutParams
(
(
context
.
getResources
().
getDisplayMetrics
().
widthPixels
/
4.5
).
toInt
(),
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
holder
.
itemView
.
layoutParams
=
layoutParams
if
(
consultList
[
position
].
specialTopicSubhead
?.
isNotEmpty
()
==
true
)
{
if
(
consultList
[
position
].
specialTopicSubhead
?.
isNotEmpty
()
==
true
)
{
holder
.
consult_tag
.
visibility
=
View
.
VISIBLE
holder
.
consult_tag
.
visibility
=
View
.
VISIBLE
holder
.
consult_tag
.
text
=
consultList
[
position
].
specialTopicSubhead
holder
.
consult_tag
.
text
=
consultList
[
position
].
specialTopicSubhead
...
...
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