1
0
mirror of https://github.com/ultrasonic/ultrasonic synced 2025-02-16 19:50:35 +01:00

Formating / detekt

This commit is contained in:
tzugen 2022-04-05 21:56:13 +02:00
parent ba1a1c5538
commit 4c22c8b41b
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
3 changed files with 11 additions and 11 deletions

View File

@ -914,11 +914,10 @@ class PlayerFragment :
} }
) )
dragTouchHelper = ItemTouchHelper(object : ItemTouchHelper.SimpleCallback( val callback = object : ItemTouchHelper.SimpleCallback(
ItemTouchHelper.UP or ItemTouchHelper.DOWN, ItemTouchHelper.UP or ItemTouchHelper.DOWN,
ItemTouchHelper.LEFT or ItemTouchHelper.RIGHT ItemTouchHelper.LEFT or ItemTouchHelper.RIGHT
) { ) {
override fun onMove( override fun onMove(
recyclerView: RecyclerView, recyclerView: RecyclerView,
viewHolder: RecyclerView.ViewHolder, viewHolder: RecyclerView.ViewHolder,
@ -972,7 +971,8 @@ class PlayerFragment :
return false return false
} }
} }
)
dragTouchHelper = ItemTouchHelper(callback)
dragTouchHelper.attachToRecyclerView(playlistView) dragTouchHelper.attachToRecyclerView(playlistView)
} }

View File

@ -87,7 +87,7 @@ private const val SEARCH_QUERY_PREFIX = "androidx://media3-session/setMediaUri"
/** /**
* MediaBrowserService implementation for e.g. Android Auto * MediaBrowserService implementation for e.g. Android Auto
*/ */
@Suppress("TooManyFunctions", "LargeClass") @Suppress("TooManyFunctions", "LargeClass", "UnusedPrivateMember")
class AutoMediaBrowserCallback(var player: Player) : class AutoMediaBrowserCallback(var player: Player) :
MediaLibraryService.MediaLibrarySession.MediaLibrarySessionCallback, KoinComponent { MediaLibraryService.MediaLibrarySession.MediaLibrarySessionCallback, KoinComponent {
@ -161,7 +161,7 @@ class AutoMediaBrowserCallback(var player: Player) :
): ListenableFuture<LibraryResult<MediaItem>> { ): ListenableFuture<LibraryResult<MediaItem>> {
playFromMediaId(mediaId) playFromMediaId(mediaId)
// FIXME: // TODO:
// Create LRU Cache of MediaItems, fill it in the other calls // Create LRU Cache of MediaItems, fill it in the other calls
// and retrieve it here. // and retrieve it here.
return Futures.immediateFuture( return Futures.immediateFuture(

View File

@ -100,7 +100,7 @@ class MediaPlayerController(
} }
override fun onMediaItemTransition(mediaItem: MediaItem?, reason: Int) { override fun onMediaItemTransition(mediaItem: MediaItem?, reason: Int) {
onTrackCompleted(mediaItem) onTrackCompleted()
legacyPlaylistManager.updateCurrentPlaying(mediaItem) legacyPlaylistManager.updateCurrentPlaying(mediaItem)
publishPlaybackState() publishPlaybackState()
} }
@ -167,7 +167,7 @@ class MediaPlayerController(
Timber.d("Processed player state change") Timber.d("Processed player state change")
} }
private fun onTrackCompleted(mediaItem: MediaItem?) { private fun onTrackCompleted() {
// This method is called before we update the currentPlaying, // This method is called before we update the currentPlaying,
// so in fact currentPlaying will refer to the track that has just finished. // so in fact currentPlaying will refer to the track that has just finished.
if (legacyPlaylistManager.currentPlaying != null) { if (legacyPlaylistManager.currentPlaying != null) {
@ -196,10 +196,10 @@ class MediaPlayerController(
val started = playerState === PlayerState.STARTED val started = playerState === PlayerState.STARTED
val context = UApp.applicationContext() val context = UApp.applicationContext()
UltrasonicAppWidgetProvider4X1.getInstance().notifyChange(context, song, started, false) UltrasonicAppWidgetProvider4X1.instance?.notifyChange(context, song, started, false)
UltrasonicAppWidgetProvider4X2.getInstance().notifyChange(context, song, started, true) UltrasonicAppWidgetProvider4X2.instance?.notifyChange(context, song, started, true)
UltrasonicAppWidgetProvider4X3.getInstance().notifyChange(context, song, started, false) UltrasonicAppWidgetProvider4X3.instance?.notifyChange(context, song, started, false)
UltrasonicAppWidgetProvider4X4.getInstance().notifyChange(context, song, started, false) UltrasonicAppWidgetProvider4X4.instance?.notifyChange(context, song, started, false)
} }
fun onDestroy() { fun onDestroy() {