Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
machine
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
hooloo
android
machine
Commits
155d644c
Commit
155d644c
authored
Feb 27, 2023
by
wjg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add release apk
parent
50bee6e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
16 deletions
+22
-16
main_app/src/main/java/com/ihaoin/hooloo/device/data/vo/Goods.java
+5
-5
main_app/src/main/java/com/ihaoin/hooloo/device/home/adapter/GoodsAdapter.java
+17
-11
No files found.
main_app/src/main/java/com/ihaoin/hooloo/device/data/vo/Goods.java
View file @
155d644c
...
@@ -28,14 +28,14 @@ public class Goods implements Serializable {
...
@@ -28,14 +28,14 @@ public class Goods implements Serializable {
/** 是否是特惠商品 */
/** 是否是特惠商品 */
private
Integer
isRecommend
;
private
Integer
isRecommend
;
/** 特惠标签 */
/** 特惠标签 */
private
String
recommendTag
;
private
List
<
String
>
recommendTagList
;
public
String
getRecommendTag
()
{
public
List
<
String
>
getRecommendTagList
()
{
return
recommendTag
;
return
recommendTag
List
;
}
}
public
void
setRecommendTag
(
String
recommendTag
)
{
public
void
setRecommendTag
List
(
List
<
String
>
recommendTagList
)
{
this
.
recommendTag
=
recommendTag
;
this
.
recommendTag
List
=
recommendTagList
;
}
}
public
Integer
getIsRecommend
()
{
public
Integer
getIsRecommend
()
{
...
...
main_app/src/main/java/com/ihaoin/hooloo/device/home/adapter/GoodsAdapter.java
View file @
155d644c
...
@@ -52,25 +52,31 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
...
@@ -52,25 +52,31 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
LinearLayout
layoutTag
=
helper
.
getView
(
R
.
id
.
layout_tags
);
LinearLayout
layoutTag
=
helper
.
getView
(
R
.
id
.
layout_tags
);
layoutTag
.
removeAllViews
();
layoutTag
.
removeAllViews
();
if
(!
StringUtils
.
isEmpty
(
goods
.
getRecommendTag
()))
{
// 特惠标签
int
recommendTagSize
=
0
;
if
(!
CollectionUtils
.
isEmpty
(
goods
.
getRecommendTagList
()))
{
recommendTagSize
=
goods
.
getRecommendTagList
().
size
();
helper
.
setVisible
(
R
.
id
.
layout_tags
,
true
);
helper
.
setVisible
(
R
.
id
.
layout_tags
,
true
);
View
tagView
=
LayoutInflater
.
from
(
mContext
).
inflate
(
R
.
layout
.
item_tag_recommend
,
null
);
for
(
int
i
=
0
;
i
<
goods
.
getRecommendTagList
().
size
();
i
++)
{
((
TextView
)
tagView
.
findViewById
(
R
.
id
.
txt_tag
)).
setText
(
goods
.
getRecommendTag
());
View
tagView
=
LayoutInflater
.
from
(
mContext
).
inflate
(
R
.
layout
.
item_tag_recommend
,
null
);
layoutTag
.
addView
(
tagView
);
((
TextView
)
tagView
.
findViewById
(
R
.
id
.
txt_tag
)).
setText
(
goods
.
getRecommendTagList
().
get
(
i
));
layoutTag
.
addView
(
tagView
);
}
}
}
// 普通标签
if
(
CollectionUtils
.
isEmpty
(
goods
.
getTags
())
&&
StringUtils
.
isEmpty
(
goods
.
getRecommendTag
()))
{
if
(!
CollectionUtils
.
isEmpty
(
goods
.
getTags
()))
{
helper
.
setVisible
(
R
.
id
.
layout_tags
,
false
);
View
tagView
=
LayoutInflater
.
from
(
mContext
).
inflate
(
R
.
layout
.
item_tag
,
null
);
layoutTag
.
addView
(
tagView
);
}
else
{
helper
.
setVisible
(
R
.
id
.
layout_tags
,
true
);
helper
.
setVisible
(
R
.
id
.
layout_tags
,
true
);
for
(
int
i
=
0
;
i
<
goods
.
getTags
().
size
()
&&
i
<
2
;
i
++)
{
for
(
int
i
=
0
;
i
<
goods
.
getTags
().
size
()
&&
i
<
(
3
-
recommendTagSize
)
;
i
++)
{
View
tagView
=
LayoutInflater
.
from
(
mContext
).
inflate
(
R
.
layout
.
item_tag
,
null
);
View
tagView
=
LayoutInflater
.
from
(
mContext
).
inflate
(
R
.
layout
.
item_tag
,
null
);
((
TextView
)
tagView
.
findViewById
(
R
.
id
.
txt_tag
)).
setText
(
goods
.
getTags
().
get
(
i
));
((
TextView
)
tagView
.
findViewById
(
R
.
id
.
txt_tag
)).
setText
(
goods
.
getTags
().
get
(
i
));
layoutTag
.
addView
(
tagView
);
layoutTag
.
addView
(
tagView
);
}
}
}
}
if
(
CollectionUtils
.
isEmpty
(
goods
.
getTags
())
&&
CollectionUtils
.
isEmpty
(
goods
.
getRecommendTagList
()))
{
helper
.
setVisible
(
R
.
id
.
layout_tags
,
false
);
View
tagView
=
LayoutInflater
.
from
(
mContext
).
inflate
(
R
.
layout
.
item_tag
,
null
);
layoutTag
.
addView
(
tagView
);
}
ImageView
imgThumbnail
=
helper
.
getView
(
R
.
id
.
img_thumbnail
);
ImageView
imgThumbnail
=
helper
.
getView
(
R
.
id
.
img_thumbnail
);
// RoundedCorners roundedCorners = new RoundedCorners(5);
// RoundedCorners roundedCorners = new RoundedCorners(5);
...
...
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