1
0
mirror of https://github.com/mik3y/usb-serial-for-android.git synced 2026-08-11 16:32:53 +00:00

Update demo activity.

Demo now consists of two activities:
  - DeviceListActivity shows all usb devices (including unsupported ones)
    in a ListView.
  - SerialConsoleActivity dumps the data stream for a device selected in
    DeviceListActivity.
This commit is contained in:
mike wakerly
2013-05-22 13:04:05 -07:00
parent b07bbcf292
commit b709823906
7 changed files with 372 additions and 55 deletions
+41 -17
View File
@@ -1,26 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/demoTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="@string/app_title"
android:textSize="24sp"
android:textStyle="bold" />
<TextView
android:id="@+id/progressBarTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/demoTitle"
android:layout_centerHorizontal="true"
android:text="@string/refreshing"
android:padding="8dp"
android:textSize="18sp" />
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
<ScrollView
android:id="@+id/demoScroller"
android:layout_below="@+id/progressBarTitle"
android:layout_centerHorizontal="true"
android:padding="8dp"
style="@android:style/Widget.Holo.ProgressBar.Horizontal"
android:indeterminate="true" />
<View
android:id="@+id/separator"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
android:layout_height="1dip"
android:layout_below="@+id/progressBar"
android:layout_centerHorizontal="true"
android:background="#eeeeee" />
<TextView
android:id="@+id/demoText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:typeface="monospace" />
</ScrollView>
<ListView
android:id="@+id/deviceList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/separator" />
</LinearLayout>
</RelativeLayout>
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/demoTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="@string/app_title"
android:textSize="24sp"
android:textStyle="bold" />
<View
android:id="@+id/separator"
android:layout_width="match_parent"
android:layout_below="@+id/demoTitle"
android:layout_height="1dip"
android:background="#eeeeee" />
<ScrollView
android:id="@+id/demoScroller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/separator" >
<TextView
android:id="@+id/consoleText"
android:textIsSelectable="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:typeface="monospace" />
</ScrollView>
</RelativeLayout>
+4 -3
View File
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, DemoActivity!</string>
<string name="app_name">UsbSerialExamples</string>
<string name="app_title">USB Serial Example</string>
<string name="app_name">Serial Example</string>
<string name="refreshing">Refreshing...</string>
</resources>