mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 06:10:31 +05:30
feat: elevate miniplayer background color for better distinguishability
This commit is contained in:
parent
2874254496
commit
82513909d0
@ -51,6 +51,7 @@ import com.github.libretube.ui.sheets.PlayingQueueSheet
|
||||
import com.github.libretube.ui.sheets.VideoOptionsBottomSheet
|
||||
import com.github.libretube.util.DataSaverMode
|
||||
import com.github.libretube.util.PlayingQueue
|
||||
import com.google.android.material.elevation.SurfaceColors
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlin.math.abs
|
||||
|
||||
@ -238,6 +239,9 @@ class AudioPlayerFragment : Fragment(), AudioPlayerOptions {
|
||||
mainActivity.binding.container.isVisible = true
|
||||
val mainMotionLayout = mainActivity.binding.mainMotionLayout
|
||||
|
||||
val surfaceColor = SurfaceColors.getColorForElevation(requireContext(), 3f)
|
||||
binding.audioPlayerContainer.setBackgroundColor(surfaceColor)
|
||||
|
||||
binding.playerMotionLayout.addTransitionListener(object : TransitionAdapter() {
|
||||
override fun onTransitionChange(
|
||||
motionLayout: MotionLayout?,
|
||||
|
@ -94,7 +94,6 @@ import com.github.libretube.obj.PlayerNotificationData
|
||||
import com.github.libretube.obj.ShareData
|
||||
import com.github.libretube.obj.VideoResolution
|
||||
import com.github.libretube.parcelable.PlayerData
|
||||
import com.github.libretube.services.DownloadService
|
||||
import com.github.libretube.ui.activities.MainActivity
|
||||
import com.github.libretube.ui.activities.VideoTagsAdapter
|
||||
import com.github.libretube.ui.adapters.VideosAdapter
|
||||
@ -120,6 +119,7 @@ import com.github.libretube.util.TextUtils
|
||||
import com.github.libretube.util.TextUtils.toTimeInSeconds
|
||||
import com.github.libretube.util.YoutubeHlsPlaylistParser
|
||||
import com.github.libretube.util.deArrow
|
||||
import com.google.android.material.elevation.SurfaceColors
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
@ -312,6 +312,10 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
||||
mainActivity.binding.container.isVisible = true
|
||||
val mainMotionLayout = mainActivity.binding.mainMotionLayout
|
||||
|
||||
// add some elevation to the color to make it easier to distinguish
|
||||
val surfaceColor = SurfaceColors.getColorForElevation(requireContext(), 3f)
|
||||
binding.mainContainer.setBackgroundColor(surfaceColor)
|
||||
|
||||
binding.playerMotionLayout.addTransitionListener(object : TransitionAdapter() {
|
||||
override fun onTransitionChange(
|
||||
motionLayout: MotionLayout?,
|
||||
|
Loading…
Reference in New Issue
Block a user