lofi-android/app/src/main/res/layout/fragment_player.xml
Jarian Cottingham cb74c3ddcf Initial commit: Lofi Radio Android app
Carved out from the lofi-app monorepo. Kotlin MVVM client with
HLS playback for the 20 curated lo-fi channels, including a
containerized build.
2026-08-21 18:36:45 +00:00

189 lines
7.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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/player_background"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="20dp"
android:gravity="center_horizontal">
<com.google.android.material.appbar.MaterialToolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/primary"
app:title="@string/now_playing"
app:titleTextColor="@color/on_primary"
android:layout_marginBottom="24dp" />
<androidx.cardview.widget.CardView
android:layout_width="180dp"
android:layout_height="180dp"
app:cardCornerRadius="16dp"
app:cardElevation="8dp"
android:layout_marginBottom="20dp">
<ImageView
android:id="@+id/player_thumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:contentDescription="@null"
tools:background="@color/accent" />
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/player_channel_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/on_surface"
android:textSize="22sp"
android:textStyle="bold"
android:gravity="center"
android:layout_marginBottom="4dp"
tools:text="Lofi Girl" />
<TextView
android:id="@+id/player_video_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/on_surface_variant"
android:textSize="14sp"
android:gravity="center"
android:layout_marginBottom="8dp"
tools:text="beats to relax/study to" />
<TextView
android:id="@+id/player_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/accent"
android:textSize="11sp"
android:gravity="center"
android:layout_marginBottom="24dp"
tools:text="Direct Mode" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:layout_marginBottom="24dp">
<ImageButton
android:id="@+id/btn_previous"
android:layout_width="56dp"
android:layout_height="56dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/previous"
android:src="@android:drawable/ic_media_previous"
app:tint="@color/on_surface" />
<ImageButton
android:id="@+id/btn_play_pause"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/play"
android:src="@android:drawable/ic_btn_now_playing"
app:tint="@color/accent" />
<ImageButton
android:id="@+id/btn_next"
android:layout_width="56dp"
android:layout_height="56dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/next"
android:src="@android:drawable/ic_media_next"
app:tint="@color/on_surface" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginBottom="20dp">
<ImageButton
android:id="@+id/btn_volume"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/volume"
android:src="@android:drawable/ic_btn_volumelow"
app:tint="@color/on_surface_variant" />
<SeekBar
android:id="@+id/volume_slider"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:progress="80"
android:thumbTint="@color/accent"
android:progressTint="@color/accent" />
<TextView
android:id="@+id/volume_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/on_surface_variant"
android:textSize="12sp"
android:layout_marginStart="8dp"
tools:text="80%" />
</LinearLayout>
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/player_progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:indeterminate="true"
app:indicatorColor="@color/accent"
app:trackColor="@color/card_background" />
<TextView
android:id="@+id/player_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/on_surface_variant"
android:textSize="12sp"
android:gravity="center"
tools:text="Playing" />
<LinearLayout
android:id="@+id/error_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:visibility="gone"
android:layout_marginTop="16dp">
<TextView
android:id="@+id/error_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/accent"
android:textSize="14sp"
android:gravity="center"
tools:text="Error playing stream" />
<Button
android:id="@+id/btn_retry"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="Retry"
style="@style/Widget.LofiRadio.Button" />
</LinearLayout>
</LinearLayout>
</ScrollView>