aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandros Frantzis <alexandros.frantzis@linaro.org>2012-07-06 13:46:33 +0300
committerAlexandros Frantzis <alexandros.frantzis@linaro.org>2012-07-06 13:46:33 +0300
commit04b3fbf3a5d058f781fc56784fcb7c9e1ac7dcf0 (patch)
tree69d11e407da348de5379025fcca3bee66d4d2858
parentd1b07e4720a13bf74a806fd42b394b87e03341bf (diff)
downloadglmark2-04b3fbf3a5d058f781fc56784fcb7c9e1ac7dcf0.tar.gz
Android: Add "Run" button to the editor activity.
This allows easy testing of benchmark settings before saving.
-rw-r--r--android/res/layout/activity_editor.xml28
-rw-r--r--android/src/org/linaro/glmark2/EditorActivity.java11
2 files changed, 33 insertions, 6 deletions
diff --git a/android/res/layout/activity_editor.xml b/android/res/layout/activity_editor.xml
index c08acda..5da6658 100644
--- a/android/res/layout/activity_editor.xml
+++ b/android/res/layout/activity_editor.xml
@@ -3,14 +3,30 @@
android:layout_width="match_parent"
android:layout_height="match_parent" >
- <Button android:id="@+id/saveButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:text="Save" />
+ <LinearLayout android:id="@+id/buttonLinearLayout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true">
+
+ <Button android:id="@+id/runButton"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1.0"
+ android:layout_alignParentBottom="true"
+ android:text="Run" />
+
+ <Button android:id="@+id/saveButton"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1.0"
+ android:layout_alignParentBottom="true"
+ android:text="Save" />
+
+ </LinearLayout>
+
<ListView android:id="@+id/editorListView"
- android:layout_above="@id/saveButton"
+ android:layout_above="@id/buttonLinearLayout"
android:layout_weight="1.0"
android:layout_width="match_parent"
android:layout_height="match_parent"
diff --git a/android/src/org/linaro/glmark2/EditorActivity.java b/android/src/org/linaro/glmark2/EditorActivity.java
index b59c542..cae30a2 100644
--- a/android/src/org/linaro/glmark2/EditorActivity.java
+++ b/android/src/org/linaro/glmark2/EditorActivity.java
@@ -75,6 +75,17 @@ public class EditorActivity extends Activity {
if (benchmarkText.isEmpty())
benchmarkText = sceneNames[0];
+ /* Set up the run button */
+ Button runButton = (Button) findViewById(R.id.runButton);
+ runButton.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View v) {
+ Intent intent = new Intent(EditorActivity.this, Glmark2Activity.class);
+ String args = "-b " + getBenchmarkDescriptionText();
+ intent.putExtra("args", args);
+ startActivity(intent);
+ }
+ });
+
/* Set up the save button */
Button button = (Button) findViewById(R.id.saveButton);
button.setOnClickListener(new View.OnClickListener() {