mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
testing tv UI, NOT FINISHED
This commit is contained in:
parent
5aa9019d6d
commit
35084389a1
5 changed files with 870 additions and 640 deletions
|
@ -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)
|
||||
|
|
|
@ -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<Drawable> {
|
||||
builder = builder.listener(object : RequestListener<Drawable> {
|
||||
@SuppressLint("CheckResult")
|
||||
override fun onResourceReady(
|
||||
resource: Drawable?,
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?><!--style="@style/SelectableButton"-->
|
||||
|
||||
<com.google.android.material.button.MaterialButton xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
style="@style/SelectableButton"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
tools:text="Season 1" />
|
||||
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" />
|
|
@ -723,6 +723,11 @@
|
|||
<item name="strokeColor">@color/tag_stroke_color</item>
|
||||
</style>
|
||||
|
||||
<style name="ResultButtonTV" parent="@style/RegularButtonTV">
|
||||
<item name="android:layout_width">250dp</item>
|
||||
<item name="android:layout_marginBottom">5dp</item>
|
||||
</style>
|
||||
|
||||
<style name="RegularButtonTV">
|
||||
<item name="android:stateListAnimator">@null</item>
|
||||
<item name="strokeColor">@color/transparent</item>
|
||||
|
@ -734,15 +739,15 @@
|
|||
<item name="iconTint">@color/player_on_button_tv</item>
|
||||
<item name="textColor">@color/player_on_button_tv</item>
|
||||
<item name="android:textColor">@color/player_on_button_tv</item>
|
||||
<item name="android:layout_width">200dp</item>
|
||||
<item name="android:layout_height">30dp</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">40dp</item>
|
||||
<item name="iconSize">16dp</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:layout_gravity">center</item>
|
||||
<item name="android:baselineAligned">false</item>
|
||||
<item name="textAllCaps">false</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textSize">10sp</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="android:layout_marginStart">4dp</item>
|
||||
<item name="android:layout_marginEnd">4dp</item>
|
||||
<item name="android:insetBottom">0dp</item>
|
||||
|
|
Loading…
Reference in a new issue