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
02b964e1
Commit
02b964e1
authored
May 25, 2022
by
wjg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加控件点击水波纹
parent
82155f36
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
13 deletions
+19
-13
app/src/main/java/com/ihaoin/hooloo/device/view/LauncherActivity.java
+6
-12
app/src/main/res/layout/activity_launcher.xml
+11
-0
app/src/main/res/layout/item_tips.xml
+2
-1
No files found.
app/src/main/java/com/ihaoin/hooloo/device/view/LauncherActivity.java
View file @
02b964e1
...
...
@@ -17,7 +17,6 @@ import android.view.View;
import
android.view.WindowManager
;
import
android.widget.RadioButton
;
import
android.widget.RadioGroup
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
androidx.annotation.NonNull
;
...
...
@@ -53,7 +52,8 @@ public class LauncherActivity extends Activity {
private
RadioGroup
groupCategory
;
private
RecyclerView
recGoods
;
private
RecyclerView
recRecommends
;
// private TextView rightTitle;
// private TextView rightTitle;
private
View
layoutTips
;
private
List
<
ScrollBean
>
scrollRecommends
;
private
List
<
ScrollBean
>
scrollGoods
;
...
...
@@ -85,6 +85,8 @@ public class LauncherActivity extends Activity {
groupCategory
=
findViewById
(
R
.
id
.
group_category
);
recGoods
=
findViewById
(
R
.
id
.
rec_right
);
recRecommends
=
findViewById
(
R
.
id
.
rec_recommend
);
layoutTips
=
findViewById
(
R
.
id
.
layout_tips
);
layoutTips
.
setOnClickListener
(
v
->
Utils
.
showTips
(
LauncherActivity
.
this
));
initRecommends
();
setRecommendsData
();
...
...
@@ -225,7 +227,7 @@ public class LauncherActivity extends Activity {
for
(
int
i
=
0
;
i
<
categorys
.
size
();
i
++)
{
Category
category
=
categorys
.
get
(
i
);
if
(
CollectionUtils
.
isEmpty
(
category
.
getGoods
()))
{
return
;
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
);
...
...
@@ -259,12 +261,6 @@ public class LauncherActivity extends Activity {
}
}
});
// 添加温馨提示
RadioGroup
.
LayoutParams
layoutParams
=
new
RadioGroup
.
LayoutParams
(
RadioGroup
.
LayoutParams
.
MATCH_PARENT
,
RadioGroup
.
LayoutParams
.
WRAP_CONTENT
);
TextView
view
=
(
TextView
)
this
.
getLayoutInflater
().
inflate
(
R
.
layout
.
item_tips
,
null
);
groupCategory
.
addView
(
view
,
layoutParams
);
view
.
setOnClickListener
(
v
->
Utils
.
showTips
(
LauncherActivity
.
this
));
}
private
void
setGoodsData
()
{
...
...
@@ -279,9 +275,7 @@ public class LauncherActivity extends Activity {
return
;
}
scrollGoods
.
add
(
new
ScrollBean
(
true
,
category
.
getName
()));
category
.
getGoods
().
forEach
(
goods
->
{
scrollGoods
.
add
(
new
ScrollBean
(
new
ScrollBean
.
ScrollItemBean
(
goods
,
category
.
getName
())));
});
category
.
getGoods
().
forEach
(
goods
->
scrollGoods
.
add
(
new
ScrollBean
(
new
ScrollBean
.
ScrollItemBean
(
goods
,
category
.
getName
()))));
});
for
(
int
i
=
0
;
i
<
scrollGoods
.
size
();
i
++)
{
...
...
app/src/main/res/layout/activity_launcher.xml
View file @
02b964e1
...
...
@@ -30,6 +30,11 @@
android:layout_height=
"match_parent"
android:descendantFocusability=
"afterDescendants"
android:scrollbars=
"none"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
>
<RadioGroup
android:id=
"@+id/group_category"
android:layout_width=
"match_parent"
...
...
@@ -40,6 +45,12 @@
android:gravity=
"center"
android:orientation=
"vertical"
android:showDividers=
"middle"
/>
<include
android:id=
"@+id/layout_tips"
layout=
"@layout/item_tips"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
...
...
app/src/main/res/layout/item_tips.xml
View file @
02b964e1
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"
wrap_cont
ent"
android:layout_width=
"
match_par
ent"
android:layout_height=
"wrap_content"
android:button=
"@null"
android:drawableEnd=
"@drawable/ic_baseline_chevron_right_24"
android:foreground=
"?selectableItemBackground"
android:gravity=
"center"
android:lines=
"1"
android:padding=
"@dimen/padding10"
android:text=
"温馨提示"
android:textColor=
"@color/colorPrimary"
...
...
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