mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Use artwork display mode in demo app
- Use artwork display mode `fill` to improve visual apperance - Some minor cleanup #minor-release PiperOrigin-RevId: 534366246
This commit is contained in:
parent
b762ca993e
commit
230921e4ab
@ -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 {
|
||||||
|
@ -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 =
|
||||||
|
@ -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
|
||||||
|
@ -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"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user