Android XML Layout is not fitting for most of devices - android

I am working on a Android project in android studio. In main activity layout the layout doesn't fit for every smart phone. Please help me in this case.
Here is the XML code of main playout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/content_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="ml.microlion.development.fmmahanama.MainActivity"
tools:showIn="#layout/app_bar_main">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="match_parent"
app:srcCompat="#mipmap/fmmahanama_banner2"
android:id="#+id/imageView9"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
android:cropToPadding="false"
android:layout_height="wrap_content" />
</RelativeLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:text="Play Stream"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/btn_playstream"
android:layout_weight="0.51"
android:textAppearance="#style/TextAppearance.AppCompat.Widget.Button.Colored"
android:backgroundTint="?android:attr/colorPressedHighlight"
android:elevation="0dp" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srcCompat="#mipmap/adbar_prev"
android:id="#+id/imageView2"
android:adjustViewBounds="true"
android:scaleType="fitCenter" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="66dp">
<Button
android:text="Go To Website"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/btn_website"
android:layout_weight="1" />
<Button
android:text="Feedback"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/btn_feedback"
android:layout_weight="1" />
<Button
android:text="Share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/btn_share"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
In default Device in Editor i use Nexus 4. It is ok on editor. But when I run it in my galaxy j7 and galaxy dous 2 i can see that layout doesn't fit.

Related

Constraint Layout Issue

This is the code that I keep getting an error when I try to put it into Constraint Layout. I have tried numerous different methods to allow the constraint layout to appear successfully on the profile page. However, I still have been unsuccessful with getting the name to display without being jumbled together.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/graylight"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="260dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="#drawable/gradientbackground"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="425dp"
android:scaleType="centerInside"
android:src="#drawable/jussim" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Justina Simone"
android:textColor="#fff"
android:textSize="21sp"
android:textStyle="bold" />
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</RelativeLayout>
<ImageView
android:id="#+id/IVaddfriend"
android:layout_width="425dp"
android:layout_height="85dp"
android:src="#drawable/ic_person_add_black_24dp" />
<ImageView
android:id="#+id/IVimage1"
android:layout_width="425dp"
android:layout_height="85dp"
android:src="#drawable/ic_message_black_24dp"
tools:ignore="InvalidId" />
<ImageView
android:id="#+id/IVimage2"
android:layout_width="425dp"
android:layout_height="85dp"
android:src="#drawable/ic_grade_black_24dp"/>
</LinearLayout>

View not visible in device but visible in XML

I am trying to build a layout with a right arrow and a vertical line with 2 textviews to right of it.
This layout will be used in a RecyclerView
This is the code that I am using,
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/white"
android:clickable="true"
android:id="#+id/rootLayout"
>
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/white"
android:layout_margin="#dimen/app_margin"
card_view:cardCornerRadius="4dp"
card_view:cardElevation="4dp"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="5dp"
>
<View
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:id="#+id/lineView"
android:layout_marginLeft="15dp"
android:background="#color/colorPrimary"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/name"
android:layout_toRightOf="#+id/lineView"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/type"
android:layout_toRightOf="#+id/lineView"
android:layout_below="#+id/name"
/>
<android.support.v7.widget.AppCompatImageView
android:layout_width="50dp"
android:layout_height="50dp"
app:srcCompat="#drawable/right_arrow"
android:layout_alignParentEnd="true"
android:layout_centerInParent="true"
android:id="#+id/right_arrow"
/>
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
This is the result of the above layout
The blue line is not visible when I run the output on my device but is visible in XML as shown
My Questions
How do I make it visible in my device ?
The blue line is very big I tried wrap_content but still did not work
You can simply align your lineView upto the height of text views. otherwise it will grow upto the device height. Refer this sample.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
app:cardBackgroundColor="#FFFFFF"
app:contentPadding="10dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<View
android:id="#+id/view"
android:layout_width="20dp"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/linearLayout"
android:layout_alignParentTop="true"
android:background="#color/colorPrimary" />
<LinearLayout
android:id="#+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="#+id/view"
android:orientation="vertical"
android:padding="10dp">
<TextView
android:id="#+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ABCD"
android:textSize="15sp" />
<TextView
android:id="#+id/value"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ABCD"
android:textSize="15sp" />
</LinearLayout>
<ImageView
android:id="#+id/img"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
app:srcCompat="#drawable/ic_keyboard_arrow_right_black_24px" />
</RelativeLayout>
</android.support.v7.widget.CardView>
Screenshot of above example:
To fit the line according to content use this
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/white">
<View
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:id="#+id/lineView"
android:layout_marginLeft="15dp"
android:background="#color/colorPrimary"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/name"
android:layout_toRightOf="#+id/lineView"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/type"
android:layout_toRightOf="#+id/lineView"
android:layout_below="#+id/name"
/>
<LinearLayout />

Custom row with circular ImageView and textview in android

I am trying to create a custom row for my RecyclerView. Here is my custom row layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="180dp"
android:layout_margin="5dp"
android:background="#00000000">
<FrameLayout
android:id="#+id/customLevelLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/levelImage"
android:layout_width="160dp"
android:layout_height="160dp"
android:layout_above="#+id/gameText"
android:layout_centerInParent="true"
android:scaleType="fitXY"
android:src="#drawable/circular_background" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="1"
android:textColor="#fff"
android:textSize="45sp" />
<TextView
android:id="#+id/gameText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:gravity="center"
android:textColor="#000"
tools:text="Tracing" />
</RelativeLayout>
<ProgressBar
android:id="#+id/gameProgressBar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
android:indeterminate="true"
android:padding="45dp"
android:visibility="gone" />
</FrameLayout>
<ImageView
android:id="#+id/lockImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/lock_background"
android:padding="45dp"
android:src="#drawable/lock"
android:visibility="gone" />
</RelativeLayout>
This is how it looks like:
The problem is, I have to define a predefined height of the custom row i.e 170dp currently. I am facing 2 problems because of this:
1) If I open the application in a small screen or a tablet device. The custom row is looking ugly i.e I loose the circular shape of the ImageView.
2) The text doesn't remain at the centre if there is a slight change in the layout.
Try this in your code .
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="#00000000">
<FrameLayout
android:id="#+id/customLevelLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/levelImage"
android:layout_width="160dp"
android:layout_height="160dp"
android:layout_centerInParent="true"
android:scaleType="fitXY"
android:src="#drawable/circular_background" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:text="1"
android:textColor="#fff"
android:textSize="45sp"/>
</RelativeLayout>
<TextView
android:id="#+id/gameText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:gravity="center"
android:textColor="#000"
tools:text="Tracing"/>
</LinearLayout>
<ProgressBar
android:id="#+id/gameProgressBar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
android:indeterminate="true"
android:padding="45dp"
android:visibility="gone"/>
</FrameLayout>
<ImageView
android:id="#+id/lockImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/lock_background"
android:padding="45dp"
android:src="#drawable/lock"
android:visibility="gone" />
</RelativeLayout>
Try This. You can use Linearlayout as root than for image and text use RelativeLayout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="#00000000"
android:orientation="vertical">
<FrameLayout
android:id="#+id/customLevelLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/levelImage"
android:layout_width="160dp"
android:layout_height="160dp"
android:layout_centerInParent="true"
android:scaleType="fitXY"
android:src="#drawable/circular_background" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="1"
android:textColor="#fff"
android:textSize="45sp" />
</RelativeLayout>
<TextView
android:id="#+id/gameText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_margin="10dp"
android:gravity="center"
android:textColor="#000"
tools:text="Tracing" />
</LinearLayout>
<ProgressBar
android:id="#+id/gameProgressBar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
android:indeterminate="true"
android:padding="45dp"
android:visibility="gone" />
</FrameLayout>
<ImageView
android:id="#+id/lockImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/lock_background"
android:padding="45dp"
android:src="#drawable/lock"
android:visibility="gone" />
</LinearLayout>
Use constrain layout which helps you to set image like you want just by drag and drop and add constrain
For supporting multiple screen. First you have to go through this link
enter link description here
Once you fix first issue, second issue also will get fix

Android Lollipop device does not show bottom buttons

I have made layout which has buttons at bottom part:
<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"
tools:context="my.site.com.myapp.fragments.NewsFragment">
<!— TODO: Update blank fragment layout —>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/newsListView"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="48dp" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:id="#+id/linearLayout4">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="All Events"
android:id="#+id/fromNewsToAllEventsButton"
android:layout_weight="1"
android:background="#android:color/holo_blue_bright"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/fromNewsToAllSharesButton"
android:layout_weight="1"
android:text="Shares"
android:background="#android:color/holo_blue_dark"/>
</LinearLayout>
</RelativeLayout>
</FrameLayout>
Android 4.1 able to show bottom buttons while Android 5.1 does not.
On the left side Android 5.1 on the right side Android 4.1.
Does Android 5.1 requires additional configurations on layouts? If it is feature of new versions, then it is bad feature.
The main problem is that If this layout is placed on Activity it shows buttons. However it fails to show in Fragment
<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"
tools:context="my.site.com.myapp.fragments.NewsFragment">
<ListView
android:id="#+id/newsListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/buttonLayout" />
<LinearLayout
android:id="#+id/buttonLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<Button
android:id="#+id/fromNewsToAllEventsButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:color/holo_blue_bright"
android:text="All Events" />
<Button
android:id="#+id/fromNewsToAllSharesButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:color/holo_blue_dark"
android:text="Shares" />
</LinearLayout>
</RelativeLayout>
I have to fix your layout replace your xml with below code.
<?xml version="1.0" encoding="utf-8"?>
<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"
tools:context="my.site.com.myapp.fragments.NewsFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:id="#+id/linearLayout4">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="All Events"
android:id="#+id/fromNewsToAllEventsButton"
android:layout_weight="1"
android:background="#android:color/holo_blue_bright"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/fromNewsToAllSharesButton"
android:layout_weight="1"
android:text="Shares"
android:background="#android:color/holo_blue_dark"/>
</LinearLayout>
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/newsListView"
android:layout_alignParentTop="true"
android:layout_above="#id/linearLayout4"
android:layout_marginBottom="5dp"
/>
</RelativeLayout>
</FrameLayout>
<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"
tools:context="my.site.com.myapp.fragments.NewsFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/newsListView"
android:layout_alignParentTop="true"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:id="#+id/linearLayout4">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="All Events"
android:id="#+id/fromNewsToAllEventsButton"
android:layout_weight="1"
android:background="#android:color/holo_blue_bright"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/fromNewsToAllSharesButton"
android:layout_weight="1"
android:text="Shares"
android:background="#android:color/holo_blue_dark"/>
</LinearLayout>
</RelativeLayout>
</FrameLayout>
Here is my output :

Stretch to fill VideoView, aspect ratio of VideoView

I try to stretch video in aim to fill videoview. The target is to create view that in device look like the first pic (like it look in layout preview).
Most of the answers to this questions refer to this link.
I tried this but I still didn't fill video view.
This my layout code :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#drawable/search_gren_screen">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="#+id/go_back"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:onClick="onclick"
android:text="Try again" />
<Button
android:id="#+id/back_to_pick_song"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Select another song"
android:onClick="onclick" />
<Button
android:id="#+id/btn_continue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:onClick="onclick"
android:text="Amazing, continue!" />
</LinearLayout>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<VideoView
android:id="#+id/videoView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_gravity="center" />
</FrameLayout>
</LinearLayout>
Here you have a preview of my declared layout:
However, the result on the device is different:
Try to make your outer layout a relative layout and put the VideoView inside that.
Something like:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/trim_container"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="#+id/buttonContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="#+id/go_back"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:onClick="onclick"
android:text="Try again" />
<Button
android:id="#+id/back_to_pick_song"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Select another song"
android:onClick="onclick" />
<Button
android:id="#+id/btn_continue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:onClick="onclick"
android:text="Amazing, continue!" />
</LinearLayout>
<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_below="#id/buttonContainer"/>
</RelativeLayout>
video view should be inside to the Relative Layout. Here is an example given below. In my case, it works very fine with a FullScreen Button.
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:id="#+id/videoVIewLinId"
android:layout_gravity="center"
android:gravity="center"
android:scaleType="fitXY"
>
<VideoView
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentStart="true"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/videoViewId"
/>
<ImageView
android:id="#+id/fullScreenBtnIdOnlineMedia"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_action_full_screen"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="10dp"
/>
</RelativeLayout>
The fill_parent method doesn't work for me.
Finally I use this library, works great!
https://github.com/dmytrodanylyk/video-crop

Categories

Resources