Skip to content

Instantly share code, notes, and snippets.

@adithyaxx
Created December 25, 2017 17:46
Show Gist options
  • Save adithyaxx/a154095cc5436337164cc1b85ca5a8d8 to your computer and use it in GitHub Desktop.
Save adithyaxx/a154095cc5436337164cc1b85ca5a8d8 to your computer and use it in GitHub Desktop.
SimpleExoPlayer Fullscreen Playback Control Layout
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:layoutDirection="ltr"
android:background="@drawable/video_gradient_bg"
android:orientation="vertical">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" >
<ImageButton
android:id="@id/exo_play"
style="@style/ExoMediaButton"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="@drawable/jz_play_normal" />
<ImageButton android:id="@id/exo_pause"
style="@style/ExoMediaButton"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="@drawable/jz_pause_normal" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:layout_marginTop="4dp"
android:layout_gravity="bottom"
android:orientation="horizontal">
<TextView android:id="@id/exo_position"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="14sp"
android:textStyle="bold"
android:paddingLeft="4dp"
android:gravity="center_vertical"
android:paddingRight="4dp"
android:includeFontPadding="false"
android:textColor="#FFBEBEBE"/>
<com.google.android.exoplayer2.ui.DefaultTimeBar
android:id="@id/exo_progress"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:layout_height="26dp"/>
<TextView android:id="@id/exo_duration"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="14sp"
android:textStyle="bold"
android:paddingLeft="4dp"
android:gravity="center_vertical"
android:paddingRight="4dp"
android:includeFontPadding="false"
android:textColor="#FFBEBEBE"/>
<ImageButton
android:id="@+id/exo_fullscreen_button"
android:layout_height="24dp"
android:layout_width="24dp"
android:gravity="center_vertical"
android:layout_marginLeft="5dp"
style="@style/ExoMediaButton"
android:src="@drawable/ic_fullscreen_white_24dp"/>
</LinearLayout>
</FrameLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment