Use artwork display mode in demo app

- Use artwork display mode `fill` to improve visual apperance
- Some minor cleanup

#minor-release

PiperOrigin-RevId: 534366246
(cherry picked from commit 230921e4ab999f3f9af40688cedaf02631052a95)
This commit is contained in:
bachinger 2023-05-23 11:34:37 +01:00 committed by Tofunmi Adigun-Hameed
parent e8bcbd5249
commit f8ef386065
4 changed files with 3 additions and 5 deletions

View File

@ -88,8 +88,7 @@ class PlayableFolderActivity : AppCompatActivity() {
browser.shuffleModeEnabled = true browser.shuffleModeEnabled = true
browser.prepare() browser.prepare()
browser.play() browser.play()
val intent = Intent(this, PlayerActivity::class.java) browser?.sessionActivity?.send()
startActivity(intent)
} }
findViewById<Button>(R.id.play_button).setOnClickListener { findViewById<Button>(R.id.play_button).setOnClickListener {

View File

@ -298,8 +298,6 @@ class PlaybackService : MediaLibraryService() {
val pendingIntent = val pendingIntent =
TaskStackBuilder.create(this@PlaybackService).run { TaskStackBuilder.create(this@PlaybackService).run {
addNextIntent(Intent(this@PlaybackService, MainActivity::class.java)) addNextIntent(Intent(this@PlaybackService, MainActivity::class.java))
val immutableFlag = if (Build.VERSION.SDK_INT >= 23) FLAG_IMMUTABLE else 0
getPendingIntent(0, immutableFlag or FLAG_UPDATE_CURRENT) getPendingIntent(0, immutableFlag or FLAG_UPDATE_CURRENT)
} }
val builder = val builder =

View File

@ -122,7 +122,7 @@ class PlayerActivity : AppCompatActivity() {
} }
private fun updateMediaMetadataUI(mediaMetadata: MediaMetadata) { private fun updateMediaMetadataUI(mediaMetadata: MediaMetadata) {
val title: CharSequence = mediaMetadata.title ?: "getString(R.string.no_item_prompt)" val title: CharSequence = mediaMetadata.title ?: ""
findViewById<TextView>(R.id.media_title).text = title findViewById<TextView>(R.id.media_title).text = title
findViewById<TextView>(R.id.media_artist).text = mediaMetadata.artist findViewById<TextView>(R.id.media_artist).text = mediaMetadata.artist

View File

@ -31,6 +31,7 @@
android:background="@color/player_background" android:background="@color/player_background"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:artwork_display_mode="fill"
app:default_artwork="@drawable/artwork_placeholder" app:default_artwork="@drawable/artwork_placeholder"
app:repeat_toggle_modes="one|all" app:repeat_toggle_modes="one|all"
app:show_shuffle_button="true" app:show_shuffle_button="true"