feat: implemented a dialog box for displaying details of the currently playing track

This commit is contained in:
antonio 2023-09-06 18:28:32 +02:00
parent 99be2764d0
commit 6a505eea4e
7 changed files with 665 additions and 84 deletions

View file

@ -0,0 +1,447 @@
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp">
<ImageView
android:id="@+id/track_cover_info_image_view"
android:layout_width="52dp"
android:layout_height="52dp"
android:layout_gravity="center"
android:layout_marginEnd="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/trak_title_info_text_view"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/trak_title_info_text_view"
style="@style/LabelMedium"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/label_placeholder"
app:layout_constraintBottom_toTopOf="@+id/trak_artist_info_text_view"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/track_cover_info_image_view"
app:layout_constraintTop_toTopOf="@+id/track_cover_info_image_view"
app:layout_constraintVertical_chainStyle="packed" />
<TextView
android:id="@+id/trak_artist_info_text_view"
style="@style/LabelSmall"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/label_placeholder"
app:layout_constraintBottom_toBottomOf="@+id/track_cover_info_image_view"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/trak_title_info_text_view"
app:layout_constraintTop_toBottomOf="@+id/trak_title_info_text_view" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/trak_transcoding_info_text_view"
style="@style/TitleMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp" />
<LinearLayout
android:id="@+id/title_info_sector"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp">
<TextView
android:id="@+id/title_key_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:paddingEnd="8dp"
android:text="@string/track_info_title" />
<TextView
android:id="@+id/title_value_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="7"
android:text="@string/label_placeholder" />
</LinearLayout>
<View
style="@style/Divider"
android:layout_gravity="center_vertical"
android:layout_marginVertical="8dp" />
<LinearLayout
android:id="@+id/album_info_sector"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/album_key_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:paddingEnd="8dp"
android:text="@string/track_info_album" />
<TextView
android:id="@+id/album_value_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="7"
android:text="@string/label_placeholder" />
</LinearLayout>
<View
style="@style/Divider"
android:layout_gravity="center_vertical"
android:layout_marginVertical="8dp" />
<LinearLayout
android:id="@+id/artist_info_sector"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/artist_key_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:paddingEnd="8dp"
android:text="@string/track_info_artist" />
<TextView
android:id="@+id/artist_value_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="7"
android:text="@string/label_placeholder" />
</LinearLayout>
<View
style="@style/Divider"
android:layout_gravity="center_vertical"
android:layout_marginVertical="8dp" />
<LinearLayout
android:id="@+id/track_number_info_sector"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/track_number_key_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:paddingEnd="8dp"
android:text="@string/track_info_track_number" />
<TextView
android:id="@+id/track_number_value_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="7"
android:text="@string/label_placeholder" />
</LinearLayout>
<View
style="@style/Divider"
android:layout_gravity="center_vertical"
android:layout_marginVertical="8dp" />
<LinearLayout
android:id="@+id/year_info_sector"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/year_key_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:paddingEnd="8dp"
android:text="@string/track_info_year" />
<TextView
android:id="@+id/year_value_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="7"
android:text="@string/label_placeholder" />
</LinearLayout>
<View
style="@style/Divider"
android:layout_gravity="center_vertical"
android:layout_marginVertical="8dp" />
<LinearLayout
android:id="@+id/genre_info_sector"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/genre_key_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:paddingEnd="8dp"
android:text="@string/track_info_genre" />
<TextView
android:id="@+id/genre_value_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="7"
android:text="@string/label_placeholder" />
</LinearLayout>
<View
style="@style/Divider"
android:layout_gravity="center_vertical"
android:layout_marginVertical="8dp" />
<LinearLayout
android:id="@+id/size_info_sector"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/size_key_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:paddingEnd="8dp"
android:text="@string/track_info_size" />
<TextView
android:id="@+id/size_value_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="7"
android:text="@string/label_placeholder" />
</LinearLayout>
<View
style="@style/Divider"
android:layout_gravity="center_vertical"
android:layout_marginVertical="8dp" />
<LinearLayout
android:id="@+id/content_type_info_sector"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/content_type_key_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:paddingEnd="8dp"
android:text="@string/track_info_content_type" />
<TextView
android:id="@+id/content_type_value_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="7"
android:text="@string/label_placeholder" />
</LinearLayout>
<View
style="@style/Divider"
android:layout_gravity="center_vertical"
android:layout_marginVertical="8dp" />
<LinearLayout
android:id="@+id/suffix_info_sector"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/suffix_key_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:paddingEnd="8dp"
android:text="@string/track_info_suffix" />
<TextView
android:id="@+id/suffix_value_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="7"
android:text="@string/label_placeholder" />
</LinearLayout>
<View
style="@style/Divider"
android:layout_gravity="center_vertical"
android:layout_marginVertical="8dp" />
<LinearLayout
android:id="@+id/transcoded_content_type_info_sector"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/transcoded_content_type_key_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:paddingEnd="8dp"
android:text="@string/track_info_transcoded_content_type" />
<TextView
android:id="@+id/transcoded_content_type_value_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="7"
android:text="@string/label_placeholder" />
</LinearLayout>
<View
style="@style/Divider"
android:layout_gravity="center_vertical"
android:layout_marginVertical="8dp" />
<LinearLayout
android:id="@+id/transcoded_suffix_info_sector"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/transcoded_suffix_key_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:paddingEnd="8dp"
android:text="@string/track_info_transcoded_suffix" />
<TextView
android:id="@+id/transcoded_suffix_value_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="7"
android:text="@string/label_placeholder" />
</LinearLayout>
<View
style="@style/Divider"
android:layout_gravity="center_vertical"
android:layout_marginVertical="8dp" />
<LinearLayout
android:id="@+id/duration_info_sector"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/duration_key_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:paddingEnd="8dp"
android:text="@string/track_info_duration" />
<TextView
android:id="@+id/duration_value_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="7"
android:text="@string/label_placeholder" />
</LinearLayout>
<View
style="@style/Divider"
android:layout_gravity="center_vertical"
android:layout_marginVertical="8dp" />
<LinearLayout
android:id="@+id/bitrate_info_sector"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/bitrate_key_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:paddingEnd="8dp"
android:text="@string/track_info_bitrate" />
<TextView
android:id="@+id/bitrate_value_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="7"
android:text="@string/label_placeholder" />
</LinearLayout>
<View
style="@style/Divider"
android:layout_gravity="center_vertical"
android:layout_marginVertical="8dp" />
<LinearLayout
android:id="@+id/path_info_sector"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/path_key_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:paddingEnd="8dp"
android:text="@string/track_info_path" />
<TextView
android:id="@+id/path_value_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="7"
android:text="@string/label_placeholder" />
</LinearLayout>
<View
style="@style/Divider"
android:layout_gravity="center_vertical"
android:layout_marginVertical="8dp" />
<LinearLayout
android:id="@+id/disc_number_info_sector"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/disc_number_key_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:paddingEnd="8dp"
android:text="@string/track_info_disc_number" />
<TextView
android:id="@+id/disc_number_value_sector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="7"
android:text="@string/label_placeholder" />
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View file

@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/player_media_quality_sector"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -24,48 +24,38 @@
android:checked="true"
android:clickable="false"
android:text="Unknown"
app:chipStrokeWidth="0dp" />
app:chipStrokeWidth="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/player_media_bitrate"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintHorizontal_chainStyle="packed"/>
<TextView
android:id="@+id/player_media_bitrate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:visibility="gone" />
app:layout_constraintTop_toTopOf="@id/player_media_extension"
app:layout_constraintBottom_toBottomOf="@id/player_media_extension"
app:layout_constraintStart_toEndOf="@id/player_media_extension"
app:layout_constraintEnd_toEndOf="parent"/>
<ImageView
android:id="@+id/player_media_transcoding_audio"
android:layout_width="24dp"
android:layout_height="20dp"
android:layout_margin="12dp"
android:src="@drawable/ic_transcode"
android:visibility="gone" />
<ImageView
android:id="@+id/player_media_server_transcode_priority"
android:layout_width="24dp"
android:layout_height="20dp"
android:src="@drawable/ic_server_transcode_priority"
android:visibility="gone" />
<com.google.android.material.chip.Chip
android:id="@+id/player_media_transcoded_extension"
style="@style/Widget.Material3.Chip.Suggestion"
<ImageButton
android:id="@+id/player_info_track"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:clickable="false"
android:text="Unknown"
android:visibility="gone"
app:chipStrokeWidth="0dp" />
android:padding="16dp"
android:layout_marginEnd="8dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:scaleType="fitCenter"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/player_media_extension"
app:layout_constraintBottom_toBottomOf="@id/player_media_extension"
app:srcCompat="@drawable/ic_info_stream"
app:tint="?attr/colorOnPrimaryContainer" />
<TextView
android:id="@+id/player_media_transcoded_bitrate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:visibility="gone" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/player_media_cover_view_pager"