-1

enter image description here

From above attached picture i need like as shown in green rectangle.so view will be transparent i do like @null,@color/transparent but did not match with my requirement.

This is my requirement:-

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.admin.mainapp.MainActivity">


<FrameLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="false">

    <FrameLayout
        android:id="@+id/player_surface_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        android:foregroundGravity="clip_horizontal|clip_vertical"
        tools:ignore="true">

        <SurfaceView
            android:id="@+id/player_surface"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />


    </FrameLayout>


</FrameLayout>


<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:background="#10000000"
    android:layout_alignParentBottom="true">

    <ImageView
        android:id="@+id/screenshot"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="left"
        android:paddingLeft="5dp"
        android:src="@mipmap/ic_launcher" />

    <ToggleButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:layout_gravity="center_vertical" />


    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right|center_vertical"
        android:foregroundGravity="right"
        android:paddingRight="5dp"
        android:background="@mipmap/ic_launcher"
        android:text="sasa" />
</LinearLayout>

This is my attached code.There is surfaceLayout which is having a black background and one linear layout at bottom side for buttons(on/off)video so i need that view will be somehow transparent.

sagar potdar
  • 598
  • 1
  • 6
  • 22

2 Answers2

0

you can use below code,

   <RelativeLayout
    android:id="@+id/footer_ad"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:layout_alignParentBottom="true"
    android:background="#151515"
    android:alpha=".3"></RelativeLayout>
Magesh Pandian
  • 8,789
  • 12
  • 45
  • 60
0

Hii please check this,

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


    <SurfaceView
        android:id="@+id/player_surface"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_gravity="bottom"
        android:background="#33000000"
        android:gravity="center">

        <ImageView
            android:id="@+id/screenshot"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="left"
            android:paddingLeft="5dp"
            android:src="@mipmap/ic_launcher" />

        <ToggleButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:gravity="center" />


        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="right|center_vertical"
            android:background="@mipmap/ic_launcher"
            android:foregroundGravity="right"
            android:paddingRight="5dp"
            android:text="sasa" />
    </LinearLayout>
</FrameLayout>

i couldn't understand what you really want but this might be what you needed .if not please mention below

g7pro
  • 817
  • 1
  • 6
  • 11