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

399 lines
16 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" />
<ImageView
android:id="@+id/open_video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginHorizontal="6dp"
android:src="@drawable/ic_video" />
</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">
<FrameLayout
android:id="@+id/rewindFL"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="?attr/selectableItemBackgroundBorderless">
<ImageView
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_gravity="center"
android:src="@drawable/ic_rewind_md" />
<TextView
android:id="@+id/rewindTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:textSize="8sp"
android:textStyle="bold"
tools:ignore="SmallSp" />
</FrameLayout>
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:src="@drawable/ic_next" />
2023-03-21 23:44:24 +05:30
<FrameLayout
android:id="@+id/forwardFL"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="?attr/selectableItemBackgroundBorderless">
<ImageView
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_gravity="center"
android:src="@drawable/ic_forward_md" />
<TextView
android:id="@+id/forwardTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:textSize="8sp"
android:textStyle="bold"
tools:ignore="SmallSp" />
</FrameLayout>
2023-03-21 23:44:24 +05:30
</LinearLayout>
<com.google.android.material.card.MaterialCardView
style="@style/Widget.Material3.CardView.Elevated"
android:layout_width="match_parent"
android:layout_height="wrap_content"
2023-03-21 23:44:24 +05:30
android:layout_gravity="center"
android:layout_marginTop="30dp"
app:shapeAppearanceOverlay="@style/CardOnlyBottomCorners">
2023-03-21 23:44:24 +05:30
<FrameLayout
android:layout_width="match_parent"
2023-03-21 23:44:24 +05:30
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="15dp">
2024-01-03 18:35:02 +05:30
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
2024-01-03 18:35:02 +05:30
android:layout_gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/playback_options"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:scaleX="0.9"
android:scaleY="0.9"
android:src="@drawable/ic_speed" />
<ImageView
android:id="@+id/sleep_timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackgroundBorderless"
android:scaleX="0.9"
android:scaleY="0.9"
android:src="@drawable/ic_sleep" />
</LinearLayout>
2023-03-21 23:44:24 +05:30
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/open_chapters"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:scaleX="0.9"
android:scaleY="0.9"
android:src="@drawable/ic_frame" />
<ImageView
android:id="@+id/open_queue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_queue" />
</LinearLayout>
2023-03-21 23:44:24 +05:30
<ImageView
android:id="@+id/show_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
android:background="?attr/selectableItemBackgroundBorderless"
android:scaleX="0.9"
android:scaleY="0.9"
android:src="@drawable/ic_three_dots" />
</FrameLayout>
2023-03-21 23:44:24 +05:30
</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>