I have a screen on Portrait, I want the video to fit properly and cover the entire view without showing the background by the side,am currently using app:resize_mode="fit"
, this works well, but it shows the background by the side, considering other devices I don't want it to stretch, I have also tried using zoom for the app:resize_mode="zoom"
, but the video-stream cuts off at the top also, how do I make the video-stream fit perfectly without stretching or pixelating across other devices.
<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="match_parent"
android:background="@color/login_hintcolor"
android:weightSum="6.8">
<LinearLayout
android:id="@+id/main_ll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2.8"
android:orientation="vertical">
<FrameLayout
android:id="@+id/main_media_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="50dp">
<com.google.android.exoplayer2.ui.PlayerView
android:id="@+id/exoplayer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/login_graycolor"
app:resize_mode="fit"
android:keepScreenOn="true" />
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center" />
<ImageView
android:id="@+id/image_whole_video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/playing"
android:gravity="center"
android:visibility="gone" />
</FrameLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_coomment_sec"
android:visibility="visible"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:background="@color/white_dull"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="2">
<android.support.v7.widget.RecyclerView
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="10dp"
android:layout_weight="1.7"
android:id="@+id/recyclerv_comment"
android:visibility="visible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false"
/>
<RelativeLayout
android:visibility="gone"
android:layout_marginBottom="10dp"
android:id="@+id/llCommentBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white"
android:orientation="horizontal"
android:padding="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3"
android:gravity="center">
<ProgressBar
android:id="@+id/progressBarComment"
android:layout_weight="0.5"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:visibility="gone"
android:gravity="center" />
<org.xxxxx[ ][1].com.utils.CommentEditText
android:id="@+id/etComment"
android:layout_weight="2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/commet_edittext_background"
android:hint="@string/leave_a_comment"
android:inputType="textMultiLine"
android:maxLength="200"
android:maxLines="3"
android:textColor="@color/black" />
<Button
android:visibility="visible"
android:id="@+id/btn_postcomment"
android:layout_gravity="center"
android:layout_weight="0.5"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:text="Post"
android:textSize="10sp"
android:layout_marginRight="1dp"
android:textStyle="bold"
android:textColor="@color/white"
android:background="@color/comment_button"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>[enter image description here][1]