Merge "UI changes for smaller devices and GTV. Fix for defect 4616102."
This commit is contained in:
committed by
Android (Google) Code Review
commit
851009ab73
@@ -3,7 +3,8 @@
|
|||||||
package="com.widevine.demo"
|
package="com.widevine.demo"
|
||||||
>
|
>
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<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"
|
<activity android:name=".WidevineSamplePlayer"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:screenOrientation="landscape">
|
android:screenOrientation="landscape">
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
# Project target.
|
# Project target.
|
||||||
target=android-12
|
target=android-IceCreamSandwich
|
||||||
|
|||||||
@@ -3,5 +3,5 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="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>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
|
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@android:id/tabhost"
|
android:id="@android:id/tabhost"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="fill_parent">
|
android:layout_height="match_parent">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="match_parent"
|
||||||
android:padding="5dp">
|
>
|
||||||
<TabWidget
|
<TabWidget
|
||||||
android:id="@android:id/tabs"
|
android:id="@android:id/tabs"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@android:id/tabcontent"
|
android:id="@android:id/tabcontent"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="match_parent"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</TabHost>
|
</TabHost>
|
||||||
@@ -1,38 +1,34 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="match_parent"
|
||||||
android:stretchColumns="1"
|
android:stretchColumns="1"
|
||||||
android:background="@drawable/background3">
|
android:background="@drawable/background3">
|
||||||
|
|
||||||
<TableRow android:paddingTop="50dip" >
|
<TableRow >
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="200dip"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_column="1"
|
|
||||||
android:typeface="serif"
|
android:typeface="serif"
|
||||||
android:textSize="30sp"
|
|
||||||
android:paddingLeft="100dip"
|
|
||||||
android:text="@string/drm_server"/>
|
android:text="@string/drm_server"/>
|
||||||
<EditText
|
<EditText
|
||||||
android:layout_width="600dip"
|
android:layout_width="300sp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="12sp"
|
||||||
android:id="@+id/drm_server"
|
android:id="@+id/drm_server"
|
||||||
/>
|
/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="200dip"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_column="1"
|
|
||||||
android:typeface="serif"
|
android:typeface="serif"
|
||||||
android:textSize="30sp"
|
|
||||||
android:paddingLeft="100dip"
|
|
||||||
android:text="@string/device_id"/>
|
android:text="@string/device_id"/>
|
||||||
<EditText
|
<EditText
|
||||||
android:layout_width="600dip"
|
android:layout_width="300sp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="12sp"
|
||||||
android:id="@+id/device_id"
|
android:id="@+id/device_id"
|
||||||
/>
|
/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
@@ -42,42 +38,38 @@
|
|||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
>
|
>
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="200dip"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_column="1"
|
|
||||||
android:typeface="serif"
|
android:typeface="serif"
|
||||||
android:textSize="30sp"
|
|
||||||
android:paddingLeft="100dip"
|
|
||||||
android:text="@string/portal_id"/>
|
android:text="@string/portal_id"/>
|
||||||
<EditText
|
<EditText
|
||||||
android:layout_width="600dip"
|
android:layout_width="300sp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="12sp"
|
||||||
android:id="@+id/portal_id"
|
android:id="@+id/portal_id"
|
||||||
/>
|
/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="match_parent"
|
||||||
>
|
>
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="200dip"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_column="1"
|
|
||||||
android:typeface="serif"
|
android:typeface="serif"
|
||||||
android:textSize="30sp"
|
|
||||||
android:paddingLeft="100dip"
|
|
||||||
android:text="@string/content_page"/>
|
android:text="@string/content_page"/>
|
||||||
<EditText
|
<EditText
|
||||||
android:layout_width="600dip"
|
android:layout_width="300sp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="12sp"
|
||||||
android:id="@+id/content_page"
|
android:id="@+id/content_page"
|
||||||
/>
|
/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ public abstract class AssetActivity extends Activity {
|
|||||||
|
|
||||||
Button next = new Button(this);
|
Button next = new Button(this);
|
||||||
next.setText(">>");
|
next.setText(">>");
|
||||||
|
next.setTextSize(10);
|
||||||
next.setOnClickListener(nextButtonListener);
|
next.setOnClickListener(nextButtonListener);
|
||||||
|
|
||||||
// Previous button listener
|
// Previous button listener
|
||||||
@@ -154,6 +155,7 @@ public abstract class AssetActivity extends Activity {
|
|||||||
};
|
};
|
||||||
Button prev = new Button(this);
|
Button prev = new Button(this);
|
||||||
prev.setText("<<");
|
prev.setText("<<");
|
||||||
|
prev.setTextSize(10);
|
||||||
prev.setOnClickListener(prevButtonListener);
|
prev.setOnClickListener(prevButtonListener);
|
||||||
|
|
||||||
LinearLayout buttons = new LinearLayout(this);
|
LinearLayout buttons = new LinearLayout(this);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import android.widget.MediaController;
|
|||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.view.Display;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -23,6 +24,7 @@ import android.media.MediaPlayer.OnErrorListener;
|
|||||||
import android.media.MediaPlayer.OnCompletionListener;
|
import android.media.MediaPlayer.OnCompletionListener;
|
||||||
|
|
||||||
public class VideoPlayerView extends Activity {
|
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 EXIT_FULLSCREEN = "Exit Full Screen";
|
||||||
private final static String FULLSCREEN = "Enter Full Screen";
|
private final static String FULLSCREEN = "Enter Full Screen";
|
||||||
private final static String PLAY = "Play";
|
private final static String PLAY = "Play";
|
||||||
@@ -42,9 +44,13 @@ public class VideoPlayerView extends Activity {
|
|||||||
private LinearLayout main;
|
private LinearLayout main;
|
||||||
private LinearLayout sidePanel;
|
private LinearLayout sidePanel;
|
||||||
private boolean enteringFullScreen;
|
private boolean enteringFullScreen;
|
||||||
|
private int width, height;
|
||||||
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
Display display = getWindowManager().getDefaultDisplay();
|
||||||
|
height = display.getHeight();
|
||||||
|
width = display.getWidth();
|
||||||
context = this;
|
context = this;
|
||||||
contentView = createView();
|
contentView = createView();
|
||||||
setContentView(contentView);
|
setContentView(contentView);
|
||||||
@@ -106,7 +112,7 @@ public class VideoPlayerView extends Activity {
|
|||||||
|
|
||||||
sidePanel = new LinearLayout(this);
|
sidePanel = new LinearLayout(this);
|
||||||
sidePanel.setOrientation(LinearLayout.VERTICAL);
|
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 paramsSidePanel = new LinearLayout.LayoutParams(
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
@@ -165,7 +171,7 @@ public class VideoPlayerView extends Activity {
|
|||||||
FrameLayout.LayoutParams.WRAP_CONTENT));
|
FrameLayout.LayoutParams.WRAP_CONTENT));
|
||||||
|
|
||||||
main = new LinearLayout(this);
|
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));
|
LinearLayout.LayoutParams.FILL_PARENT, 1));
|
||||||
main.addView(sidePanel, new LinearLayout.LayoutParams(
|
main.addView(sidePanel, new LinearLayout.LayoutParams(
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
@@ -242,6 +248,7 @@ public class VideoPlayerView extends Activity {
|
|||||||
private View createButtons() {
|
private View createButtons() {
|
||||||
playButton = new Button(this);
|
playButton = new Button(this);
|
||||||
playButton.setText(R.string.play);
|
playButton.setText(R.string.play);
|
||||||
|
playButton.setTextSize(BUTTON_FONT_SIZE);
|
||||||
|
|
||||||
playButton.setOnClickListener(new View.OnClickListener() {
|
playButton.setOnClickListener(new View.OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@@ -256,6 +263,7 @@ public class VideoPlayerView extends Activity {
|
|||||||
|
|
||||||
Button rightsButton = new Button(this);
|
Button rightsButton = new Button(this);
|
||||||
rightsButton.setText(R.string.acquire_rights);
|
rightsButton.setText(R.string.acquire_rights);
|
||||||
|
rightsButton.setTextSize(BUTTON_FONT_SIZE);
|
||||||
|
|
||||||
rightsButton.setOnClickListener(new View.OnClickListener() {
|
rightsButton.setOnClickListener(new View.OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@@ -266,6 +274,7 @@ public class VideoPlayerView extends Activity {
|
|||||||
|
|
||||||
Button removeButton = new Button(this);
|
Button removeButton = new Button(this);
|
||||||
removeButton.setText(R.string.remove_rights);
|
removeButton.setText(R.string.remove_rights);
|
||||||
|
removeButton.setTextSize(BUTTON_FONT_SIZE);
|
||||||
|
|
||||||
removeButton.setOnClickListener(new View.OnClickListener() {
|
removeButton.setOnClickListener(new View.OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@@ -276,6 +285,7 @@ public class VideoPlayerView extends Activity {
|
|||||||
|
|
||||||
Button checkButton = new Button(this);
|
Button checkButton = new Button(this);
|
||||||
checkButton.setText(R.string.show_rights);
|
checkButton.setText(R.string.show_rights);
|
||||||
|
checkButton.setTextSize(BUTTON_FONT_SIZE);
|
||||||
|
|
||||||
checkButton.setOnClickListener(new View.OnClickListener() {
|
checkButton.setOnClickListener(new View.OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@@ -286,6 +296,7 @@ public class VideoPlayerView extends Activity {
|
|||||||
|
|
||||||
Button checkConstraints = new Button(this);
|
Button checkConstraints = new Button(this);
|
||||||
checkConstraints.setText(R.string.constraints);
|
checkConstraints.setText(R.string.constraints);
|
||||||
|
checkConstraints.setTextSize(BUTTON_FONT_SIZE);
|
||||||
|
|
||||||
checkConstraints.setOnClickListener(new View.OnClickListener() {
|
checkConstraints.setOnClickListener(new View.OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@@ -297,7 +308,8 @@ public class VideoPlayerView extends Activity {
|
|||||||
|
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||||
LinearLayout.LayoutParams.FILL_PARENT,
|
LinearLayout.LayoutParams.FILL_PARENT,
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT, 1);
|
LinearLayout.LayoutParams.WRAP_CONTENT, 1);
|
||||||
|
|
||||||
params.setMargins(0, 0, 0, 5);
|
params.setMargins(0, 0, 0, 5);
|
||||||
LinearLayout buttonsLeft = new LinearLayout(this);
|
LinearLayout buttonsLeft = new LinearLayout(this);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user