1

I am developing an android app in which am using various tabs using TabHost, one tab contains video view. I am also using images at top. My Layout is as

|main|

--|Images|

--|TabHost|

----|LinearLayout|

----|FrameLayout|

----|TabWidget|

I wants to show my video in full screen that is just over main. I also wants to toggle full screen that is on normal mode video should fit under |images| and Tabs, and on full screen mode, should cover all visible area.

My activity_main_screen.xml is as

<?xml version="1.0" encoding="utf-8"?>

<ImageView
    android:id="@+id/btn_rating"
    android:layout_width="177px"
    android:layout_height="38px"
    android:layout_marginBottom="6px"
    android:layout_marginLeft="3px"
    android:layout_marginTop="3px"
    android:background="@drawable/rate_button"
    android:contentDescription="@string/homeButton" />

<ImageView
    android:id="@+id/titleImage"
    android:layout_width="264px"
    android:layout_height="42px"
    android:layout_centerHorizontal="true"
    android:contentDescription="@string/titleImage" />

<TabHost
    android:id="@android:id/tabhost"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/btn_rating" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="match_parent"
            android:layout_height="50px"
            android:layout_marginBottom="-10px"
            android:gravity="center"
            android:paddingBottom="8px" />
    </LinearLayout>
</TabHost>

and

activity_video.xml is: `

<FrameLayout
    android:id="@+id/fragment_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="center"
    tools:ignore="PxUsage" >
</FrameLayout>

`

and Fragment_video_play.xml is:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
       android:layout_width="fill_parent"
       android:layout_height="fill_parent" >

Please suggest me how to show video in full screen?

Thanks in advance

A_J
  • 1,635
  • 1
  • 18
  • 31

1 Answers1

0

How I got my VideoView to fill the entire screen (ignoring possible problems with aspect ratio) is as follows:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent" >

    <VideoView
         android:id="@+id/VideoView"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_alignParentLeft="true"
         android:layout_alignParentRight="true"
         android:layout_alignParentBottom="true"
         android:layout_alignParentTop="true"
         android:layout_below="@id/buttonContainer"/>
</RelativeLayout>

However, I wouldn't reccomend drawing the video on top of other UI elements, since this is overdraw which decreases the performance of your app.

Joris
  • 1,437
  • 1
  • 15
  • 22
  • Thanks Joris for your comment, but this soln didnt worked for me, it is still showing under top images and bottom tabs. I wants to hide/overlap those. – A_J Apr 24 '13 at 18:53
  • I think you'll have to start a new activity and make that fullscreen then. I'm not sure if you can draw on top of your tabs... – Joris Apr 25 '13 at 07:56