summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Muramatsu <btmura@android.com>2012-04-12 11:04:43 -0700
committerandroid code review <noreply-gerritcodereview@google.com>2012-04-12 11:04:43 -0700
commit5acd7e8d6c390e40ec19d8bb270ec86f9d354878 (patch)
treee35ed283d2db9e97dc24f4a93710daf07ab0708a
parent2dcbe30709b22c7d222a8dc59a50e0e4257791aa (diff)
parent84746ad1af98887e3a599b6dc684d99a1e30f24c (diff)
downloadcts-5acd7e8d6c390e40ec19d8bb270ec86f9d354878.tar.gz
Merge "Fix MediaStubActivity Layout"
-rw-r--r--tests/res/layout-land/mediaplayer.xml41
-rw-r--r--tests/res/layout/mediaplayer.xml6
-rw-r--r--tests/src/android/media/cts/MediaStubActivity.java23
3 files changed, 46 insertions, 24 deletions
diff --git a/tests/res/layout-land/mediaplayer.xml b/tests/res/layout-land/mediaplayer.xml
new file mode 100644
index 00000000000..28ec039e222
--- /dev/null
+++ b/tests/res/layout-land/mediaplayer.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <SurfaceView android:id="@+id/surface"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1">
+ </SurfaceView>
+
+ <SurfaceView android:id="@+id/surface2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1">
+ </SurfaceView>
+
+ <SurfaceView android:id="@+id/surface3"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1">
+ </SurfaceView>
+
+
+</LinearLayout>
diff --git a/tests/res/layout/mediaplayer.xml b/tests/res/layout/mediaplayer.xml
index aa66e6480bd..0db813baa3b 100644
--- a/tests/res/layout/mediaplayer.xml
+++ b/tests/res/layout/mediaplayer.xml
@@ -22,19 +22,19 @@
<SurfaceView android:id="@+id/surface"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center">
+ android:layout_weight="1">
</SurfaceView>
<SurfaceView android:id="@+id/surface2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center">
+ android:layout_weight="1">
</SurfaceView>
<SurfaceView android:id="@+id/surface3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center">
+ android:layout_weight="1">
</SurfaceView>
</LinearLayout>
diff --git a/tests/src/android/media/cts/MediaStubActivity.java b/tests/src/android/media/cts/MediaStubActivity.java
index f0ca7556d95..114772e458b 100644
--- a/tests/src/android/media/cts/MediaStubActivity.java
+++ b/tests/src/android/media/cts/MediaStubActivity.java
@@ -16,15 +16,14 @@
package android.media.cts;
import com.android.cts.stub.R;
+
import android.app.Activity;
import android.os.Bundle;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
-import android.view.ViewGroup;
public class MediaStubActivity extends Activity {
- public static final int WIDTH = 320;
- public static final int HEIGHT = 240;
+
private SurfaceHolder mHolder;
private SurfaceHolder mHolder2;
@@ -34,23 +33,10 @@ public class MediaStubActivity extends Activity {
setContentView(R.layout.mediaplayer);
SurfaceView surfaceV = (SurfaceView)findViewById(R.id.surface);
- ViewGroup.LayoutParams lp = surfaceV.getLayoutParams();
- lp.width = WIDTH;
- lp.height = HEIGHT;
- surfaceV.setLayoutParams(lp);
mHolder = surfaceV.getHolder();
- mHolder.setFixedSize(WIDTH, HEIGHT);
- mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
SurfaceView surfaceV2 = (SurfaceView)findViewById(R.id.surface2);
- ViewGroup.LayoutParams lp2 = surfaceV2.getLayoutParams();
- lp2.width = WIDTH;
- lp2.height = HEIGHT;
- surfaceV2.setLayoutParams(lp2);
mHolder2 = surfaceV2.getHolder();
- mHolder2.setFixedSize(WIDTH, HEIGHT);
- mHolder2.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
-
}
public SurfaceHolder getSurfaceHolder() {
@@ -60,9 +46,4 @@ public class MediaStubActivity extends Activity {
public SurfaceHolder getSurfaceHolder2() {
return mHolder2;
}
-
- public SurfaceHolder generateSurfaceHolder() {
- SurfaceView surface = (SurfaceView)findViewById(R.id.surface3);
- return surface.getHolder();
- }
}