Permalink
Browse files

Read/Write mode supported

  • Loading branch information...
1 parent f7f145b commit 594cd85ebf53d86d60f007270065de21babb1f7d @cattaka committed Aug 29, 2012
@@ -15,8 +15,7 @@
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
- android:label="@string/title_activity_main"
- android:launchMode="singleTop" >
+ android:label="@string/title_activity_main">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -4,102 +4,171 @@
android:layout_height="match_parent"
android:orientation="vertical" >
- <GridLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/GridLayout1"
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="1"
- android:columnCount="2" >
-
- <!-- LED -->
-
- <TextView
- android:layout_gravity="left"
- android:layout_marginLeft="5dip"
- android:layout_marginRight="5dip"
- android:text="LED of eyes" />
-
- <CheckBox
- android:id="@+id/checkbox1"
- android:layout_gravity="left"
- android:checked="false" />
-
- <Space android:layout_columnSpan="2" />
- <!-- Arm -->
-
- <TextView
- android:layout_gravity="left"
- android:layout_marginLeft="5dip"
- android:layout_marginRight="5dip"
- android:text="Left Arm Power&#xA;(0-255)" />
-
- <EditText
- android:id="@+id/editText1"
- android:inputType="number"
- android:text="1" />
-
- <TextView
- android:layout_gravity="left"
- android:layout_marginLeft="5dip"
- android:layout_marginRight="5dip"
- android:text="Right Arm Power&#xA;(0-255)" />
-
- <EditText
- android:id="@+id/editText2"
- android:layout_gravity="left"
- android:inputType="number"
- android:text="2" />
-
- <!-- Rotate -->
-
- <TextView
- android:layout_gravity="left"
- android:layout_marginLeft="5dip"
- android:layout_marginRight="5dip"
- android:text="Left Mortor Power&#xA;(0:STOP,1:FORWARD,2:REVERSE)" />
-
- <EditText
- android:id="@+id/editText3"
- android:layout_gravity="left"
- android:inputType="number"
- android:text="3" />
-
- <TextView
- android:layout_gravity="right"
- android:layout_marginLeft="5dip"
- android:layout_marginRight="5dip"
- android:text="Right Mortor Power&#xA;(0:STOP,1:FORWARD,2:REVERSE)" />
-
- <EditText
- android:id="@+id/editText4"
- android:layout_gravity="left"
- android:inputType="number"
- android:text="4" />
-
- <!-- Time -->
-
- <TextView
- android:layout_gravity="left"
- android:layout_marginLeft="5dip"
- android:layout_marginRight="5dip"
- android:text="Time&#xA;(x100ms)" />
-
- <EditText
- android:id="@+id/editText5"
- android:layout_gravity="left"
- android:inputType="number"
- android:text="5" />
-
- <Space android:layout_columnSpan="2" />
- </GridLayout>
+ <RelativeLayout
+ android:layout_width="fill_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" >
+
+ <LinearLayout
+ android:id="@+id/TimeLayout"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ >
+ <TextView
+ android:id="@+id/TimeText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="000"
+ />
+ <SeekBar
+ android:id="@+id/TimeSeek"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:max="50"
+ />
+ </LinearLayout>
+
+ <ToggleButton
+ android:id="@+id/EyeLightToggle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/TimeLayout"
+ android:layout_centerHorizontal="true" />
+
+ <TableLayout
+ android:id="@+id/UpperLayout"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/EyeLightToggle" >
+
+ <TableRow
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" >
+
+ <SeekBar
+ android:id="@+id/ArmLeftSeek"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:max="255"
+ />
+
+ <SeekBar
+ android:id="@+id/ArmRightSeek"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:max="255"
+ />
+ </TableRow>
+
+ <TableRow
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" >
+
+ <TextView
+ android:id="@+id/ArmLeftValue"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:gravity="center_horizontal"
+ android:text="0" />
+
+ <TextView
+ android:id="@+id/ArmRightValue"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:gravity="center_horizontal"
+ android:text="0" />
+ </TableRow>
+ </TableLayout>
+
+ <LinearLayout
+ android:id="@+id/BottomLayout2"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true" >
+
+ <RadioGroup
+ android:id="@+id/motorDirLeft"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentLeft="true" >
+
+ <RadioButton
+ android:id="@+id/stopItem"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:checked="true"
+ android:text="Stop" />
+
+ <RadioButton
+ android:id="@+id/forwardItem"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Forward" />
+
+ <RadioButton
+ android:id="@+id/reverseItem"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Reverse" />
+ </RadioGroup>
+
+ <RadioGroup
+ android:id="@+id/motorDirRight"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentRight="true" >
+
+ <RadioButton
+ android:id="@+id/stopItem"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:checked="true"
+ android:text="Stop" />
+
+ <RadioButton
+ android:id="@+id/forwardItem"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Forward" />
+
+ <RadioButton
+ android:id="@+id/reverseItem"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Reverse" />
+ </RadioGroup>
+ </LinearLayout>
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_above="@+id/BottomLayout2"
+ android:layout_below="@+id/UpperLayout"
+ android:src="@drawable/android_logo" />
+ </RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<Button
+ android:id="@+id/button0"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Delete" />
+
+ <Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -37,10 +37,24 @@
android:layout_weight="1" >
</ListView>
- <Button
- android:id="@+id/button1"
- android:layout_width="match_parent"
+ <LinearLayout
+ android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:text="Add" />
-
+ android:orientation="horizontal"
+ >
+ <ToggleButton
+ android:id="@+id/ModeToggle"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:textOn="WRITE MODE"
+ android:textOff="READ MODE"
+ />
+ <Button
+ android:id="@+id/button1"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="Add" />
+ </LinearLayout>
</LinearLayout>
@@ -10,7 +10,7 @@
android:layout_gravity="left"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
- android:text="RED" />
+ android:text="LED" />
<TextView
android:id="@+id/textView1"
@@ -23,7 +23,7 @@
android:layout_gravity="left"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
- android:text="Left Arm Power" />
+ android:text="Left Arm Angle" />
<TextView
android:id="@+id/textView2"
@@ -35,7 +35,7 @@
android:layout_gravity="left"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
- android:text="Right Arm Power" />
+ android:text="Right Arm Angle" />
<TextView
android:id="@+id/textView3"
@@ -47,7 +47,7 @@
android:layout_gravity="left"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
- android:text="Left Mortor Power" />
+ android:text="Left Mortor" />
<TextView
android:id="@+id/textView4"
@@ -59,7 +59,7 @@
android:layout_gravity="right"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
- android:text="Right Mortor Power" />
+ android:text="Right Mortor" />
<TextView
android:id="@+id/textView5"
@@ -71,13 +71,13 @@
android:layout_gravity="left"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
- android:text="Time" />
+ android:text="Time(x100ms)" />
<TextView
android:id="@+id/textView6"
android:layout_gravity="left"
android:layout_columnSpan="2"
android:text="5" />
<Space android:layout_columnSpan="2" />
-
+
</GridLayout>
@@ -4,5 +4,10 @@
<string name="hello_world">Hello world!</string>
<string name="menu_settings">Settings</string>
<string name="title_activity_main">MainActivity</string>
+ <string-array name="motor_dir">
+ <item >STOP</item>
+ <item >FORWARD</item>
+ <item >REVERSE</item>
+ </string-array>
</resources>
Oops, something went wrong.

0 comments on commit 594cd85

Please sign in to comment.