Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BluToysApplication
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
chengchong
BluToysApplication
Commits
c1bee5b7
Commit
c1bee5b7
authored
Apr 07, 2021
by
chengchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加上了pm
parent
4eb775c2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
6 deletions
+23
-6
SetTimeActivity.java
...n/java/com/example/blu/toys/activity/SetTimeActivity.java
+17
-0
activity_set_time.xml
app/src/main/res/layout/activity_set_time.xml
+6
-6
No files found.
app/src/main/java/com/example/blu/toys/activity/SetTimeActivity.java
View file @
c1bee5b7
...
...
@@ -39,6 +39,8 @@ public class SetTimeActivity extends BaseActivity {
WheelView
wheelMinute
;
@BindView
(
R
.
id
.
wheel_second
)
//秒
WheelView
wheelSecond
;
@BindView
(
R
.
id
.
wheel_am_pm
)
WheelView
mAmPm
;
@BindView
(
R
.
id
.
wheel_hour_dw
)
WheelView
wheelHour_dw
;
...
...
@@ -65,6 +67,7 @@ public class SetTimeActivity extends BaseActivity {
private
ArrayList
<
String
>
hourList
=
new
ArrayList
<>();
private
ArrayList
<
String
>
sixList
=
new
ArrayList
<>();
private
ArrayList
<
String
>
selectTime
=
new
ArrayList
<>();
private
ArrayList
<
String
>
amPmList
=
new
ArrayList
<>();
String
selectHour
;
...
...
@@ -84,6 +87,8 @@ public class SetTimeActivity extends BaseActivity {
private
TimeBean
getBottomTime
()
{
TimeBean
timeBean
=
new
TimeBean
();
amPmList
.
add
(
"AM"
);
amPmList
.
add
(
"PM"
);
String
hour
=
wheelHour_dw
.
getSeletedItem
();
...
...
@@ -198,6 +203,14 @@ public class SetTimeActivity extends BaseActivity {
}
});
//amPm
mAmPm
.
setOnWheelViewListener
(
new
WheelView
.
OnWheelViewListener
()
{
@Override
public
void
onSelected
(
int
selectedIndex
,
String
item
)
{
//选择早上下午
}
});
wheelHour_dw
.
setOnWheelViewListener
(
new
WheelView
.
OnWheelViewListener
()
{
@Override
...
...
@@ -300,6 +313,10 @@ public class SetTimeActivity extends BaseActivity {
int
indexSecond
=
sixList
.
indexOf
(
selectSec
);
wheelSecond
.
setSeletion
(
indexSecond
);
//amPM
mAmPm
.
setOffset
(
3
);
mAmPm
.
setItems
(
amPmList
);
/////////下////////
///时////
...
...
app/src/main/res/layout/activity_set_time.xml
View file @
c1bee5b7
...
...
@@ -131,12 +131,12 @@
android:layout_gravity=
"center_vertical"
/>
<!-- <com.example.blu.toys.view.WheelView-->
<!-- android:id="@+id/wheel_am_pm"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_gravity="center_vertical"-->
<!-- android:layout_marginLeft="20dp" />--
>
<com.example.blu.toys.view.WheelView
android:id=
"@+id/wheel_am_pm"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginLeft=
"20dp"
/
>
</LinearLayout>
...
...
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