Skip to content

Instantly share code, notes, and snippets.

@sajjadyousefnia
Created March 27, 2024 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sajjadyousefnia/6f8bde272a649cc1c828cc480dec6861 to your computer and use it in GitHub Desktop.
Save sajjadyousefnia/6f8bde272a649cc1c828cc480dec6861 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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">
<org.videolan.libvlc.util.VLCVideoLayout
android:id="@+id/VideoView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/Controller"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/navigationBar"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="bottom"
android:background="@color/colorPrimary_trans"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHeight_percent="0.2"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1">
<androidx.constraintlayout.helper.widget.Flow
android:layout_width="match_parent"
android:layout_height="0dp"
app:constraint_referenced_ids="playPauseBtn,currTime,currPosition,countTime,view2,view3"
app:flow_horizontalStyle="spread"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/playPauseBtn"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
app:cardBackgroundColor="@color/card_view_color"
app:cardCornerRadius="5dp"
app:flow_horizontalStyle="spread"
app:flow_wrapMode="aligned"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintHeight_percent="0.6"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/currTime"
app:strokeWidth="0dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imgPause"
android:layout_width="10dp"
android:layout_height="10dp"
android:background="@null"
android:scaleType="fitXY"
android:src="@drawable/ic_pause"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintHeight_percent="0.35"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tint="@color/orange_controls" />
<ImageView
android:id="@+id/imgPlay"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_margin="6dp"
android:background="@null"
android:scaleType="fitXY"
android:src="@drawable/ic_play"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintHeight_percent="0.35"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tint="@color/orange_controls" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/currTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:fontFamily="@font/regular"
android:gravity="center"
android:text="00:00:00"
android:textColor="@color/app_bright_white_color"
android:textSize="@dimen/video_player_bottom_size"
app:fontFamily="@font/regular"
app:layout_constraintLeft_toRightOf="@id/playPauseBtn"
app:layout_constraintRight_toLeftOf="@+id/currPosition" />
<SeekBar
android:id="@+id/currPosition"
android:layout_width="0dp"
android:layout_height="match_parent"
android:max="1000"
android:progress="0"
android:thumb="@drawable/exo_thumb_drawable"
app:layout_constrainedWidth="true"
app:layout_constraintLeft_toRightOf="@id/currTime"
app:layout_constraintRight_toLeftOf="@+id/countTime"
app:layout_constraintWidth_percent="0.475" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/countTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/regular"
android:gravity="center"
android:text="00:00:00"
android:textColor="@color/app_bright_white_color"
android:textSize="@dimen/video_player_bottom_size"
app:fontFamily="@font/regular"
app:layout_constraintLeft_toRightOf="@+id/currPosition"
app:layout_constraintRight_toLeftOf="@id/view2" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/view2"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center"
app:cardBackgroundColor="@color/card_view_color"
app:cardCornerRadius="5dp"
app:layout_constraintHeight_percent="0.65"
app:layout_constraintLeft_toRightOf="@+id/countTime"
app:layout_constraintRight_toLeftOf="@+id/view3"
app:strokeWidth="0dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">
<androidx.constraintlayout.helper.widget.Flow
android:layout_width="match_parent"
android:layout_height="match_parent"
app:constraint_referenced_ids="speedBtn,scaleBtn" />
<TextView
android:id="@+id/speedBtn"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:background="@drawable/shape_user_focus"
android:focusable="true"
android:fontFamily="@font/regular"
android:gravity="center"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:text="1X"
android:textColor="@color/white"
android:textSize="@dimen/video_player_bottom_size"
app:layout_constraintHeight_percent="0.65" />
<TextView
android:id="@+id/scaleBtn"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:background="@drawable/shape_user_focus"
android:focusable="true"
android:fontFamily="@font/regular"
android:gravity="center"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:text="16:9"
android:textColor="@color/white"
android:textSize="@dimen/video_player_bottom_size"
app:layout_constraintHeight_percent="0.65" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/view3"
android:layout_width="0dp"
android:layout_height="0dp"
app:cardBackgroundColor="@color/card_view_color"
app:cardCornerRadius="5dp"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintHeight_percent="0.6"
app:layout_constraintLeft_toRightOf="@+id/view2"
app:layout_constraintRight_toRightOf="parent"
app:strokeWidth="0dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:background="@null"
android:src="@drawable/ic_monitor"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintHeight_percent="0.35"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tint="@color/orange_controls" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/topBar"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/colorPrimary_trans"
app:layout_constraintHeight_percent="0.2"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.helper.widget.Flow
android:layout_width="match_parent"
android:layout_height="match_parent"
app:constraint_referenced_ids="crdClose,videoTitle,subTracksBtn,audioTracksBtn,crdMute" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/crdClose"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginLeft="5dp"
app:cardBackgroundColor="@color/card_view_color"
app:cardCornerRadius="5dp"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintHeight_percent="0.65"
app:strokeWidth="0dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="6dp"
android:background="@null"
android:scaleType="fitXY"
android:src="@drawable/x_icon"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintHeight_percent="0.35"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tint="@color/red" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<TextView
android:id="@+id/videoTitle"
android:layout_width="0dp"
android:layout_height="match_parent"
android:fontFamily="@font/regular"
android:gravity="center"
android:maxLines="1"
android:text="نام فیلم در حال پخش"
android:textColor="#99FFFFFF"
android:textSize="@dimen/video_player_bottom_size"
app:layout_constraintWidth_percent="0.65" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/subTracksBtn"
android:layout_width="0dp"
android:layout_height="0dp"
app:cardBackgroundColor="@color/card_view_color"
app:cardCornerRadius="5dp"
app:layout_constraintHeight_percent="0.65"
app:strokeWidth="0dp">
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="center"
android:background="@null"
android:scaleType="fitXY"
android:src="@drawable/ic_caption"
app:tint="@color/orange_controls" />
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/audioTracksBtn"
android:layout_width="0dp"
android:layout_height="0dp"
app:cardBackgroundColor="@color/card_view_color"
app:cardCornerRadius="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintTop_toTopOf="parent"
app:strokeWidth="0dp">
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="center"
android:background="@null"
android:scaleType="fitXY"
android:src="@drawable/ic_outline_audiotrack_48"
app:tint="@color/orange_controls" />
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/crdMute"
android:layout_width="0dp"
android:layout_height="0dp"
app:cardBackgroundColor="@color/card_view_color"
app:cardCornerRadius="5dp"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintHeight_percent="0.65"
app:strokeWidth="0dp">
<ImageView
android:id="@+id/imgUnMute"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="center"
android:background="@null"
android:src="@drawable/ic_sound"
android:visibility="visible"
app:tint="@color/orange_controls" />
<ImageView
android:id="@+id/imgMute"
android:layout_width="10dp"
android:layout_height="10dp"
android:background="@null"
android:padding="5dp"
android:src="@drawable/ic_mute"
app:tint="@color/orange_controls" />
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/loading"
android:layout_width="86dp"
android:layout_height="86dp"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:indeterminateTint="@color/colorAccent"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/loading1" />
</FrameLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment