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
f44c9f91
Commit
f44c9f91
authored
Jun 24, 2022
by
wjg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改推荐、特惠bug
parent
ef3fc397
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
31 deletions
+29
-31
app/src/main/java/com/ihaoin/hooloo/device/view/LauncherActivity.java
+29
-31
app/src/main/res/mipmap-xhdpi/hooloo_launcher.png
+0
-0
No files found.
app/src/main/java/com/ihaoin/hooloo/device/view/LauncherActivity.java
View file @
f44c9f91
...
@@ -142,13 +142,12 @@ public class LauncherActivity extends Activity {
...
@@ -142,13 +142,12 @@ public class LauncherActivity extends Activity {
private
void
setRecommendsData
()
{
private
void
setRecommendsData
()
{
List
<
Recommend
>
recommends
=
HLApplication
.
getMainData
().
getRecommends
();
List
<
Recommend
>
recommends
=
HLApplication
.
getMainData
().
getRecommends
();
scrollRecommends
=
new
ArrayList
<>();
scrollRecommends
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isEmpty
(
recommends
))
{
if
(!
CollectionUtils
.
isEmpty
(
recommends
))
{
return
;
for
(
int
i
=
0
;
i
<
recommends
.
size
();
i
++)
{
}
Recommend
x
=
recommends
.
get
(
i
);
for
(
int
i
=
0
;
i
<
recommends
.
size
();
i
++)
{
x
.
setIndex
(
i
);
Recommend
x
=
recommends
.
get
(
i
);
scrollRecommends
.
add
(
new
ScrollBean
(
new
ScrollBean
.
ScrollItemBean
(
x
,
null
)));
x
.
setIndex
(
i
);
}
scrollRecommends
.
add
(
new
ScrollBean
(
new
ScrollBean
.
ScrollItemBean
(
x
,
null
)));
}
}
recommendAdapter
.
setNewData
(
scrollRecommends
);
recommendAdapter
.
setNewData
(
scrollRecommends
);
}
}
...
@@ -270,31 +269,30 @@ public class LauncherActivity extends Activity {
...
@@ -270,31 +269,30 @@ public class LauncherActivity extends Activity {
private
void
initCategorys
()
{
private
void
initCategorys
()
{
groupCategory
.
removeAllViews
();
groupCategory
.
removeAllViews
();
List
<
Category
>
categorys
=
HLApplication
.
getMainData
().
getCategorys
();
List
<
Category
>
categorys
=
HLApplication
.
getMainData
().
getCategorys
();
if
(
CollectionUtils
.
isEmpty
(
categorys
))
{
if
(!
CollectionUtils
.
isEmpty
(
categorys
))
{
return
;
for
(
int
i
=
0
;
i
<
categorys
.
size
();
i
++)
{
}
Category
category
=
categorys
.
get
(
i
);
for
(
int
i
=
0
;
i
<
categorys
.
size
();
i
++)
{
if
(
CollectionUtils
.
isEmpty
(
category
.
getGoods
()))
{
Category
category
=
categorys
.
get
(
i
);
continue
;
if
(
CollectionUtils
.
isEmpty
(
category
.
getGoods
()))
{
}
continue
;
RadioGroup
.
LayoutParams
layoutParams
=
new
RadioGroup
.
LayoutParams
(
RadioGroup
.
LayoutParams
.
MATCH_PARENT
,
RadioGroup
.
LayoutParams
.
WRAP_CONTENT
);
}
RadioButton
view
=
(
RadioButton
)
this
.
getLayoutInflater
().
inflate
(
R
.
layout
.
item_category
,
null
);
RadioGroup
.
LayoutParams
layoutParams
=
new
RadioGroup
.
LayoutParams
(
RadioGroup
.
LayoutParams
.
MATCH_PARENT
,
RadioGroup
.
LayoutParams
.
WRAP_CONTENT
);
view
.
setText
(
category
.
getName
());
RadioButton
view
=
(
RadioButton
)
this
.
getLayoutInflater
().
inflate
(
R
.
layout
.
item_category
,
null
);
view
.
setId
(
category
.
getId
());
view
.
setText
(
category
.
getName
());
view
.
setTag
(
category
);
view
.
setId
(
category
.
getId
());
if
(
i
==
0
)
{
view
.
setTag
(
category
);
view
.
setChecked
(
true
);
if
(
i
==
0
)
{
view
.
getPaint
().
setFakeBoldText
(
true
);
view
.
setChecked
(
true
);
}
view
.
getPaint
().
setFakeBoldText
(
true
);
groupCategory
.
addView
(
view
,
layoutParams
);
view
.
setOnClickListener
(
v
->
{
Integer
checkedId
=
v
.
getId
();
Category
tagCategory
=
(
Category
)
groupCategory
.
findViewById
(
checkedId
).
getTag
();
int
position
=
categorys
.
indexOf
(
tagCategory
);
goodsLayoutManager
.
scrollToPositionWithOffset
(
tPosition
.
get
(
position
),
0
);
});
}
}
groupCategory
.
addView
(
view
,
layoutParams
);
view
.
setOnClickListener
(
v
->
{
Integer
checkedId
=
v
.
getId
();
Category
tagCategory
=
(
Category
)
groupCategory
.
findViewById
(
checkedId
).
getTag
();
int
position
=
categorys
.
indexOf
(
tagCategory
);
goodsLayoutManager
.
scrollToPositionWithOffset
(
tPosition
.
get
(
position
),
0
);
});
}
}
groupCategory
.
setOnCheckedChangeListener
((
group
,
checkedId
)
->
{
groupCategory
.
setOnCheckedChangeListener
((
group
,
checkedId
)
->
{
for
(
int
i
=
0
;
i
<
groupCategory
.
getChildCount
();
i
++)
{
for
(
int
i
=
0
;
i
<
groupCategory
.
getChildCount
();
i
++)
{
...
...
app/src/main/res/mipmap-xhdpi/hooloo_launcher.png
0 → 100644
View file @
f44c9f91
3 KB
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