diff options
| author | bringert <bringert@google.com> | 2013-10-04 16:26:46 +0000 |
|---|---|---|
| committer | bringert <bringert@google.com> | 2013-10-04 16:26:46 +0000 |
| commit | a35b286ce040919a71d27e5bf696886237c6c470 (patch) | |
| tree | 4e54cc1994a7f0760f76b0efe8c9e85ef38ec9ef /src/ui/android/res/layout/activity_main.xml | |
| parent | f156a5e8f9c903f132541e1c34f1c9f5c1ee69af (diff) | |
Add new Android voice translator sample app
This adds a simple voice translator Android app that uses
the JNI bindings to the PGF C runtime.
Caveats:
- Since the C runtime doesn't compile for Android right now,
I've bundled an old copy, along with its Java bindings.
That should be removed once the C runtime compiels for Android
again.
- Adding an automated build would be nice.
- Replacing the grammar requires editing a Java file, that should
really be more dynamic.
Diffstat (limited to 'src/ui/android/res/layout/activity_main.xml')
| -rw-r--r-- | src/ui/android/res/layout/activity_main.xml | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/src/ui/android/res/layout/activity_main.xml b/src/ui/android/res/layout/activity_main.xml new file mode 100644 index 000000000..b0ccab0ea --- /dev/null +++ b/src/ui/android/res/layout/activity_main.xml @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_height="match_parent" + android:layout_width="match_parent" + > + + <RelativeLayout + android:id="@+id/top_bg" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:layout_alignParentTop="true" + android:layout_alignParentLeft="true" + android:layout_alignParentRight="true" + android:padding="8dp" + android:background="#C0C0C0" + > + + <ImageView + android:id="@+id/start_stop" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:layout_alignTop="@+id/source_language" + android:layout_alignBottom="@+id/target_language" + android:layout_alignParentRight="true" + android:padding="8dp" + android:src="@drawable/ic_mic" + android:background="?android:attr/selectableItemBackground" + android:contentDescription="@string/microphone" + /> + + <ImageView + android:id="@+id/switch_languages" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:layout_alignTop="@+id/source_language" + android:layout_alignBottom="@+id/target_language" + android:layout_toLeftOf="@id/start_stop" + android:padding="8dp" + android:src="@drawable/ic_action_switch" + android:background="?android:attr/selectableItemBackground" + android:contentDescription="@string/switch_languages" + /> + + <org.grammaticalframework.ui.android.LanguageSelector + android:id="@+id/source_language" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:layout_alignParentLeft="true" + android:layout_alignParentTop="true" + android:layout_toLeftOf="@id/switch_languages" + android:padding="0dp" + /> + + <org.grammaticalframework.ui.android.LanguageSelector + android:id="@+id/target_language" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:layout_below="@id/source_language" + android:layout_toLeftOf="@id/switch_languages" + android:padding="0dp" + /> + + </RelativeLayout> + + <org.grammaticalframework.ui.android.ConversationView + android:id="@+id/conversation" + android:layout_height="match_parent" + android:layout_width="match_parent" + android:layout_alignParentLeft="true" + android:layout_alignParentBottom="true" + android:layout_alignParentRight="true" + android:layout_below="@id/top_bg" + > + <LinearLayout + android:id="@+id/conversation_content" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:orientation="vertical" + android:padding="16dp" + > + </LinearLayout> + </org.grammaticalframework.ui.android.ConversationView> + +</RelativeLayout>
\ No newline at end of file |
