Created
February 6, 2023 11:12
-
-
Save ademirqueiroga/9a2acd6925b7dc83a0cab783154b5f2d to your computer and use it in GitHub Desktop.
AwesomeTransportControlGlue.onSecondaryActionPressed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun onSecondaryActionPressed(action: Action) { | |
val adapter = controlsRow.secondaryActionsAdapter as? ArrayObjectAdapter ?: return | |
if (action is PlaybackControlsRow.MultiAction) { | |
action.nextIndex() | |
notifyItemChanged(adapter, action) | |
} | |
when (action) { | |
shuffleAction -> { | |
playerAdapter.setShuffleAction(shuffleAction.index) | |
if (shuffleAction.index == PlaybackControlsRow.ShuffleAction.INDEX_ON) { | |
shuffledPositions.shuffle() | |
} | |
} | |
repeatAction -> playerAdapter.setRepeatAction(repeatAction.index) | |
thumbsUpAction -> currentMovie.let(LikedMovies::toggle) | |
myListAction -> currentMovie.let(MyList::toggle) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment