-
-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4556 from Isira-Seneviratne/Enum_serializable
refactor: Simplify player event handling
- Loading branch information
Showing
4 changed files
with
32 additions
and
24 deletions.
There are no files selected for viewing
21 changes: 8 additions & 13 deletions
21
app/src/main/java/com/github/libretube/enums/PlayerEvent.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
package com.github.libretube.enums | ||
|
||
enum class PlayerEvent(val value: Int) { | ||
Pause(0), | ||
Play(1), | ||
Forward(2), | ||
Rewind(3), | ||
Next(5), | ||
Prev(6), | ||
Background(7) | ||
; | ||
|
||
companion object { | ||
fun fromInt(value: Int) = PlayerEvent.values().first { it.value == value } | ||
} | ||
enum class PlayerEvent { | ||
Pause, | ||
Play, | ||
Forward, | ||
Rewind, | ||
Next, | ||
Prev, | ||
Background | ||
} |
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
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
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