fix: related streams are not visible in landscape layout

This commit is contained in:
Bnyro 2023-11-09 14:43:09 +01:00
parent d5241c97a5
commit 3ca65b1091
2 changed files with 6 additions and 3 deletions

View File

@ -596,7 +596,8 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
binding.relatedRecView.layoutManager = LinearLayoutManager(
context,
LinearLayoutManager.HORIZONTAL,
if (resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT)
LinearLayoutManager.HORIZONTAL else LinearLayoutManager.VERTICAL,
false
)
@ -1021,7 +1022,9 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
if (PlayerHelper.relatedStreamsEnabled) {
binding.relatedRecView.adapter = VideosAdapter(
streams.relatedStreams.filter { !it.title.isNullOrBlank() }.toMutableList(),
forceMode = VideosAdapter.Companion.ForceMode.RELATED
forceMode = if (
resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT
) VideosAdapter.Companion.ForceMode.RELATED else VideosAdapter.Companion.ForceMode.TRENDING
)
}

View File

@ -185,7 +185,7 @@
<RelativeLayout
android:id="@+id/related_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:descendantFocusability="blocksDescendants"
app:layout_constraintTop_toTopOf="parent"