diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragmentTv.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragmentTv.kt index dbc7194a..8c350d83 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragmentTv.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragmentTv.kt @@ -44,6 +44,7 @@ import com.lagradost.cloudstream3.utils.UIHelper.hideKeyboard import com.lagradost.cloudstream3.utils.UIHelper.navigate import com.lagradost.cloudstream3.utils.UIHelper.popCurrentPage import com.lagradost.cloudstream3.utils.UIHelper.setImage +import com.lagradost.cloudstream3.utils.UIHelper.setImageBlur import kotlinx.coroutines.delay class ResultFragmentTv : Fragment() { @@ -192,7 +193,7 @@ class ResultFragmentTv : Fragment() { binding?.apply { resultEpisodes.layoutManager = LinearListLayout(resultEpisodes.context).apply { - setHorizontal() + setVertical() } resultReloadConnectionerror.setOnClickListener { @@ -222,9 +223,9 @@ class ResultFragmentTv : Fragment() { // Always escape focus if (hasFocus) binding?.resultBookmarkButton?.requestFocus() } - resultBack.setOnClickListener { - activity?.popCurrentPage() - } + //resultBack.setOnClickListener { + // activity?.popCurrentPage() + //} resultRecommendationsList.spanCount = 8 resultRecommendationsList.adapter = @@ -581,6 +582,8 @@ class ResultFragmentTv : Fragment() { } } + backgroundPoster.setImage(d.posterBackgroundImage, radius = 10) + resultComingSoon.isVisible = d.comingSoon resultDataHolder.isGone = d.comingSoon UIHelper.populateChips(resultTag, d.tags) diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/UIHelper.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/UIHelper.kt index bd81b960..eb2067d6 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/UIHelper.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/UIHelper.kt @@ -260,6 +260,8 @@ object UIHelper { @DrawableRes errorImageDrawable: Int? = null, fadeIn: Boolean = true, + radius: Int = 0, + sample: Int = 3, colorCallback: ((Palette) -> Unit)? = null ): Boolean { if (url.isNullOrBlank()) return false @@ -267,6 +269,8 @@ object UIHelper { UiImage.Image(url, headers, errorImageDrawable), errorImageDrawable, fadeIn, + radius, + sample, colorCallback ) return true @@ -277,7 +281,9 @@ object UIHelper { @DrawableRes errorImageDrawable: Int? = null, fadeIn: Boolean = true, - colorCallback: ((Palette) -> Unit)? = null + radius: Int = 0, + sample: Int = 3, + colorCallback: ((Palette) -> Unit)? = null, ): Boolean { if (this == null || uiImage == null) return false @@ -289,7 +295,7 @@ object UIHelper { } ?: return false return try { - val builder = GlideApp.with(this) + var builder = GlideApp.with(this) .load(glideImage) .skipMemoryCache(true) .diskCacheStrategy(DiskCacheStrategy.ALL).let { req -> @@ -298,8 +304,12 @@ object UIHelper { else req } + if(radius > 0) { + builder = builder.apply(bitmapTransform(BlurTransformation(radius, sample))) + } + if (colorCallback != null) { - builder.listener(object : RequestListener { + builder = builder.listener(object : RequestListener { @SuppressLint("CheckResult") override fun onResourceReady( resource: Drawable?, diff --git a/app/src/main/res/layout/fragment_result_tv.xml b/app/src/main/res/layout/fragment_result_tv.xml index 77e89288..3165125d 100644 --- a/app/src/main/res/layout/fragment_result_tv.xml +++ b/app/src/main/res/layout/fragment_result_tv.xml @@ -1,4 +1,16 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + android:layout_height="wrap_content"> - + android:layout_height="match_parent" + android:clipToPadding="false" + android:orientation="vertical" + android:paddingStart="@dimen/result_padding" + android:paddingEnd="@dimen/result_padding" + android:visibility="gone"> - - - - - - - - + android:layout_height="wrap_content" + android:layout_marginTop="10dp" + android:layout_marginBottom="15dp" + android:orientation="horizontal" + android:visibility="visible"> + android:orientation="vertical"> + android:layout_width="wrap_content" + android:layout_height="30dp" + android:layout_marginBottom="10dp" + android:orientation="horizontal"> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:orientation="horizontal"> + + +--> + + + + - - - - + android:ellipsize="end" + android:fadingEdgeLength="30dp" + android:foreground="@drawable/outline_drawable" + android:maxLines="7" + android:nextFocusUp="@id/result_back" + android:nextFocusDown="@id/result_bookmark_button" + android:padding="5dp" + android:requiresFadingEdge="vertical" + android:textColor="?attr/textColor" + android:textSize="15sp" + tools:text="Ryan Quicksave Romano is an eccentric adventurer with a strange power: he can create a save-point in time and redo his life whenever he dies. Arriving in New Rome, the glitzy capital of sin of a rebuilding Europe, he finds the city torn between mega-corporations, sponsored heroes, superpowered criminals, and true monsters. It's a time of chaos, where potions can grant the power to rule the world and dangers lurk everywhere. " /> + --> + + + + + + + + + + + + + + + + + + + + + - android:layout_height="wrap_content" - android:background="?attr/primaryBlackBackground" - android:clipToPadding="false" - android:descendantFocusability="afterDescendants" - android:nextFocusUp="@id/result_recommendations_filter_selection" - android:orientation="vertical" - app:spanCount="8" - tools:listitem="@layout/search_result_grid" /> - - - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/result_selection.xml b/app/src/main/res/layout/result_selection.xml index fe880dc9..d30b9949 100644 --- a/app/src/main/res/layout/result_selection.xml +++ b/app/src/main/res/layout/result_selection.xml @@ -1,7 +1,9 @@ - + + \ No newline at end of file + xmlns:tools="http://schemas.android.com/tools" + style="@style/RegularButtonTV" + android:layout_gravity="start" + android:layout_marginStart="0dp" + android:layout_marginEnd="10dp" + tools:text="Season 1" /> \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index c54ca485..818d22aa 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -723,6 +723,11 @@ @color/tag_stroke_color + +