Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 135 additions & 30 deletions res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,46 +1,151 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000" >
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000">

<RelativeLayout
android:id="@+id/rl_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#ffffff" >
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
android:background="#ffffff"
android:padding="15dp">

<com.jingchen.timerpicker.PickerView
android:id="@+id/minute_pv"
android:layout_width="80dp"
android:layout_height="160dp" />
<RelativeLayout
android:id="@+id/rl_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.jingchen.timerpicker.PickerView
android:id="@+id/minute_pv"
android:layout_width="80dp"
android:layout_height="160dp"/>

<TextView
android:id="@+id/minute_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/minute_pv"
android:text="@string/minute"
android:textColor="#ffaa33"
android:textSize="26sp"
android:textStyle="bold"/>

<com.jingchen.timerpicker.PickerView
android:id="@+id/second_pv"
android:layout_width="80dp"
android:layout_height="160dp"
android:layout_toRightOf="@id/minute_tv"/>

<TextView
android:id="@+id/second_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/second_pv"
android:text="@string/second"
android:textColor="#ffaa33"
android:textSize="26sp"
android:textStyle="bold"/>

</RelativeLayout>

<TextView
android:id="@+id/minute_tv"
<LinearLayout
android:id="@+id/ll_v_repeat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/minute_pv"
android:text="分"
android:textColor="#ffaa33"
android:textSize="26sp"
android:textStyle="bold" />
android:layout_below="@id/rl_time"
android:layout_centerHorizontal="true"
android:gravity="center">

<TextView
android:id="@+id/tv_v_repeat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/is_repeat"
android:textSize="21sp"/>

<RadioGroup
android:id="@+id/rg_v_repeat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:orientation="horizontal">

<RadioButton
android:id="@+id/rb_v_yes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/yes"/>

<RadioButton
android:id="@+id/rb_v_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/no"/>
</RadioGroup>
</LinearLayout>

</RelativeLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/rl_vertical"
android:layout_marginTop="40dp"
android:background="#ffffff"
android:orientation="vertical"
android:padding="15dp">

<com.jingchen.timerpicker.PickerView
android:id="@+id/second_pv"
android:layout_width="80dp"
android:layout_height="160dp"
android:layout_toRightOf="@id/minute_tv" />
android:id="@+id/pv_value"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="15dp"
/>

<TextView
android:id="@+id/second_tv"
<com.jingchen.timerpicker.PickerView
android:id="@+id/pv_unit"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_marginBottom="15dp"/>


<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/second_pv"
android:text="秒"
android:textColor="#ffaa33"
android:textSize="26sp"
android:textStyle="bold" />
</RelativeLayout>
android:layout_gravity="center"
android:gravity="center">

<TextView
android:id="@+id/tv_h_repeat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/is_repeat"
android:textSize="21sp"/>

<RadioGroup
android:id="@+id/rg_h_repeat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:orientation="horizontal">

<RadioButton
android:id="@+id/rb_h_yes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/yes"/>

<RadioButton
android:id="@+id/rb_h_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/no"/>
</RadioGroup>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
23 changes: 22 additions & 1 deletion res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">TimerPicker</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="horizontal_pickerview">横向的选择器</string>
<string name="vertical_pickerview">纵向的选择器</string>
<string name="is_repeat">循环:</string>
<string name="yes">是</string>
<string name="no">否</string>
<string name="minute">分</string>
<string name="second">秒</string>

<string name="gram">克</string>
<string name="bowl">碗</string>
<string name="scoop">勺</string>
<string name="granule">粒</string>

<string-array name="units">
<item>@string/gram</item>
<item>@string/bowl</item>
<item>@string/scoop</item>
<item>@string/granule</item>
<item>@string/minute</item>
<item>@string/second</item>
</string-array>

</resources>
Loading