Make background black while playing video.
Change-Id: I31d752c8b7846c16684c5488ea320056092541e4
Fixes: 30231014
diff --git a/res/layout/retail_video.xml b/res/layout/retail_video.xml
index 3393604..62ee775 100644
--- a/res/layout/retail_video.xml
+++ b/res/layout/retail_video.xml
@@ -32,11 +32,16 @@
android:layout_marginBottom="@dimen/fallback_view_text_margin_bottom" />
</FrameLayout>
- <VideoView
- android:id="@+id/video_content"
+ <FrameLayout android:id="@+id/video_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_gravity="center"
- android:keepScreenOn="true" />
+ android:keepScreenOn="true"
+ android:background="@android:color/black">
+ <VideoView
+ android:id="@+id/video_content"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_gravity="center" />
+ </FrameLayout>
</merge>
diff --git a/src/com/android/retaildemo/DemoPlayer.java b/src/com/android/retaildemo/DemoPlayer.java
index 58d9a4e..9e63a43 100644
--- a/src/com/android/retaildemo/DemoPlayer.java
+++ b/src/com/android/retaildemo/DemoPlayer.java
@@ -113,11 +113,12 @@
private void displayFallbackView() {
if (DEBUG) Log.d(TAG, "Showing the fallback view");
findViewById(R.id.fallback_layout).setVisibility(View.VISIBLE);
- mVideoView.setVisibility(View.GONE);
+ findViewById(R.id.video_layout).setVisibility(View.GONE);
}
private void displayVideoView() {
- mVideoView.setVisibility(View.VISIBLE);
+ if (DEBUG) Log.d(TAG, "Showing the video view");
+ findViewById(R.id.video_layout).setVisibility(View.VISIBLE);
findViewById(R.id.fallback_layout).setVisibility(View.GONE);
}