[Android] Fix the playlist fragment background color on large screens
Nicolas Pomepuy
git at videolan.org
Thu Dec 23 09:45:07 UTC 2021
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Fri Oct 29 12:03:45 2021 +0200| [4e9bc45ab404a8e5db542b42a87857a0097005aa] | committer: Nicolas Pomepuy
Fix the playlist fragment background color on large screens
> https://code.videolan.org/videolan/vlc-android/commit/4e9bc45ab404a8e5db542b42a87857a0097005aa
---
application/vlc-android/src/org/videolan/vlc/gui/PlaylistFragment.kt | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/PlaylistFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/PlaylistFragment.kt
index 33088c10c..74dc79166 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/PlaylistFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/PlaylistFragment.kt
@@ -22,10 +22,13 @@
package org.videolan.vlc.gui
import android.content.Intent
+import android.content.res.Resources
import android.os.Bundle
+import android.util.TypedValue
import android.view.*
import androidx.appcompat.view.ActionMode
import androidx.coordinatorlayout.widget.CoordinatorLayout
+import androidx.core.content.ContextCompat
import androidx.paging.PagedList
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
@@ -186,6 +189,8 @@ class PlaylistFragment : BaseAudioBrowser<PlaylistsViewModel>(), SwipeRefreshLay
lp.width = if (viewModel.providerInCard) ViewGroup.LayoutParams.MATCH_PARENT else {
dimension.toInt()
}
+ (playlists.parent as View).setBackgroundColor(if (!viewModel.providerInCard && dimension != -1F) backgroundColor else ContextCompat.getColor(requireContext(), R.color.transparent))
+ playlists.setBackgroundColor(if (!viewModel.providerInCard && dimension != -1F) listColor else ContextCompat.getColor(requireContext(), R.color.transparent))
}
override fun onClick(v: View, position: Int, item: MediaLibraryItem) {
More information about the Android
mailing list