UI changes for smaller devices and GTV. Fix for defect 4616102.

Change-Id: I2fc37199eedfd779494cf9e5c87f53fb1081c1eb
This commit is contained in:
Yohann Connell
2011-07-15 16:39:52 -07:00
parent ba2fd8b297
commit b87bd55555
7 changed files with 48 additions and 41 deletions

View File

@@ -3,7 +3,8 @@
package="com.widevine.demo"
>
<uses-permission android:name="android.permission.INTERNET" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<uses-sdk android:minSdkVersion="IceCreamSandwich"></uses-sdk>
<application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.Holo.NoActionBar">
<activity android:name=".WidevineSamplePlayer"
android:label="@string/app_name"
android:screenOrientation="landscape">

View File

@@ -1,2 +1,2 @@
# Project target.
target=android-12
target=android-IceCreamSandwich

View File

@@ -3,5 +3,5 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:id="@+id/textView1" android:text="@string/no_content" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="40pt" android:background="@drawable/background3" android:gravity="center"></TextView>
<TextView android:id="@+id/textView1" android:text="@string/no_content" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="24pt" android:background="@drawable/background3" android:gravity="center"></TextView>
</LinearLayout>

View File

@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp">
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
</TabHost>
</TabHost>

View File

@@ -1,38 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stretchColumns="1"
android:background="@drawable/background3">
<TableRow android:paddingTop="50dip" >
<TableRow >
<TextView
android:layout_width="200dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:typeface="serif"
android:textSize="30sp"
android:paddingLeft="100dip"
android:text="@string/drm_server"/>
<EditText
android:layout_width="600dip"
android:layout_width="300sp"
android:layout_height="wrap_content"
android:textSize="12sp"
android:id="@+id/drm_server"
/>
</TableRow>
<TableRow>
<TextView
android:layout_width="200dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:typeface="serif"
android:textSize="30sp"
android:paddingLeft="100dip"
android:text="@string/device_id"/>
<EditText
android:layout_width="600dip"
android:layout_width="300sp"
android:layout_height="wrap_content"
android:textSize="12sp"
android:id="@+id/device_id"
/>
</TableRow>
@@ -42,42 +38,38 @@
android:layout_height="fill_parent"
>
<TextView
android:layout_width="200dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:typeface="serif"
android:textSize="30sp"
android:paddingLeft="100dip"
android:text="@string/portal_id"/>
<EditText
android:layout_width="600dip"
android:layout_width="300sp"
android:layout_height="wrap_content"
android:textSize="12sp"
android:id="@+id/portal_id"
/>
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:layout_width="200dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:typeface="serif"
android:textSize="30sp"
android:paddingLeft="100dip"
android:text="@string/content_page"/>
<EditText
android:layout_width="600dip"
android:layout_width="300sp"
android:layout_height="wrap_content"
android:textSize="12sp"
android:id="@+id/content_page"
/>
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
>
<Button

View File

@@ -137,6 +137,7 @@ public abstract class AssetActivity extends Activity {
Button next = new Button(this);
next.setText(">>");
next.setTextSize(10);
next.setOnClickListener(nextButtonListener);
// Previous button listener
@@ -154,6 +155,7 @@ public abstract class AssetActivity extends Activity {
};
Button prev = new Button(this);
prev.setText("<<");
prev.setTextSize(10);
prev.setOnClickListener(prevButtonListener);
LinearLayout buttons = new LinearLayout(this);

View File

@@ -14,6 +14,7 @@ import android.widget.MediaController;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Button;
import android.view.Display;
import android.view.Gravity;
import android.view.View;
import android.content.Context;
@@ -23,6 +24,7 @@ import android.media.MediaPlayer.OnErrorListener;
import android.media.MediaPlayer.OnCompletionListener;
public class VideoPlayerView extends Activity {
private final static float BUTTON_FONT_SIZE = 10;
private final static String EXIT_FULLSCREEN = "Exit Full Screen";
private final static String FULLSCREEN = "Enter Full Screen";
private final static String PLAY = "Play";
@@ -42,9 +44,13 @@ public class VideoPlayerView extends Activity {
private LinearLayout main;
private LinearLayout sidePanel;
private boolean enteringFullScreen;
private int width, height;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Display display = getWindowManager().getDefaultDisplay();
height = display.getHeight();
width = display.getWidth();
context = this;
contentView = createView();
setContentView(contentView);
@@ -106,7 +112,7 @@ public class VideoPlayerView extends Activity {
sidePanel = new LinearLayout(this);
sidePanel.setOrientation(LinearLayout.VERTICAL);
sidePanel.addView(scrollView, new LinearLayout.LayoutParams(300, 450));
sidePanel.addView(scrollView, new LinearLayout.LayoutParams((int)(width * 0.35), (int)(height * 0.5)));
LinearLayout.LayoutParams paramsSidePanel = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
@@ -165,7 +171,7 @@ public class VideoPlayerView extends Activity {
FrameLayout.LayoutParams.WRAP_CONTENT));
main = new LinearLayout(this);
main.addView(playerFrame, new LinearLayout.LayoutParams(900,
main.addView(playerFrame, new LinearLayout.LayoutParams((int)(width * 0.65),
LinearLayout.LayoutParams.FILL_PARENT, 1));
main.addView(sidePanel, new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
@@ -242,6 +248,7 @@ public class VideoPlayerView extends Activity {
private View createButtons() {
playButton = new Button(this);
playButton.setText(R.string.play);
playButton.setTextSize(BUTTON_FONT_SIZE);
playButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
@@ -256,6 +263,7 @@ public class VideoPlayerView extends Activity {
Button rightsButton = new Button(this);
rightsButton.setText(R.string.acquire_rights);
rightsButton.setTextSize(BUTTON_FONT_SIZE);
rightsButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
@@ -266,6 +274,7 @@ public class VideoPlayerView extends Activity {
Button removeButton = new Button(this);
removeButton.setText(R.string.remove_rights);
removeButton.setTextSize(BUTTON_FONT_SIZE);
removeButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
@@ -276,6 +285,7 @@ public class VideoPlayerView extends Activity {
Button checkButton = new Button(this);
checkButton.setText(R.string.show_rights);
checkButton.setTextSize(BUTTON_FONT_SIZE);
checkButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
@@ -286,6 +296,7 @@ public class VideoPlayerView extends Activity {
Button checkConstraints = new Button(this);
checkConstraints.setText(R.string.constraints);
checkConstraints.setTextSize(BUTTON_FONT_SIZE);
checkConstraints.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
@@ -297,7 +308,8 @@ public class VideoPlayerView extends Activity {
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT, 1);
LinearLayout.LayoutParams.WRAP_CONTENT, 1);
params.setMargins(0, 0, 0, 5);
LinearLayout buttonsLeft = new LinearLayout(this);