resultpage UI update and readded trailers

This commit is contained in:
reduplicated 2022-11-01 18:01:29 +01:00
parent f268418190
commit 28b4456dfd
14 changed files with 1009 additions and 914 deletions

View file

@ -176,7 +176,9 @@ dependencies {
implementation("com.jaredrummler:colorpicker:1.1.0") implementation("com.jaredrummler:colorpicker:1.1.0")
//run JS //run JS
implementation("org.mozilla:rhino:1.7.14") // do not upgrade to 1.7.14, since in 1.7.14 Rhino uses the `SourceVersion` class, which is not
// available on Android (even when using desugaring), and `NoClassDefFoundError` is thrown
implementation("org.mozilla:rhino:1.7.13")
// TorrentStream // TorrentStream
//implementation("com.github.TorrentStream:TorrentStream-Android:2.7.0") //implementation("com.github.TorrentStream:TorrentStream-Android:2.7.0")
@ -211,9 +213,9 @@ dependencies {
// slow af yt // slow af yt
//implementation("com.github.HaarigerHarald:android-youtubeExtractor:master-SNAPSHOT") //implementation("com.github.HaarigerHarald:android-youtubeExtractor:master-SNAPSHOT")
// newpipe yt // newpipe yt taken from https://github.com/TeamNewPipe/NewPipe/blob/dev/app/build.gradle#L190
implementation("com.github.TeamNewPipe:NewPipeExtractor:dev-SNAPSHOT") implementation("com.github.TeamNewPipe:NewPipeExtractor:9ffdd0948b2ecd82655f5ff2a3e127b2b7695d5b")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5") coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.6")
// Library/extensions searching with Levenshtein distance // Library/extensions searching with Levenshtein distance
implementation("me.xdrop:fuzzywuzzy:1.4.0") implementation("me.xdrop:fuzzywuzzy:1.4.0")

View file

@ -46,6 +46,7 @@ open class YoutubeExtractor : ExtractorApi() {
subtitleCallback: (SubtitleFile) -> Unit, subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
) { ) {
println("TRYING TO ExTRACT: $url")
if (ytVideos[url].isNullOrEmpty()) { if (ytVideos[url].isNullOrEmpty()) {
val link = val link =
YoutubeStreamLinkHandlerFactory.getInstance().fromUrl( YoutubeStreamLinkHandlerFactory.getInstance().fromUrl(

View file

@ -23,6 +23,7 @@ import androidx.lifecycle.ViewModelProvider
import androidx.preference.PreferenceManager import androidx.preference.PreferenceManager
import com.discord.panels.OverlappingPanelsLayout import com.discord.panels.OverlappingPanelsLayout
import com.google.android.material.chip.Chip import com.google.android.material.chip.Chip
import com.google.android.material.chip.ChipDrawable
import com.lagradost.cloudstream3.APIHolder.getApiDubstatusSettings import com.lagradost.cloudstream3.APIHolder.getApiDubstatusSettings
import com.lagradost.cloudstream3.APIHolder.getApiFromNameNull import com.lagradost.cloudstream3.APIHolder.getApiFromNameNull
import com.lagradost.cloudstream3.APIHolder.updateHasTrailers import com.lagradost.cloudstream3.APIHolder.updateHasTrailers
@ -96,11 +97,10 @@ import kotlinx.android.synthetic.main.fragment_result.result_vpn
import kotlinx.android.synthetic.main.fragment_result_swipe.* import kotlinx.android.synthetic.main.fragment_result_swipe.*
import kotlinx.android.synthetic.main.fragment_result_tv.* import kotlinx.android.synthetic.main.fragment_result_tv.*
import kotlinx.android.synthetic.main.result_sync.* import kotlinx.android.synthetic.main.result_sync.*
import kotlinx.android.synthetic.main.trailer_custom_layout.*
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import com.google.android.material.chip.ChipDrawable
const val START_ACTION_RESUME_LATEST = 1 const val START_ACTION_RESUME_LATEST = 1
const val START_ACTION_LOAD_EP = 2 const val START_ACTION_LOAD_EP = 2
@ -839,6 +839,8 @@ open class ResultFragment : ResultTrailerPlayer() {
result_next_airing.setText(d.nextAiringEpisode) result_next_airing.setText(d.nextAiringEpisode)
result_next_airing_time.setText(d.nextAiringDate) result_next_airing_time.setText(d.nextAiringDate)
result_poster.setImage(d.posterImage) result_poster.setImage(d.posterImage)
result_poster_background.setImage(d.posterBackgroundImage)
//result_trailer_thumbnail.setImage(d.posterBackgroundImage, fadeIn = false)
if (d.posterImage != null && !isTrueTvSettings()) if (d.posterImage != null && !isTrueTvSettings())
result_poster_holder?.setOnClickListener { result_poster_holder?.setOnClickListener {

View file

@ -5,6 +5,9 @@ import android.graphics.Rect
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.animation.AlphaAnimation
import android.view.animation.Animation
import android.view.animation.DecelerateInterpolator
import android.widget.Toast import android.widget.Toast
import androidx.core.view.isGone import androidx.core.view.isGone
import androidx.core.view.isVisible import androidx.core.view.isVisible
@ -20,27 +23,33 @@ import com.lagradost.cloudstream3.APIHolder.updateHasTrailers
import com.lagradost.cloudstream3.mvvm.Some import com.lagradost.cloudstream3.mvvm.Some
import com.lagradost.cloudstream3.mvvm.logError import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.mvvm.observe import com.lagradost.cloudstream3.mvvm.observe
import com.lagradost.cloudstream3.ui.WatchType
import com.lagradost.cloudstream3.ui.player.CSPlayerEvent import com.lagradost.cloudstream3.ui.player.CSPlayerEvent
import com.lagradost.cloudstream3.ui.search.SearchAdapter import com.lagradost.cloudstream3.ui.search.SearchAdapter
import com.lagradost.cloudstream3.ui.search.SearchHelper import com.lagradost.cloudstream3.ui.search.SearchHelper
import com.lagradost.cloudstream3.utils.AppUtils.isCastApiAvailable import com.lagradost.cloudstream3.utils.AppUtils.isCastApiAvailable
import com.lagradost.cloudstream3.utils.AppUtils.openBrowser import com.lagradost.cloudstream3.utils.AppUtils.openBrowser
import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.SingleSelectionHelper
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showBottomDialog import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showBottomDialog
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showBottomDialogInstant import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showBottomDialogInstant
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showDialog import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showDialog
import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe
import com.lagradost.cloudstream3.utils.UIHelper.popCurrentPage import com.lagradost.cloudstream3.utils.UIHelper.popCurrentPage
import com.lagradost.cloudstream3.utils.UIHelper.popupMenuNoIcons
import com.lagradost.cloudstream3.utils.UIHelper.popupMenuNoIconsAndNoStringRes import com.lagradost.cloudstream3.utils.UIHelper.popupMenuNoIconsAndNoStringRes
import kotlinx.android.synthetic.main.fragment_result.* import kotlinx.android.synthetic.main.fragment_result.*
import kotlinx.android.synthetic.main.fragment_result.result_cast_items
import kotlinx.android.synthetic.main.fragment_result.result_episodes_text
import kotlinx.android.synthetic.main.fragment_result.result_resume_parent
import kotlinx.android.synthetic.main.fragment_result.result_scroll
import kotlinx.android.synthetic.main.fragment_result.result_smallscreen_holder
import kotlinx.android.synthetic.main.fragment_result_swipe.* import kotlinx.android.synthetic.main.fragment_result_swipe.*
import kotlinx.android.synthetic.main.fragment_result_swipe.result_back
import kotlinx.android.synthetic.main.fragment_result_tv.*
import kotlinx.android.synthetic.main.fragment_trailer.* import kotlinx.android.synthetic.main.fragment_trailer.*
import kotlinx.android.synthetic.main.result_recommendations.* import kotlinx.android.synthetic.main.result_recommendations.*
import kotlinx.android.synthetic.main.result_recommendations.result_recommendations
import kotlinx.android.synthetic.main.trailer_custom_layout.* import kotlinx.android.synthetic.main.trailer_custom_layout.*
class ResultFragmentPhone : ResultFragment() { class ResultFragmentPhone : ResultFragment() {
var currentTrailers: List<ExtractorLink> = emptyList() var currentTrailers: List<ExtractorLink> = emptyList()
var currentTrailerIndex = 0 var currentTrailerIndex = 0
@ -84,8 +93,36 @@ class ResultFragmentPhone : ResultFragment() {
} ?: run { } ?: run {
false false
} }
//result_trailer_thumbnail?.setImageBitmap(result_poster_background?.drawable?.toBitmap())
result_trailer_loading?.isVisible = isSuccess result_trailer_loading?.isVisible = isSuccess
result_smallscreen_holder?.isVisible = !isSuccess && !isFullScreenPlayer val turnVis = !isSuccess && !isFullScreenPlayer
result_smallscreen_holder?.isVisible = turnVis
result_poster_background_holder?.apply {
val fadeIn: Animation = AlphaAnimation(alpha, if (turnVis) 1.0f else 0.0f).apply {
interpolator = DecelerateInterpolator()
duration = 200
fillAfter = true
}
clearAnimation()
startAnimation(fadeIn)
}
//player_view?.apply {
//alpha = 0.0f
//ObjectAnimator.ofFloat(player_view, "alpha", 1f).apply {
// duration = 200
// start()
//}
//val fadeIn: Animation = AlphaAnimation(0.0f, 1f).apply {
// interpolator = DecelerateInterpolator()
// duration = 2000
// fillAfter = true
//}
//startAnimation(fadeIn)
// }
// We don't want the trailer to be focusable if it's not visible // We don't want the trailer to be focusable if it's not visible
result_smallscreen_holder?.descendantFocusability = if (isSuccess) { result_smallscreen_holder?.descendantFocusability = if (isSuccess) {
@ -301,7 +338,8 @@ class ResultFragmentPhone : ResultFragment() {
observe(viewModel.selectedSeason) { text -> observe(viewModel.selectedSeason) { text ->
result_season_button.setText(text) result_season_button.setText(text)
selectSeason = (if (text is Some.Success) text.value else null)?.asStringNull(result_season_button?.context) selectSeason =
(if (text is Some.Success) text.value else null)?.asStringNull(result_season_button?.context)
// If the season button is visible the result season button will be next focus down // If the season button is visible the result season button will be next focus down
if (result_season_button?.isVisible == true) if (result_season_button?.isVisible == true)
if (result_resume_parent?.isVisible == true) if (result_resume_parent?.isVisible == true)
@ -378,12 +416,16 @@ class ResultFragmentPhone : ResultFragment() {
r to (text?.asStringNull(ctx) ?: return@mapNotNull null) r to (text?.asStringNull(ctx) ?: return@mapNotNull null)
} }
activity?.showDialog(names.map { it.second },names.indexOfFirst { it.second == selectSeason },"",false,{}) { itemId-> activity?.showDialog(
names.map { it.second },
names.indexOfFirst { it.second == selectSeason },
"",
false,
{}) { itemId ->
viewModel.changeSeason(names[itemId].first) viewModel.changeSeason(names[itemId].first)
} }
//view.popupMenuNoIconsAndNoStringRes(names.mapIndexed { index, (_, name) -> //view.popupMenuNoIconsAndNoStringRes(names.mapIndexed { index, (_, name) ->
// index to name // index to name
//}) { //}) {

View file

@ -13,7 +13,9 @@ import com.lagradost.cloudstream3.R
import com.lagradost.cloudstream3.ui.player.SubtitleData import com.lagradost.cloudstream3.ui.player.SubtitleData
import com.lagradost.cloudstream3.utils.IOnBackPressed import com.lagradost.cloudstream3.utils.IOnBackPressed
import kotlinx.android.synthetic.main.fragment_result.* import kotlinx.android.synthetic.main.fragment_result.*
import kotlinx.android.synthetic.main.fragment_result.result_smallscreen_holder
import kotlinx.android.synthetic.main.fragment_result_swipe.* import kotlinx.android.synthetic.main.fragment_result_swipe.*
import kotlinx.android.synthetic.main.fragment_result_tv.*
import kotlinx.android.synthetic.main.fragment_trailer.* import kotlinx.android.synthetic.main.fragment_trailer.*
import kotlinx.android.synthetic.main.trailer_custom_layout.* import kotlinx.android.synthetic.main.trailer_custom_layout.*

View file

@ -88,6 +88,7 @@ data class ResultData(
var syncData: Map<String, String>, var syncData: Map<String, String>,
val posterImage: UiImage?, val posterImage: UiImage?,
val posterBackgroundImage: UiImage?,
val plotText: UiText, val plotText: UiText,
val apiName: UiText, val apiName: UiText,
val ratingText: UiText?, val ratingText: UiText?,
@ -170,6 +171,9 @@ fun LoadResponse.toResultData(repo: APIRepository): ResultData {
posterImage = img( posterImage = img(
posterUrl, posterHeaders posterUrl, posterHeaders
) ?: img(R.drawable.default_cover), ) ?: img(R.drawable.default_cover),
posterBackgroundImage = img(
backgroundPosterUrl ?: posterUrl, posterHeaders
) ?: img(R.drawable.default_cover),
titleText = txt(name), titleText = txt(name),
url = url, url = url,
tags = tags ?: emptyList(), tags = tags ?: emptyList(),

View file

@ -70,9 +70,9 @@ sealed class UiImage {
data class Drawable(@DrawableRes val resId: Int) : UiImage() data class Drawable(@DrawableRes val resId: Int) : UiImage()
} }
fun ImageView?.setImage(value: UiImage?) { fun ImageView?.setImage(value: UiImage?, fadeIn: Boolean = true) {
when (value) { when (value) {
is UiImage.Image -> setImageImage(value) is UiImage.Image -> setImageImage(value,fadeIn)
is UiImage.Drawable -> setImageDrawable(value) is UiImage.Drawable -> setImageDrawable(value)
null -> { null -> {
this?.isVisible = false this?.isVisible = false
@ -80,9 +80,9 @@ fun ImageView?.setImage(value: UiImage?) {
} }
} }
fun ImageView?.setImageImage(value: UiImage.Image) { fun ImageView?.setImageImage(value: UiImage.Image, fadeIn: Boolean = true) {
if (this == null) return if (this == null) return
this.isVisible = setImage(value.url, value.headers, value.errorDrawable) this.isVisible = setImage(value.url, value.headers, value.errorDrawable, fadeIn)
} }
fun ImageView?.setImageDrawable(value: UiImage.Drawable) { fun ImageView?.setImageDrawable(value: UiImage.Drawable) {

View file

@ -159,17 +159,20 @@ object UIHelper {
url: String?, url: String?,
headers: Map<String, String>? = null, headers: Map<String, String>? = null,
@DrawableRes @DrawableRes
errorImageDrawable: Int? = null errorImageDrawable: Int? = null,
fadeIn: Boolean = true
): Boolean { ): Boolean {
if (this == null || url.isNullOrBlank()) return false if (this == null || url.isNullOrBlank()) return false
return try { return try {
val builder = GlideApp.with(this) val builder = GlideApp.with(this)
.load(GlideUrl(url) { headers ?: emptyMap() }).transition( .load(GlideUrl(url) { headers ?: emptyMap() })
DrawableTransitionOptions.withCrossFade()
)
.skipMemoryCache(true) .skipMemoryCache(true)
.diskCacheStrategy(DiskCacheStrategy.ALL) .diskCacheStrategy(DiskCacheStrategy.ALL).let { req ->
if (fadeIn)
req.transition(DrawableTransitionOptions.withCrossFade())
else req
}
val res = if (errorImageDrawable != null) val res = if (errorImageDrawable != null)
builder.error(errorImageDrawable).into(this) builder.error(errorImageDrawable).into(this)

View file

@ -5,7 +5,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal" android:orientation="horizontal"
android:keepScreenOn="true"
android:id="@+id/player_background" android:id="@+id/player_background"
app:backgroundTint="@android:color/black" app:backgroundTint="@android:color/black"
android:background="@android:color/black" android:background="@android:color/black"

View file

@ -6,7 +6,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@android:color/black" android:background="@android:color/black"
android:keepScreenOn="true"
android:orientation="horizontal" android:orientation="horizontal"
android:screenOrientation="sensorLandscape" android:screenOrientation="sensorLandscape"
app:backgroundTint="@android:color/black" app:backgroundTint="@android:color/black"

View file

@ -3,9 +3,9 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/result_root" android:id="@+id/result_root"
style="@style/DarkFragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
style="@style/DarkFragment"
android:background="?attr/primaryBlackBackground" android:background="?attr/primaryBlackBackground"
android:clickable="true" android:clickable="true"
android:focusable="true"> android:focusable="true">
@ -122,9 +122,9 @@
android:id="@+id/result_finish_loading" android:id="@+id/result_finish_loading"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="gone" android:visibility="gone"
tools:visibility="visible" tools:visibility="visible">
android:orientation="vertical">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/result_scroll" android:id="@+id/result_scroll"
@ -139,18 +139,19 @@
android:background="?attr/primaryBlackBackground" android:background="?attr/primaryBlackBackground"
android:orientation="vertical"> android:orientation="vertical">
<!--
<com.facebook.shimmer.ShimmerFrameLayout <com.facebook.shimmer.ShimmerFrameLayout
tools:visibility="gone"
android:visibility="gone"
android:id="@+id/result_trailer_loading" android:id="@+id/result_trailer_loading"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone"
app:shimmer_auto_start="true" app:shimmer_auto_start="true"
app:shimmer_base_alpha="0.2" app:shimmer_base_alpha="0.2"
app:shimmer_duration="@integer/loading_time" app:shimmer_duration="@integer/loading_time"
app:shimmer_highlight_alpha="0.3"> app:shimmer_highlight_alpha="0.3"
tools:visibility="gone">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -159,22 +160,15 @@
android:orientation="vertical"> android:orientation="vertical">
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:background="@color/grayShimmer"
app:cardCornerRadius="@dimen/loading_radius"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="150dp" android:layout_height="150dp"
android:foreground="@drawable/outline_drawable" /> android:background="@color/grayShimmer"
android:foreground="@drawable/outline_drawable"
app:cardCornerRadius="@dimen/loading_radius" />
</LinearLayout> </LinearLayout>
</com.facebook.shimmer.ShimmerFrameLayout> </com.facebook.shimmer.ShimmerFrameLayout>
-->
<FrameLayout
android:descendantFocusability="blocksDescendants"
android:id="@+id/result_smallscreen_holder"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<include layout="@layout/fragment_trailer" />
</FrameLayout>
<!-- <!--
<FrameLayout <FrameLayout
@ -272,6 +266,36 @@
app:tint="?attr/textColor" /> app:tint="?attr/textColor" />
</LinearLayout> </LinearLayout>
</FrameLayout>--> </FrameLayout>-->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="200dp">
<FrameLayout
android:id="@+id/result_smallscreen_holder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
<include layout="@layout/fragment_trailer" />
</FrameLayout>
<FrameLayout
android:id="@+id/result_poster_background_holder"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/result_poster_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<View
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_gravity="bottom"
android:background="@drawable/background_shadow" />
</FrameLayout>
</FrameLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -281,6 +305,7 @@
android:paddingStart="@dimen/result_padding" android:paddingStart="@dimen/result_padding"
android:paddingEnd="@dimen/result_padding"> android:paddingEnd="@dimen/result_padding">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -289,10 +314,12 @@
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="visible"> android:visibility="visible">
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/result_poster_holder" android:id="@+id/result_poster_holder"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone"
app:cardCornerRadius="@dimen/rounded_image_radius"> app:cardCornerRadius="@dimen/rounded_image_radius">
<ImageView <ImageView
@ -312,7 +339,6 @@
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:layout_marginHorizontal="10dp"
android:id="@+id/result_title" android:id="@+id/result_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -324,7 +350,6 @@
tools:text="The Perfect Run The Perfect Run" /> tools:text="The Perfect Run The Perfect Run" />
<com.lagradost.cloudstream3.widget.FlowLayout <com.lagradost.cloudstream3.widget.FlowLayout
android:layout_marginHorizontal="10dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:itemSpacing="10dp"> app:itemSpacing="10dp">
@ -366,20 +391,19 @@
The focus outline now settles between the poster and text. The focus outline now settles between the poster and text.
--> -->
<FrameLayout <FrameLayout
android:layout_marginHorizontal="5dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<TextView <TextView
android:padding="5dp"
android:maxLength="1000"
android:ellipsize="end"
android:id="@+id/result_description" android:id="@+id/result_description"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end"
android:foreground="@drawable/outline_drawable" android:foreground="@drawable/outline_drawable"
android:maxLength="1000"
android:nextFocusUp="@id/result_back" android:nextFocusUp="@id/result_back"
android:nextFocusDown="@id/result_bookmark_button" android:nextFocusDown="@id/result_bookmark_button"
android:paddingTop="5dp"
android:textColor="?attr/textColor" android:textColor="?attr/textColor"
android:textSize="15sp" 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. " /> 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. " />
@ -389,6 +413,7 @@
android:layout_height="30dp" android:layout_height="30dp"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:src="@drawable/background_shadow" android:src="@drawable/background_shadow"
android:visibility="gone"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>
@ -431,23 +456,23 @@
tools:text="Cast: Joe Ligma" /> tools:text="Cast: Joe Ligma" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
tools:visibility="gone"
android:nextFocusUp="@id/result_bookmark_button"
android:nextFocusDown="@id/result_play_movie"
android:id="@+id/result_cast_items" android:id="@+id/result_cast_items"
android:layout_width="match_parent" android:layout_width="match_parent"
android:descendantFocusability="afterDescendants"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:descendantFocusability="afterDescendants"
android:fadingEdge="horizontal" android:fadingEdge="horizontal"
android:focusableInTouchMode="false"
android:focusable="false" android:focusable="false"
android:focusableInTouchMode="false"
android:nextFocusUp="@id/result_bookmark_button"
android:nextFocusDown="@id/result_play_movie"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingTop="5dp" android:paddingTop="5dp"
android:requiresFadingEdge="horizontal" android:requiresFadingEdge="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="2" tools:itemCount="2"
tools:listitem="@layout/cast_item" /> tools:listitem="@layout/cast_item"
tools:visibility="gone" />
<TextView <TextView
android:id="@+id/result_vpn" android:id="@+id/result_vpn"
@ -847,29 +872,29 @@
<!--TODO add next airing--> <!--TODO add next airing-->
<LinearLayout <LinearLayout
android:id="@+id/result_next_airing_holder" android:id="@+id/result_next_airing_holder"
android:layout_gravity="start"
android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:layout_gravity="start"
android:orientation="horizontal">
<TextView <TextView
android:gravity="center"
android:id="@+id/result_next_airing" android:id="@+id/result_next_airing"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center"
android:textColor="?attr/grayTextColor" android:textColor="?attr/grayTextColor"
android:textSize="17sp" android:textSize="17sp"
android:textStyle="normal" android:textStyle="normal"
tools:text="Episode 1022 will be released in" /> tools:text="Episode 1022 will be released in" />
<TextView <TextView
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:gravity="center"
android:id="@+id/result_next_airing_time" android:id="@+id/result_next_airing_time"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="?attr/textColor" android:textColor="?attr/textColor"
android:textSize="17sp" android:textSize="17sp"
android:textStyle="normal" android:textStyle="normal"
@ -917,9 +942,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="0dp" android:layout_marginTop="0dp"
android:clipToPadding="false" android:clipToPadding="false"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:descendantFocusability="afterDescendants" android:descendantFocusability="afterDescendants"
android:paddingBottom="100dp" android:paddingBottom="100dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/result_episode_both_tv" /> tools:listitem="@layout/result_episode_both_tv" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -6,7 +6,6 @@
android:layout_height="0dp" android:layout_height="0dp"
android:visibility="visible" android:visibility="visible"
android:orientation="horizontal" android:orientation="horizontal"
android:keepScreenOn="true"
android:id="@+id/player_background" android:id="@+id/player_background"
app:backgroundTint="@android:color/black" app:backgroundTint="@android:color/black"
android:background="@android:color/black" android:background="@android:color/black"

View file

@ -38,26 +38,41 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<View <!-- <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/player_gradient_tv" /> android:background="@drawable/player_gradient_tv" />
-->
<!--
<ImageView
android:id="@+id/result_trailer_thumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:scaleType="centerCrop" />-->
<View
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_gravity="bottom"
android:background="@drawable/background_shadow" />
<TextView <TextView
android:textSize="20sp"
android:textStyle="bold"
android:textColor="@android:color/white"
android:text="@string/trailer"
android:padding="10dp"
android:layout_gravity="start|bottom"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:layout_gravity="start|bottom"
android:padding="10dp"
android:text="@string/trailer"
android:textColor="@android:color/white"
android:textSize="20sp"
android:textStyle="bold" />
<ImageView <ImageView
android:layout_gravity="center"
android:src="@drawable/play_button"
android:layout_width="60dp" android:layout_width="60dp"
android:layout_height="60dp" /> android:layout_height="60dp"
android:layout_gravity="center"
android:src="@drawable/play_button" />
</FrameLayout> </FrameLayout>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
@ -67,54 +82,54 @@
<!--use for thinner app:trackThickness="3dp" com.google.android.material.progressindicator.CircularProgressIndicator--> <!--use for thinner app:trackThickness="3dp" com.google.android.material.progressindicator.CircularProgressIndicator-->
<ProgressBar <ProgressBar
app:layout_constraintBottom_toBottomOf="parent" android:id="@+id/player_buffering"
app:layout_constraintLeft_toLeftOf="parent" android:layout_width="wrap_content"
app:layout_constraintRight_toRightOf="parent" android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent" android:layout_gravity="center"
android:focusable="false"
android:clickable="false" android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false" android:focusableInTouchMode="false"
android:indeterminate="true" android:indeterminate="true"
android:visibility="gone" android:visibility="gone"
tools:visibility="visible"
android:id="@+id/player_buffering"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:layout_width="wrap_content" />
<!-- This nested layout is necessary because of buffering and clicking-->
<FrameLayout
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />
<!-- This nested layout is necessary because of buffering and clicking-->
<FrameLayout
android:id="@+id/player_pause_play_holder_holder"
android:layout_width="100dp" android:layout_width="100dp"
android:layout_height="100dp" android:layout_height="100dp"
android:id="@+id/player_pause_play_holder_holder"> app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<FrameLayout <FrameLayout
tools:ignore="uselessParent"
android:id="@+id/player_pause_play_holder" android:id="@+id/player_pause_play_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
tools:ignore="uselessParent">
<ImageView <ImageView
app:tint="@color/white"
android:id="@+id/player_pause_play" android:id="@+id/player_pause_play"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_gravity="center"
android:background="@drawable/video_tap_button"
android:nextFocusLeft="@id/exo_rew" android:nextFocusLeft="@id/exo_rew"
android:nextFocusRight="@id/exo_ffwd" android:nextFocusRight="@id/exo_ffwd"
android:nextFocusUp="@id/player_go_back" android:nextFocusUp="@id/player_go_back"
android:nextFocusDown="@id/player_lock" android:nextFocusDown="@id/player_lock"
android:layout_gravity="center"
android:src="@drawable/netflix_pause" android:src="@drawable/netflix_pause"
android:background="@drawable/video_tap_button" app:tint="@color/white"
android:layout_width="70dp"
android:layout_height="70dp"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
</FrameLayout> </FrameLayout>
</FrameLayout> </FrameLayout>
@ -135,12 +150,12 @@
android:id="@+id/player_rew_holder" android:id="@+id/player_rew_holder"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintWidth_percent="0.5"
android:layout_gravity="center_vertical|start" android:layout_gravity="center_vertical|start"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/player_ffwd_holder" app:layout_constraintRight_toLeftOf="@id/player_ffwd_holder"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_percent="0.5">
<TextView <TextView
android:id="@+id/exo_rew_text" android:id="@+id/exo_rew_text"
@ -169,21 +184,21 @@
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:scaleX="-1" android:scaleX="-1"
android:src="@drawable/netflix_skip_forward" android:src="@drawable/netflix_skip_forward"
app:tint="@color/white"
android:tintMode="src_in" android:tintMode="src_in"
app:tint="@color/white"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
android:id="@+id/player_ffwd_holder" android:id="@+id/player_ffwd_holder"
android:layout_width="0dp" android:layout_width="0dp"
app:layout_constraintWidth_percent="0.5"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end" android:layout_gravity="center_vertical|end"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/player_rew_holder" app:layout_constraintLeft_toRightOf="@id/player_rew_holder"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_percent="0.5">
<TextView <TextView
android:id="@+id/exo_ffwd_text" android:id="@+id/exo_ffwd_text"
@ -209,8 +224,8 @@
android:padding="10dp" android:padding="10dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:src="@drawable/netflix_skip_forward" android:src="@drawable/netflix_skip_forward"
app:tint="@color/white"
android:tintMode="src_in" android:tintMode="src_in"
app:tint="@color/white"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
</FrameLayout> </FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
@ -230,60 +245,60 @@
<ImageButton <ImageButton
android:id="@id/exo_prev" android:id="@id/exo_prev"
style="@style/ExoMediaButton.Previous" style="@style/ExoMediaButton.Previous"
app:tint="?attr/colorPrimaryDark"
android:tintMode="src_in" android:tintMode="src_in"
app:tint="?attr/colorPrimaryDark"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<ImageButton <ImageButton
android:id="@id/exo_repeat_toggle" android:id="@id/exo_repeat_toggle"
style="@style/ExoMediaButton" style="@style/ExoMediaButton"
app:tint="?attr/colorPrimaryDark"
android:tintMode="src_in" android:tintMode="src_in"
app:tint="?attr/colorPrimaryDark"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<ImageButton <ImageButton
android:id="@id/exo_next" android:id="@id/exo_next"
style="@style/ExoMediaButton.Next" style="@style/ExoMediaButton.Next"
app:tint="?attr/colorPrimaryDark"
android:tintMode="src_in" android:tintMode="src_in"
app:tint="?attr/colorPrimaryDark"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<ImageButton <ImageButton
android:id="@id/exo_vr" android:id="@id/exo_vr"
style="@style/ExoMediaButton.VR" style="@style/ExoMediaButton.VR"
app:tint="?attr/colorPrimaryDark"
android:tintMode="src_in" android:tintMode="src_in"
app:tint="?attr/colorPrimaryDark"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<ImageButton <ImageButton
android:id="@id/exo_play" android:id="@id/exo_play"
app:tint="?attr/colorPrimaryDark" android:layout_width="0dp"
android:tintMode="src_in"
tools:ignore="ContentDescription"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_width="0dp" /> android:tintMode="src_in"
app:tint="?attr/colorPrimaryDark"
tools:ignore="ContentDescription" />
<ImageButton <ImageButton
android:id="@id/exo_pause" android:id="@id/exo_pause"
app:tint="?attr/colorPrimaryDark" android:layout_width="0dp"
android:tintMode="src_in"
tools:ignore="ContentDescription"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_width="0dp" /> android:tintMode="src_in"
app:tint="?attr/colorPrimaryDark"
tools:ignore="ContentDescription" />
</LinearLayout> </LinearLayout>
<ImageView <ImageView
android:background="?android:attr/selectableItemBackgroundBorderless"
android:id="@+id/player_open_source" android:id="@+id/player_open_source"
app:tint="@color/white"
android:src="@drawable/ic_baseline_public_24"
android:layout_margin="20dp"
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_margin="20dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_baseline_public_24"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent"
app:tint="@color/white" />
<LinearLayout <LinearLayout
android:id="@+id/bottom_player_bar" android:id="@+id/bottom_player_bar"
@ -296,10 +311,10 @@
app:layout_constraintEnd_toEndOf="parent"> app:layout_constraintEnd_toEndOf="parent">
<LinearLayout <LinearLayout
android:layout_weight="1"
android:id="@+id/player_video_bar" android:id="@+id/player_video_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
@ -350,14 +365,14 @@
</LinearLayout> </LinearLayout>
<ImageView <ImageView
android:background="?android:attr/selectableItemBackgroundBorderless"
android:id="@+id/player_fullscreen" android:id="@+id/player_fullscreen"
app:tint="@color/white"
android:layout_gravity="center_vertical"
android:src="@drawable/baseline_fullscreen_24"
android:layout_marginEnd="20dp"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" /> android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="20dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:src="@drawable/baseline_fullscreen_24"
app:tint="@color/white" />
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
@ -397,14 +412,14 @@
style="@android:style/Widget.Material.ProgressBar.Horizontal" style="@android:style/Widget.Material.ProgressBar.Horizontal"
android:layout_width="4dp" android:layout_width="4dp"
android:layout_height="150dp" android:layout_height="150dp"
android:layout_centerInParent="true"
android:layout_gravity="end|center_vertical" android:layout_gravity="end|center_vertical"
android:layout_marginStart="40dp" android:layout_marginStart="40dp"
android:indeterminate="false" android:indeterminate="false"
android:max="100" android:max="100"
android:progress="100" android:progress="100"
android:progressDrawable="@drawable/progress_drawable_vertical" android:progressDrawable="@drawable/progress_drawable_vertical"
tools:progress="30" tools:progress="30" />
android:layout_centerInParent="true" />
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout

View file

@ -82,6 +82,8 @@
<item name="textColor">@color/chip_color_text</item> <item name="textColor">@color/chip_color_text</item>
<item name="android:textColor">@color/chip_color_text</item> <item name="android:textColor">@color/chip_color_text</item>
<item name="checkedIconTint">@color/chip_color_text</item> <item name="checkedIconTint">@color/chip_color_text</item>
<item name="fontFamily">@font/google_sans</item>
<item name="android:fontFamily">@font/google_sans</item>
</style> </style>
<style name="AmoledMode"> <style name="AmoledMode">