Commit c1bee5b7 by chengchong

加上了pm

parent 4eb775c2
......@@ -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);
/////////下////////
///时////
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment