OSDN Git Service

Fix UI in image processing.
authorAlex Sakhartchouk <alexst@google.com>
Thu, 17 Feb 2011 22:43:27 +0000 (14:43 -0800)
committerAlex Sakhartchouk <alexst@google.com>
Thu, 17 Feb 2011 22:43:27 +0000 (14:43 -0800)
Change-Id: I4ec562e986e5009c101a62de8b15c6be0f0bc03b

libs/rs/java/ImageProcessing/AndroidManifest.xml
libs/rs/java/ImageProcessing/res/layout/main.xml
libs/rs/java/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java

index 0fcbf1e..69a33bc 100644 (file)
@@ -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" />
index c6ec729..b271b43 100644 (file)
      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
index 5de09f7..4f2f52a 100644 (file)
@@ -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);