mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-01-28 16:09:33 +01:00
Merge remote-tracking branch 'upstream/media3-flat' into media3-flat
This commit is contained in:
commit
1c7c4839b3
@ -422,9 +422,9 @@ class PlayerFragment :
|
|||||||
|
|
||||||
private fun updateShuffleButtonState(isEnabled: Boolean) {
|
private fun updateShuffleButtonState(isEnabled: Boolean) {
|
||||||
if (isEnabled) {
|
if (isEnabled) {
|
||||||
shuffleButton.alpha = 1f
|
shuffleButton.alpha = ALPHA_ACTIVATED
|
||||||
} else {
|
} else {
|
||||||
shuffleButton.alpha = 0.3f
|
shuffleButton.alpha = ALPHA_DEACTIVATED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -436,7 +436,7 @@ class PlayerFragment :
|
|||||||
requireContext(), R.attr.media_repeat_off
|
requireContext(), R.attr.media_repeat_off
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
repeatButton.alpha = 0.3f
|
repeatButton.alpha = ALPHA_DEACTIVATED
|
||||||
}
|
}
|
||||||
1 -> {
|
1 -> {
|
||||||
repeatButton.setImageDrawable(
|
repeatButton.setImageDrawable(
|
||||||
@ -444,7 +444,7 @@ class PlayerFragment :
|
|||||||
requireContext(), R.attr.media_repeat_single
|
requireContext(), R.attr.media_repeat_single
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
repeatButton.alpha = 1f
|
repeatButton.alpha = ALPHA_ACTIVATED
|
||||||
}
|
}
|
||||||
2 -> {
|
2 -> {
|
||||||
repeatButton.setImageDrawable(
|
repeatButton.setImageDrawable(
|
||||||
@ -452,7 +452,7 @@ class PlayerFragment :
|
|||||||
requireContext(), R.attr.media_repeat_all
|
requireContext(), R.attr.media_repeat_all
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
repeatButton.alpha = 1f
|
repeatButton.alpha = ALPHA_ACTIVATED
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
}
|
}
|
||||||
@ -954,7 +954,7 @@ class PlayerFragment :
|
|||||||
super.onSelectedChanged(viewHolder, actionState)
|
super.onSelectedChanged(viewHolder, actionState)
|
||||||
|
|
||||||
if (actionState == ACTION_STATE_DRAG) {
|
if (actionState == ACTION_STATE_DRAG) {
|
||||||
viewHolder?.itemView?.alpha = 0.6f
|
viewHolder?.itemView?.alpha = ALPHA_DEACTIVATED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1256,5 +1256,7 @@ class PlayerFragment :
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val PERCENTAGE_OF_SCREEN_FOR_SWIPE = 5
|
private const val PERCENTAGE_OF_SCREEN_FOR_SWIPE = 5
|
||||||
|
private const val ALPHA_ACTIVATED = 1f
|
||||||
|
private const val ALPHA_DEACTIVATED = 0.4f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -289,7 +289,7 @@ class MediaPlayerController(
|
|||||||
@Synchronized
|
@Synchronized
|
||||||
fun togglePlayPause() {
|
fun togglePlayPause() {
|
||||||
if (playbackState == Player.STATE_IDLE) autoPlayStart = true
|
if (playbackState == Player.STATE_IDLE) autoPlayStart = true
|
||||||
if (controller?.isPlaying == false) {
|
if (controller?.isPlaying == true) {
|
||||||
controller?.pause()
|
controller?.pause()
|
||||||
} else {
|
} else {
|
||||||
controller?.play()
|
controller?.play()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user