LibreTube/app/src/main/res/layout/fragment_audio_player.xml

318 lines
12 KiB
XML
Raw Normal View History

2023-01-13 22:50:00 +05:30
<?xml version="1.0" encoding="utf-8"?>
<com.github.libretube.ui.views.SingleViewTouchableMotionLayout xmlns:android="http://schemas.android.com/apk/res/android"
2023-01-13 22:50:00 +05:30
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
2023-03-21 23:44:24 +05:30
android:id="@+id/playerMotionLayout"
2023-01-13 22:50:00 +05:30
android:layout_width="match_parent"
android:layout_height="match_parent"
2023-03-21 23:44:24 +05:30
app:layoutDescription="@xml/audio_player_scene">
2023-01-13 22:50:00 +05:30
2023-03-21 23:44:24 +05:30
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/audio_player_container"
2023-01-13 22:50:00 +05:30
android:layout_width="match_parent"
2023-03-21 23:44:24 +05:30
android:layout_height="match_parent"
android:background="?android:attr/colorBackground"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
2023-01-13 22:50:00 +05:30
2023-03-21 23:44:24 +05:30
<LinearLayout
android:id="@+id/audio_player_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="@id/audio_player_container"
app:layout_constraintEnd_toEndOf="@id/audio_player_container"
app:layout_constraintStart_toStartOf="@id/audio_player_container"
app:layout_constraintTop_toTopOf="@id/audio_player_container">
<LinearLayout
2023-05-08 20:54:59 +05:30
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp">
<ImageView
android:id="@+id/minimize_player"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="?selectableItemBackgroundBorderless"
android:src="@drawable/ic_arrow_down" />
2023-05-08 20:54:59 +05:30
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/autoPlay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:scaleX="0.8"
android:scaleY="0.8"
android:thumb="@drawable/player_switch_thumb"
app:thumbTint="?colorPrimary"
app:track="@drawable/player_switch_track"
app:trackTint="?colorControlNormal" />
2023-05-08 20:54:59 +05:30
<ImageView
android:id="@+id/dropdown_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
2023-05-08 20:54:59 +05:30
android:background="?selectableItemBackgroundBorderless"
android:scaleX="0.8"
android:scaleY="0.8"
android:src="@drawable/ic_three_dots" />
2023-05-08 20:54:59 +05:30
</LinearLayout>
2023-05-08 20:54:59 +05:30
2023-03-21 23:44:24 +05:30
<FrameLayout
2023-01-13 22:50:00 +05:30
android:layout_width="match_parent"
2023-03-21 23:44:24 +05:30
android:layout_height="0dp"
android:layout_weight="1">
2023-01-13 22:50:00 +05:30
2023-03-21 23:44:24 +05:30
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/thumbnail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
2023-01-31 22:27:24 +05:30
android:layout_gravity="center"
2023-03-21 23:44:24 +05:30
android:layout_marginHorizontal="20dp"
android:layout_marginVertical="10dp"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
app:shapeAppearanceOverlay="@style/ShapeAppearance.Material3.Corner.Small"
tools:src="@tools:sample/backgrounds/scenic" />
2023-03-21 23:44:24 +05:30
<LinearLayout
android:id="@+id/volumeControls"
android:layout_width="42dp"
android:layout_height="wrap_content"
2023-01-31 22:27:24 +05:30
android:layout_gravity="center"
2023-03-21 23:44:24 +05:30
android:background="@drawable/controls_layout_bg"
android:orientation="vertical"
android:visibility="gone"
tools:ignore="RtlHardcoded">
<TextView
android:id="@+id/volume_textView"
style="@style/SwipeControlString"
android:layout_gravity="center"
app:autoSizeTextType="uniform" />
2023-03-21 23:44:24 +05:30
<ProgressBar
android:id="@+id/volume_progressBar"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="7dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:layout_marginVertical="4dp"
android:progressDrawable="@drawable/vertical_progressbar" />
2023-03-21 23:44:24 +05:30
<ImageView
android:id="@+id/volume_imageView"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center"
android:contentDescription="@string/volume"
android:src="@drawable/ic_volume_up" />
2023-03-21 23:44:24 +05:30
</LinearLayout>
2023-01-31 22:27:24 +05:30
2023-03-21 23:44:24 +05:30
<ProgressBar
android:id="@+id/progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
2023-01-31 22:27:24 +05:30
2023-03-21 23:44:24 +05:30
</FrameLayout>
2023-01-31 22:27:24 +05:30
2023-03-21 23:44:24 +05:30
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
2023-03-21 23:44:24 +05:30
android:layout_margin="20dp"
android:orientation="vertical">
2023-03-21 23:44:24 +05:30
<TextView
android:id="@+id/title"
style="@style/TextViewMarquee"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="24sp" />
2023-01-13 22:50:00 +05:30
2023-03-21 23:44:24 +05:30
<TextView
android:id="@+id/uploader"
style="@style/TextViewMarquee"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="18sp" />
2023-01-13 22:50:00 +05:30
2023-03-21 23:44:24 +05:30
</LinearLayout>
<com.google.android.material.slider.Slider
android:id="@+id/time_bar"
android:layout_width="match_parent"
2023-01-13 22:50:00 +05:30
android:layout_height="wrap_content"
2023-03-21 23:44:24 +05:30
android:layout_marginHorizontal="20dp"
app:labelBehavior="gone" />
2023-01-13 22:50:00 +05:30
2023-03-21 23:44:24 +05:30
<FrameLayout
android:layout_width="match_parent"
2023-01-13 22:50:00 +05:30
android:layout_height="wrap_content"
2023-03-21 23:44:24 +05:30
android:paddingHorizontal="20dp">
2023-01-13 22:50:00 +05:30
2023-03-21 23:44:24 +05:30
<TextView
android:id="@+id/current_position"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center"
tools:text="00:00" />
2023-01-13 22:50:00 +05:30
2023-03-21 23:44:24 +05:30
<TextView
android:id="@+id/duration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center"
tools:text="10:15" />
2023-01-13 22:50:00 +05:30
2023-03-21 23:44:24 +05:30
</FrameLayout>
2023-03-21 23:44:24 +05:30
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
2023-03-21 23:44:24 +05:30
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:layout_marginBottom="36dp">
2023-03-21 23:44:24 +05:30
<ImageView
android:id="@+id/prev"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_marginHorizontal="20dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_prev" />
2023-03-21 23:44:24 +05:30
<com.google.android.material.button.MaterialButton
android:id="@+id/play_pause"
android:layout_width="72dp"
android:layout_height="72dp"
android:insetLeft="0dp"
android:insetTop="0dp"
android:insetRight="0dp"
android:insetBottom="0dp"
app:icon="@drawable/ic_pause"
app:iconSize="24dp"
app:shapeAppearanceOverlay="@style/ShapeAppearance.Material3.Corner.Full" />
2023-03-21 23:44:24 +05:30
<ImageView
android:id="@+id/next"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_marginHorizontal="20dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_next" />
2023-03-21 23:44:24 +05:30
</LinearLayout>
<com.google.android.material.card.MaterialCardView
style="@style/Widget.Material3.CardView.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
2023-03-21 23:44:24 +05:30
android:layout_gravity="center"
android:layout_marginBottom="30dp"
app:cardCornerRadius="18dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="15dp">
<ImageView
android:id="@+id/open_queue"
style="@style/AudioPlayerButton"
android:src="@drawable/ic_queue" />
2023-03-21 23:44:24 +05:30
<ImageView
android:id="@+id/playback_options"
style="@style/AudioPlayerButton"
android:layout_width="27dp"
android:layout_height="27dp"
android:src="@drawable/ic_speed" />
2023-03-21 23:44:24 +05:30
<ImageView
android:id="@+id/open_video"
style="@style/AudioPlayerButton"
android:src="@drawable/ic_video" />
2023-03-21 23:44:24 +05:30
<ImageView
android:id="@+id/share"
style="@style/AudioPlayerButton"
android:src="@drawable/ic_share" />
2023-03-21 23:44:24 +05:30
<ImageView
2023-06-19 16:26:53 +05:30
android:id="@+id/chapters"
2023-03-21 23:44:24 +05:30
style="@style/AudioPlayerButton"
android:src="@drawable/ic_frame"
android:visibility="gone"/>
2023-03-21 23:44:24 +05:30
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
2023-01-13 22:50:00 +05:30
<LinearLayout
2023-03-21 23:44:24 +05:30
android:id="@+id/miniPlayerControls"
android:layout_width="match_parent"
android:layout_height="54dp"
android:alpha="0"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/audio_player_container"
app:layout_constraintEnd_toEndOf="@id/audio_player_container"
app:layout_constraintStart_toStartOf="@id/audio_player_container"
app:layout_constraintTop_toTopOf="@id/audio_player_container">
2023-01-13 22:50:00 +05:30
<ImageView
2023-03-21 23:44:24 +05:30
android:id="@+id/miniPlayerThumbnail"
android:layout_width="96dp"
android:layout_height="match_parent"
2023-01-13 22:50:00 +05:30
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="8dp" />
2023-03-21 23:44:24 +05:30
<TextView
android:id="@+id/miniPlayerTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:paddingHorizontal="8dp"
android:paddingVertical="15dp" />
2023-01-13 22:50:00 +05:30
<ImageView
2023-03-21 23:44:24 +05:30
android:id="@+id/miniPlayerPause"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
2023-01-13 22:50:00 +05:30
android:layout_gravity="center"
android:background="?attr/selectableItemBackgroundBorderless"
2023-03-21 23:44:24 +05:30
android:padding="8dp"
android:src="@drawable/ic_pause" />
2023-03-21 23:44:24 +05:30
<ImageView
android:id="@+id/miniPlayerClose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
2023-03-21 23:44:24 +05:30
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="8dp"
android:src="@drawable/ic_close" />
2023-03-21 23:44:24 +05:30
</LinearLayout>
2023-03-21 23:44:24 +05:30
</com.github.libretube.ui.views.SingleViewTouchableMotionLayout>