Merge "Fix UI in image processing."

This commit is contained in:
Alex Sakhartchouk
2011-02-18 09:12:30 -08:00
committed by Android (Google) Code Review
3 changed files with 131 additions and 166 deletions

View 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" />

View File

@@ -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>

View 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);