summaryrefslogtreecommitdiffstats
path: root/libs/rs
diff options
context:
space:
mode:
authorAlex Sakhartchouk <alexst@google.com>2011-02-17 14:43:27 -0800
committerAlex Sakhartchouk <alexst@google.com>2011-02-17 14:43:27 -0800
commitdb217e0f02d6e719838576a54de9b7c59fa153fe (patch)
treeb6f8c9d8771eb3407e1fe70a48be6b5148bde7d3 /libs/rs
parent2e10374dceea41ebab13e5d2834f6767f2c23b3d (diff)
downloadframeworks_base-db217e0f02d6e719838576a54de9b7c59fa153fe.zip
frameworks_base-db217e0f02d6e719838576a54de9b7c59fa153fe.tar.gz
frameworks_base-db217e0f02d6e719838576a54de9b7c59fa153fe.tar.bz2
Fix UI in image processing.
Change-Id: I4ec562e986e5009c101a62de8b15c6be0f0bc03b
Diffstat (limited to 'libs/rs')
-rw-r--r--libs/rs/java/ImageProcessing/AndroidManifest.xml3
-rw-r--r--libs/rs/java/ImageProcessing/res/layout/main.xml290
-rw-r--r--libs/rs/java/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java4
3 files changed, 131 insertions, 166 deletions
diff --git a/libs/rs/java/ImageProcessing/AndroidManifest.xml b/libs/rs/java/ImageProcessing/AndroidManifest.xml
index 0fcbf1e..69a33bc 100644
--- a/libs/rs/java/ImageProcessing/AndroidManifest.xml
+++ b/libs/rs/java/ImageProcessing/AndroidManifest.xml
@@ -6,8 +6,7 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-sdk android:minSdkVersion="11" />
<application android:label="Image Processing">
- <activity android:name="ImageProcessingActivity"
- android:screenOrientation="portrait">
+ <activity android:name="ImageProcessingActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
diff --git a/libs/rs/java/ImageProcessing/res/layout/main.xml b/libs/rs/java/ImageProcessing/res/layout/main.xml
index c6ec729..b271b43 100644
--- a/libs/rs/java/ImageProcessing/res/layout/main.xml
+++ b/libs/rs/java/ImageProcessing/res/layout/main.xml
@@ -14,174 +14,140 @@
limitations under the License.
-->
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
-
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
<SurfaceView
android:id="@+id/surface"
android:layout_width="1dip"
android:layout_height="1dip" />
-
<ImageView
android:id="@+id/display"
android:layout_width="320dip"
android:layout_height="266dip" />
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+ <Button
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/benchmark"
+ android:onClick="benchmark"/>
+ <TextView
+ android:id="@+id/benchmarkText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textSize="8pt"
+ android:text="@string/saturation"/>
+ </LinearLayout>
+ <ScrollView
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+ <TextView
+ android:id="@+id/inSaturationText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textSize="8pt"
+ android:layout_marginLeft="10sp"
+ android:layout_marginTop="15sp"
+ android:text="@string/saturation"/>
+ <SeekBar
+ android:id="@+id/inSaturation"
+ android:layout_marginLeft="10sp"
+ android:layout_marginRight="10sp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+ <TextView
+ android:id="@+id/inGammaText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textSize="8pt"
+ android:layout_marginLeft="10sp"
+ android:layout_marginTop="15sp"
+ android:text="@string/gamma"/>
+ <SeekBar
+ android:id="@+id/inGamma"
+ android:layout_marginLeft="10sp"
+ android:layout_marginRight="10sp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+ <TextView
+ android:id="@+id/outWhiteText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10sp"
+ android:layout_marginTop="15sp"
+ android:textSize="8pt"
+ android:text="@string/out_white"/>
+ <SeekBar
+ android:id="@+id/outWhite"
+ android:layout_marginLeft="10sp"
+ android:layout_marginRight="10sp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+ <TextView
+ android:id="@+id/inWhiteText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textSize="8pt"
+ android:layout_marginLeft="10sp"
+ android:layout_marginTop="15sp"
+ android:text="@string/in_white"/>
+ <SeekBar
+ android:id="@+id/inWhite"
+ android:layout_marginLeft="10sp"
+ android:layout_marginRight="10sp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+ <TextView
+ android:id="@+id/outBlackText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textSize="8pt"
+ android:layout_marginLeft="10sp"
+ android:layout_marginTop="15sp"
+ android:text="@string/out_black"/>
+ <SeekBar
+ android:id="@+id/outBlack"
+ android:layout_marginLeft="10sp"
+ android:layout_marginRight="10sp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+ <TextView
+ android:id="@+id/inBlackText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textSize="8pt"
+ android:layout_marginLeft="10sp"
+ android:layout_marginTop="15sp"
+ android:text="@string/in_black"/>
+ <SeekBar
+ android:id="@+id/inBlack"
+ android:layout_marginLeft="10sp"
+ android:layout_marginRight="10sp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+ <TextView
+ android:id="@+id/blurText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textSize="8pt"
+ android:layout_marginLeft="10sp"
+ android:layout_marginTop="15sp"
+ android:text="@string/blur_description"/>
+ <SeekBar
+ android:id="@+id/radius"
+ android:layout_marginLeft="10sp"
+ android:layout_marginRight="10sp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+ </LinearLayout>
+ </ScrollView>
+</LinearLayout>
- <Button
- android:layout_marginBottom="170dip"
- android:layout_width="wrap_content"
- android:layout_height="40dip"
- android:text="@string/benchmark"
- android:onClick="benchmark"
- android:layout_gravity="bottom"/>
-
- <TextView
- android:id="@+id/benchmarkText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18sp"
- android:layout_marginLeft="100dip"
- android:layout_marginBottom="175dip"
- android:layout_gravity="bottom"
- android:text="@string/saturation"/>
-
- <SeekBar
- android:id="@+id/inSaturation"
- android:layout_marginBottom="140dip"
- android:layout_marginLeft="10dip"
- android:layout_marginRight="10dip"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom" />
-
- <TextView
- android:id="@+id/inSaturationText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18sp"
- android:layout_marginLeft="50dip"
- android:layout_marginBottom="142dip"
- android:textColor="#000"
- android:layout_gravity="bottom"
- android:text="@string/saturation"/>
-
- <SeekBar
- android:id="@+id/inGamma"
- android:layout_marginBottom="110dip"
- android:layout_marginLeft="10dip"
- android:layout_marginRight="10dip"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom" />
-
- <TextView
- android:id="@+id/inGammaText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18sp"
- android:layout_marginLeft="50dip"
- android:layout_marginBottom="112dip"
- android:textColor="#000"
- android:layout_gravity="bottom"
- android:text="@string/gamma"/>
-
- <SeekBar
- android:id="@+id/outWhite"
- android:layout_marginBottom="80dip"
- android:layout_marginLeft="170dip"
- android:layout_marginRight="10dip"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom" />
-
- <TextView
- android:id="@+id/outWhiteText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18sp"
- android:layout_marginLeft="220dip"
- android:layout_marginBottom="82dip"
- android:textColor="#000"
- android:layout_gravity="bottom"
- android:text="@string/out_white"/>
-
- <SeekBar
- android:id="@+id/inWhite"
- android:layout_marginBottom="80dip"
- android:layout_marginLeft="10dip"
- android:layout_marginRight="170dip"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom" />
-
- <TextView
- android:id="@+id/inWhiteText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18sp"
- android:layout_marginLeft="50dip"
- android:layout_marginBottom="82dip"
- android:textColor="#000"
- android:layout_gravity="bottom"
- android:text="@string/in_white"/>
-
- <SeekBar
- android:id="@+id/outBlack"
- android:layout_marginBottom="50dip"
- android:layout_marginLeft="170dip"
- android:layout_marginRight="10dip"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom" />
-
- <TextView
- android:id="@+id/outBlackText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18sp"
- android:layout_marginLeft="220dip"
- android:layout_marginBottom="52dip"
- android:textColor="#000"
- android:layout_gravity="bottom"
- android:text="@string/out_black"/>
-
- <SeekBar
- android:id="@+id/inBlack"
- android:layout_marginBottom="50dip"
- android:layout_marginLeft="10dip"
- android:layout_marginRight="170dip"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom" />
-
- <TextView
- android:id="@+id/inBlackText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18sp"
- android:layout_marginLeft="50dip"
- android:layout_marginBottom="52dip"
- android:textColor="#000"
- android:layout_gravity="bottom"
- android:text="@string/in_black"/>
-
- <SeekBar
- android:id="@+id/radius"
- android:layout_marginBottom="10dip"
- android:layout_marginLeft="10dip"
- android:layout_marginRight="10dip"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom" />
-
- <TextView
- android:id="@+id/blurText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18sp"
- android:layout_marginLeft="50dip"
- android:layout_marginBottom="12dip"
- android:textColor="#000"
- android:layout_gravity="bottom"
- android:text="@string/blur_description"/>
-
-</merge> \ No newline at end of file
diff --git a/libs/rs/java/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java b/libs/rs/java/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java
index 5de09f7..4f2f52ab 100644
--- a/libs/rs/java/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java
+++ b/libs/rs/java/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java
@@ -346,7 +346,7 @@ public class ImageProcessingActivity extends Activity
mSaturationSeekBar.setProgress(50);
mBenchmarkResult = (TextView) findViewById(R.id.benchmarkText);
- mBenchmarkResult.setText("Benchmark not yet run");
+ mBenchmarkResult.setText("Result: not run");
}
public void surfaceCreated(SurfaceHolder holder) {
@@ -430,7 +430,7 @@ public class ImageProcessingActivity extends Activity
//long javaTime = javaFilter();
//mBenchmarkResult.setText("RS: " + t + " ms Java: " + javaTime + " ms");
- mBenchmarkResult.setText("RS: " + t + " ms");
+ mBenchmarkResult.setText("Result: " + t + " ms");
mRadius = oldRadius;
mScript.set_radius(mRadius);