From 28b4456dfd6e808553a7bbffbd06c8ef4e6dfc9a Mon Sep 17 00:00:00 2001 From: reduplicated <110570621+reduplicated@users.noreply.github.com> Date: Tue, 1 Nov 2022 18:01:29 +0100 Subject: [PATCH] resultpage UI update and readded trailers --- app/build.gradle.kts | 10 +- .../extractors/YoutubeExtractor.kt | 1 + .../cloudstream3/ui/result/ResultFragment.kt | 6 +- .../ui/result/ResultFragmentPhone.kt | 66 +- .../ui/result/ResultTrailerPlayer.kt | 2 + .../ui/result/ResultViewModel2.kt | 4 + .../cloudstream3/ui/result/UiText.kt | 8 +- .../lagradost/cloudstream3/utils/UIHelper.kt | 15 +- app/src/main/res/layout/fragment_player.xml | 1 - .../main/res/layout/fragment_player_tv.xml | 1 - app/src/main/res/layout/fragment_result.xml | 1125 +++++++++-------- app/src/main/res/layout/fragment_trailer.xml | 1 - .../main/res/layout/trailer_custom_layout.xml | 681 +++++----- app/src/main/res/values/styles.xml | 2 + 14 files changed, 1009 insertions(+), 914 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 42ca93fd..2f31f1c2 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -176,7 +176,9 @@ dependencies { implementation("com.jaredrummler:colorpicker:1.1.0") //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 //implementation("com.github.TorrentStream:TorrentStream-Android:2.7.0") @@ -211,9 +213,9 @@ dependencies { // slow af yt //implementation("com.github.HaarigerHarald:android-youtubeExtractor:master-SNAPSHOT") - // newpipe yt - implementation("com.github.TeamNewPipe:NewPipeExtractor:dev-SNAPSHOT") - coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5") + // newpipe yt taken from https://github.com/TeamNewPipe/NewPipe/blob/dev/app/build.gradle#L190 + implementation("com.github.TeamNewPipe:NewPipeExtractor:9ffdd0948b2ecd82655f5ff2a3e127b2b7695d5b") + coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.6") // Library/extensions searching with Levenshtein distance implementation("me.xdrop:fuzzywuzzy:1.4.0") diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/YoutubeExtractor.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/YoutubeExtractor.kt index 23704e90..572d93a3 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/extractors/YoutubeExtractor.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/YoutubeExtractor.kt @@ -46,6 +46,7 @@ open class YoutubeExtractor : ExtractorApi() { subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit ) { + println("TRYING TO ExTRACT: $url") if (ytVideos[url].isNullOrEmpty()) { val link = YoutubeStreamLinkHandlerFactory.getInstance().fromUrl( diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragment.kt index db71b714..26dbb03e 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragment.kt @@ -23,6 +23,7 @@ import androidx.lifecycle.ViewModelProvider import androidx.preference.PreferenceManager import com.discord.panels.OverlappingPanelsLayout 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.getApiFromNameNull 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_tv.* import kotlinx.android.synthetic.main.result_sync.* +import kotlinx.android.synthetic.main.trailer_custom_layout.* import kotlinx.coroutines.delay import kotlinx.coroutines.runBlocking -import com.google.android.material.chip.ChipDrawable - const val START_ACTION_RESUME_LATEST = 1 const val START_ACTION_LOAD_EP = 2 @@ -839,6 +839,8 @@ open class ResultFragment : ResultTrailerPlayer() { result_next_airing.setText(d.nextAiringEpisode) result_next_airing_time.setText(d.nextAiringDate) result_poster.setImage(d.posterImage) + result_poster_background.setImage(d.posterBackgroundImage) + //result_trailer_thumbnail.setImage(d.posterBackgroundImage, fadeIn = false) if (d.posterImage != null && !isTrueTvSettings()) result_poster_holder?.setOnClickListener { diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragmentPhone.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragmentPhone.kt index 813872c9..9bae8753 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragmentPhone.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragmentPhone.kt @@ -5,6 +5,9 @@ import android.graphics.Rect import android.os.Bundle import android.view.View import android.view.ViewGroup +import android.view.animation.AlphaAnimation +import android.view.animation.Animation +import android.view.animation.DecelerateInterpolator import android.widget.Toast import androidx.core.view.isGone 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.logError import com.lagradost.cloudstream3.mvvm.observe -import com.lagradost.cloudstream3.ui.WatchType import com.lagradost.cloudstream3.ui.player.CSPlayerEvent import com.lagradost.cloudstream3.ui.search.SearchAdapter import com.lagradost.cloudstream3.ui.search.SearchHelper import com.lagradost.cloudstream3.utils.AppUtils.isCastApiAvailable import com.lagradost.cloudstream3.utils.AppUtils.openBrowser 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.showBottomDialogInstant import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showDialog import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe import com.lagradost.cloudstream3.utils.UIHelper.popCurrentPage -import com.lagradost.cloudstream3.utils.UIHelper.popupMenuNoIcons import com.lagradost.cloudstream3.utils.UIHelper.popupMenuNoIconsAndNoStringRes 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.result_back +import kotlinx.android.synthetic.main.fragment_result_tv.* import kotlinx.android.synthetic.main.fragment_trailer.* import kotlinx.android.synthetic.main.result_recommendations.* +import kotlinx.android.synthetic.main.result_recommendations.result_recommendations import kotlinx.android.synthetic.main.trailer_custom_layout.* + class ResultFragmentPhone : ResultFragment() { var currentTrailers: List = emptyList() var currentTrailerIndex = 0 @@ -84,8 +93,36 @@ class ResultFragmentPhone : ResultFragment() { } ?: run { false } + //result_trailer_thumbnail?.setImageBitmap(result_poster_background?.drawable?.toBitmap()) + + 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 result_smallscreen_holder?.descendantFocusability = if (isSuccess) { @@ -129,7 +166,7 @@ class ResultFragmentPhone : ResultFragment() { down.nextFocusUpId = upper.id } - var selectSeason : String? = null + var selectSeason: String? = null override fun onViewCreated(view: View, savedInstanceState: Bundle?) { val apiName = arguments?.getString(API_NAME_BUNDLE) ?: return @@ -301,13 +338,14 @@ class ResultFragmentPhone : ResultFragment() { observe(viewModel.selectedSeason) { 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 (result_season_button?.isVisible == true) if (result_resume_parent?.isVisible == true) setFocusUpAndDown(result_resume_series_button, result_season_button) - //else - // setFocusUpAndDown(result_bookmark_button, result_season_button) + //else + // setFocusUpAndDown(result_bookmark_button, result_season_button) } observe(viewModel.selectedDubStatus) { status -> @@ -317,8 +355,8 @@ class ResultFragmentPhone : ResultFragment() { if (result_season_button?.isVisible != true && result_episode_select?.isVisible != true) { if (result_resume_parent?.isVisible == true) setFocusUpAndDown(result_resume_series_button, result_dub_select) - //else - // setFocusUpAndDown(result_bookmark_button, result_dub_select) + //else + // setFocusUpAndDown(result_bookmark_button, result_dub_select) } } observe(viewModel.selectedRange) { range -> @@ -378,12 +416,16 @@ class ResultFragmentPhone : ResultFragment() { 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) } - //view.popupMenuNoIconsAndNoStringRes(names.mapIndexed { index, (_, name) -> // index to name //}) { diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultTrailerPlayer.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultTrailerPlayer.kt index 26c9249d..8a6e5b37 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultTrailerPlayer.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultTrailerPlayer.kt @@ -13,7 +13,9 @@ import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.ui.player.SubtitleData import com.lagradost.cloudstream3.utils.IOnBackPressed 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_tv.* import kotlinx.android.synthetic.main.fragment_trailer.* import kotlinx.android.synthetic.main.trailer_custom_layout.* diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultViewModel2.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultViewModel2.kt index f424989e..6b04ebf9 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultViewModel2.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultViewModel2.kt @@ -88,6 +88,7 @@ data class ResultData( var syncData: Map, val posterImage: UiImage?, + val posterBackgroundImage: UiImage?, val plotText: UiText, val apiName: UiText, val ratingText: UiText?, @@ -170,6 +171,9 @@ fun LoadResponse.toResultData(repo: APIRepository): ResultData { posterImage = img( posterUrl, posterHeaders ) ?: img(R.drawable.default_cover), + posterBackgroundImage = img( + backgroundPosterUrl ?: posterUrl, posterHeaders + ) ?: img(R.drawable.default_cover), titleText = txt(name), url = url, tags = tags ?: emptyList(), diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/result/UiText.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/result/UiText.kt index 0ca232e1..81ef8d57 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/result/UiText.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/result/UiText.kt @@ -70,9 +70,9 @@ sealed class UiImage { data class Drawable(@DrawableRes val resId: Int) : UiImage() } -fun ImageView?.setImage(value: UiImage?) { +fun ImageView?.setImage(value: UiImage?, fadeIn: Boolean = true) { when (value) { - is UiImage.Image -> setImageImage(value) + is UiImage.Image -> setImageImage(value,fadeIn) is UiImage.Drawable -> setImageDrawable(value) null -> { 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 - 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) { 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 ab49492a..20d6d03e 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/UIHelper.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/UIHelper.kt @@ -136,7 +136,7 @@ object UIHelper { navigation, arguments ) } - } catch (t : Throwable) { + } catch (t: Throwable) { logError(t) } } @@ -159,17 +159,20 @@ object UIHelper { url: String?, headers: Map? = null, @DrawableRes - errorImageDrawable: Int? = null + errorImageDrawable: Int? = null, + fadeIn: Boolean = true ): Boolean { if (this == null || url.isNullOrBlank()) return false return try { val builder = GlideApp.with(this) - .load(GlideUrl(url) { headers ?: emptyMap() }).transition( - DrawableTransitionOptions.withCrossFade() - ) + .load(GlideUrl(url) { headers ?: emptyMap() }) .skipMemoryCache(true) - .diskCacheStrategy(DiskCacheStrategy.ALL) + .diskCacheStrategy(DiskCacheStrategy.ALL).let { req -> + if (fadeIn) + req.transition(DrawableTransitionOptions.withCrossFade()) + else req + } val res = if (errorImageDrawable != null) builder.error(errorImageDrawable).into(this) diff --git a/app/src/main/res/layout/fragment_player.xml b/app/src/main/res/layout/fragment_player.xml index c3660a58..232dcaa0 100644 --- a/app/src/main/res/layout/fragment_player.xml +++ b/app/src/main/res/layout/fragment_player.xml @@ -5,7 +5,6 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" - android:keepScreenOn="true" android:id="@+id/player_background" app:backgroundTint="@android:color/black" android:background="@android:color/black" diff --git a/app/src/main/res/layout/fragment_player_tv.xml b/app/src/main/res/layout/fragment_player_tv.xml index b84aaf7d..fec649a8 100644 --- a/app/src/main/res/layout/fragment_player_tv.xml +++ b/app/src/main/res/layout/fragment_player_tv.xml @@ -6,7 +6,6 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/black" - android:keepScreenOn="true" android:orientation="horizontal" android:screenOrientation="sensorLandscape" app:backgroundTint="@android:color/black" diff --git a/app/src/main/res/layout/fragment_result.xml b/app/src/main/res/layout/fragment_result.xml index ceab8f94..ed2ec6bd 100644 --- a/app/src/main/res/layout/fragment_result.xml +++ b/app/src/main/res/layout/fragment_result.xml @@ -1,47 +1,47 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/result_root" + style="@style/DarkFragment" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="?attr/primaryBlackBackground" + android:clickable="true" + android:focusable="true"> + android:id="@+id/result_loading" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center" + android:orientation="vertical" + app:shimmer_auto_start="true" + app:shimmer_base_alpha="0.2" + app:shimmer_duration="@integer/loading_time" + app:shimmer_highlight_alpha="0.3" + tools:visibility="gone"> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/result_padding" + android:orientation="vertical"> + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginBottom="@dimen/loading_margin" + android:orientation="horizontal"> + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginStart="@dimen/loading_margin" + android:layout_marginEnd="@dimen/loading_margin" + android:orientation="vertical"> @@ -56,9 +56,9 @@ + android:layout_width="match_parent" + android:layout_height="20dp" + tools:ignore="ContentDescription" /> @@ -75,106 +75,100 @@ android:layout_width="50dp" android:layout_height="50dp"> --> + + + + + + - - - - - - + android:layout_margin="5dp" + android:gravity="center" + android:textColor="?attr/textColor" /> + android:id="@+id/result_finish_loading" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:visibility="gone" + tools:visibility="visible"> + android:layout_height="wrap_content" + android:background="?attr/primaryGrayBackground"> + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="?attr/primaryBlackBackground" + android:orientation="vertical"> + - - - - + - + + + + + + android:scaleType="centerCrop" /> + + + + + + + + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="10dp" + android:layout_marginBottom="15dp" + android:orientation="horizontal" + android:visibility="visible"> + + android:id="@+id/result_poster_holder" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:visibility="gone" + app:cardCornerRadius="@dimen/rounded_image_radius"> + android:layout_width="100dp" + android:layout_height="140dp" + android:contentDescription="@string/result_poster_img_des" + android:foreground="@drawable/outline_drawable" + android:scaleType="centerCrop" + tools:src="@drawable/example_poster" /> + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + android:id="@+id/result_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="5dp" + android:maxLines="2" + android:textColor="?attr/textColor" + android:textSize="20sp" + android:textStyle="bold" + tools:text="The Perfect Run The Perfect Run" /> + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:itemSpacing="10dp"> + android:id="@+id/result_meta_site" + style="@style/SmallBlackButton" + android:layout_gravity="center_vertical" + tools:text="Gogoanime" /> + android:id="@+id/result_meta_type" + style="@style/ResultInfoText" + tools:text="Movie" /> + android:id="@+id/result_meta_year" + style="@style/ResultInfoText" + tools:text="2022" /> + android:id="@+id/result_meta_rating" + style="@style/ResultInfoText" + tools:text="Rated: 8.5/10.0" /> + android:id="@+id/result_meta_status" + style="@style/ResultInfoText" + tools:text="Ongoing" /> + android:id="@+id/result_meta_duration" + style="@style/ResultInfoText" + tools:text="121min" /> + android:layout_width="match_parent" + android:layout_height="match_parent"> + android:id="@+id/result_description" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:ellipsize="end" + android:foreground="@drawable/outline_drawable" + android:maxLength="1000" + android:nextFocusUp="@id/result_back" + android:nextFocusDown="@id/result_bookmark_button" + android:paddingTop="5dp" + 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_width="match_parent" + android:layout_height="30dp" + android:layout_gravity="bottom" + android:src="@drawable/background_shadow" + android:visibility="gone" + tools:ignore="ContentDescription" /> - + android:nextFocusDown="@id/result_cast_items" + android:paddingTop="0dp" + app:cornerRadius="4dp" + app:icon="@drawable/ic_baseline_bookmark_24" + tools:text="Bookmark" + tools:visibility="visible" /> + --> + android:id="@+id/result_cast_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="5dp" + android:ellipsize="end" + android:maxLines="2" + android:textColor="?attr/grayTextColor" + android:textSize="15sp" + tools:text="Cast: Joe Ligma" /> + android:descendantFocusability="afterDescendants" + android:fadingEdge="horizontal" + android:focusable="false" + android:focusableInTouchMode="false" + android:nextFocusUp="@id/result_bookmark_button" + android:nextFocusDown="@id/result_play_movie" + android:orientation="horizontal" + android:paddingTop="5dp" + android:requiresFadingEdge="horizontal" + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" + tools:itemCount="2" + tools:listitem="@layout/cast_item" + tools:visibility="gone" /> + android:id="@+id/result_vpn" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textColor="?attr/grayTextColor" + android:textSize="15sp" + tools:text="@string/vpn_torrent" /> + android:id="@+id/result_info" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="5dp" + android:textColor="?attr/grayTextColor" + android:textSize="15sp" + tools:text="@string/provider_info_meta" /> + android:id="@+id/result_no_episodes" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="5dp" + android:textColor="?attr/grayTextColor" + android:textSize="15sp" + tools:text="@string/no_episodes_found" /> + android:id="@+id/result_tag_holder" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="10dp" + android:layout_marginBottom="10dp" + android:text="@string/result_tags" + android:textColor="?attr/textColor" + android:textSize="17sp" + android:textStyle="normal" + android:visibility="gone" /> --> + android:id="@+id/result_coming_soon" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:gravity="center" + android:paddingTop="50dp" + android:text="@string/coming_soon" + android:textColor="?attr/textColor" + android:textSize="20sp" + android:textStyle="bold" + android:visibility="gone" /> + android:id="@+id/result_data_holder" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + android:layout_marginBottom="10dp" + android:text="@string/add_sync" + android:visibility="gone" + app:icon="@drawable/ic_baseline_add_24" /> + android:id="@+id/result_movie_parent" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="5dp" + android:orientation="vertical" + tools:visibility="visible"> + android:layout_gravity="center_vertical" + android:layout_marginStart="0dp" + android:layout_marginEnd="0dp" + android:layout_marginBottom="10dp" + android:nextFocusUp="@id/result_bookmark_button" + android:nextFocusDown="@id/result_download_movie" + android:text="@string/play_movie_button" + android:visibility="visible" + app:icon="@drawable/ic_baseline_play_arrow_24"> @@ -574,85 +599,85 @@ android:layout_width="match_parent" />--> + android:id="@+id/result_movie_progress_downloaded_holder" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + android:nextFocusUp="@id/result_play_movie" + android:nextFocusDown="@id/result_season_button" + android:visibility="visible" /> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:gravity="center" + android:orientation="horizontal"> + android:id="@+id/result_movie_progress_downloaded" + style="?android:attr/progressBarStyleHorizontal" + android:layout_width="25dp" + android:layout_height="25dp" + android:layout_gravity="end|center_vertical" + android:layout_margin="5dp" + android:background="@drawable/circle_shape" + android:indeterminate="false" + android:max="100" + android:paddingStart="5dp" + android:paddingEnd="5dp" + android:progress="30" + android:progressDrawable="@drawable/circular_progress_bar_filled" + android:visibility="visible" /> + android:id="@+id/result_movie_download_icon" + android:layout_width="30dp" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:background="?selectableItemBackgroundBorderless" + android:contentDescription="@string/download" + android:src="@drawable/ic_baseline_play_arrow_24" + android:visibility="visible" + app:tint="?attr/white" /> + android:id="@+id/result_movie_download_text" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:gravity="center" + android:letterSpacing="0.09" + android:textAllCaps="false" + android:textColor="?attr/textColor" + android:textSize="15sp" + android:textStyle="bold" + tools:text="Downloading" /> + android:id="@+id/result_movie_download_text_precentage" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:gravity="center" + android:letterSpacing="0.09" + android:paddingStart="5dp" + android:paddingEnd="5dp" + android:textAllCaps="false" + android:textColor="?attr/textColor" + android:textSize="15sp" + android:textStyle="bold" + android:visibility="gone" + tools:text="68%" /> @@ -682,217 +707,217 @@ + + + + + - - - - - + app:icon="@drawable/cast_ic_mini_controller_skip_next" /> + android:id="@+id/result_resume_series_title" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textColor="?attr/textColor" + android:textSize="17sp" + android:textStyle="bold" + tools:text="S1E1 Episode 1" /> + android:id="@+id/result_resume_progress_holder" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:paddingTop="10dp" + android:visibility="gone" + tools:visibility="visible"> + android:id="@+id/result_resume_series_progress" + style="?android:attr/progressBarStyleHorizontal" + android:layout_width="match_parent" + android:layout_height="20dp" + android:layout_gravity="end|center_vertical" + android:layout_weight="1" + android:indeterminate="false" + android:max="100" + android:progress="0" + android:progressBackgroundTint="?attr/colorPrimary" + android:visibility="visible" + tools:progress="50" + tools:visibility="visible" /> + android:id="@+id/result_resume_series_progress_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_weight="0" + android:gravity="center" + android:paddingStart="10dp" + android:textColor="?attr/grayTextColor" + tools:ignore="RtlSymmetry" + tools:text="69m\nremaining" /> + android:id="@+id/result_episodes_tab" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="10dp" + android:gravity="center_vertical" + android:orientation="horizontal"> + android:id="@+id/result_season_button" + style="@style/MultiSelectButton" + android:layout_gravity="center_vertical" + android:layout_marginStart="0dp" + android:layout_marginEnd="10dp" + android:nextFocusLeft="@id/result_episode_select" + android:nextFocusRight="@id/result_episode_select" + android:nextFocusUp="@id/result_description" + android:nextFocusDown="@id/result_episodes" + android:visibility="gone" + tools:text="Season 1" + tools:visibility="visible" /> + android:nextFocusUp="@id/result_description" + android:nextFocusDown="@id/result_episodes" + android:visibility="gone" + tools:text="50-100" + tools:visibility="visible" /> + android:nextFocusUp="@id/result_description" + android:nextFocusDown="@id/result_episodes" + android:visibility="gone" + tools:text="Dubbed" + tools:visibility="visible" /> + android:id="@+id/result_episodes_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:paddingTop="10dp" + android:paddingBottom="10dp" + android:textColor="?attr/textColor" + android:textSize="17sp" + android:textStyle="normal" + tools:text="8 Episodes" /> + android:id="@+id/result_next_airing_holder" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="start" + android:orientation="horizontal"> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center" + android:textColor="?attr/grayTextColor" + android:textSize="17sp" + android:textStyle="normal" + tools:text="Episode 1022 will be released in" /> + android:id="@+id/result_next_airing_time" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center" + android:paddingStart="5dp" + android:paddingEnd="5dp" + android:textColor="?attr/textColor" + android:textSize="17sp" + android:textStyle="normal" + tools:text="5d 3h 30m" /> + android:id="@+id/result_episode_loading" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center" + android:layout_marginTop="15dp" + android:orientation="vertical" + app:shimmer_auto_start="true" + app:shimmer_base_alpha="0.2" + app:shimmer_duration="@integer/loading_time" + app:shimmer_highlight_alpha="0.3" + tools:visibility="visible"> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> @@ -912,15 +937,15 @@ android:layout_height="50dp" />--> + android:id="@+id/result_episodes" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="0dp" + android:clipToPadding="false" + android:descendantFocusability="afterDescendants" + android:paddingBottom="100dp" + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" + tools:listitem="@layout/result_episode_both_tv" /> diff --git a/app/src/main/res/layout/fragment_trailer.xml b/app/src/main/res/layout/fragment_trailer.xml index 64633483..fd348760 100644 --- a/app/src/main/res/layout/fragment_trailer.xml +++ b/app/src/main/res/layout/fragment_trailer.xml @@ -6,7 +6,6 @@ android:layout_height="0dp" android:visibility="visible" android:orientation="horizontal" - android:keepScreenOn="true" android:id="@+id/player_background" app:backgroundTint="@android:color/black" android:background="@android:color/black" diff --git a/app/src/main/res/layout/trailer_custom_layout.xml b/app/src/main/res/layout/trailer_custom_layout.xml index 22137a1c..854855ef 100644 --- a/app/src/main/res/layout/trailer_custom_layout.xml +++ b/app/src/main/res/layout/trailer_custom_layout.xml @@ -1,452 +1,467 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/player_holder" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:screenOrientation="landscape" + tools:orientation="vertical"> + android:id="@+id/player_time_text" + android:layout_width="match_parent" + android:layout_height="200dp" + android:gravity="center" + android:shadowColor="@android:color/black" + android:shadowRadius="10.0" + android:textColor="@android:color/white" + android:textSize="30sp" + tools:text="+100" /> + android:id="@+id/subtitle_holder" + android:layout_width="match_parent" + android:layout_height="match_parent"> + android:id="@+id/shadow_overlay" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/black_overlay" /> + + + + + android:layout_width="match_parent" + android:layout_height="60dp" + android:layout_gravity="bottom" + android:background="@drawable/background_shadow" /> + android:layout_width="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" /> + android:layout_width="60dp" + android:layout_height="60dp" + android:layout_gravity="center" + android:src="@drawable/play_button" /> + android:id="@+id/player_video_holder" + android:layout_width="match_parent" + android:layout_height="match_parent"> + android:indeterminate="true" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:visibility="visible" /> + android:id="@+id/player_pause_play_holder_holder" + android:layout_width="100dp" + android:layout_height="100dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent"> + android:id="@+id/player_pause_play_holder" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:ignore="uselessParent"> + android:src="@drawable/netflix_pause" + app:tint="@color/white" + tools:ignore="ContentDescription" /> + android:id="@+id/player_center_menu" + android:layout_width="match_parent" + android:layout_height="100dp" + android:layout_gravity="center" + android:gravity="center" + android:orientation="horizontal" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent"> + android:id="@+id/player_rew_holder" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical|start" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toLeftOf="@id/player_ffwd_holder" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintWidth_percent="0.5"> + android:textStyle="bold" + tools:text="10" /> + android:background="@drawable/video_tap_button_skip" + android:nextFocusLeft="@id/exo_rew" + android:nextFocusUp="@id/player_go_back" + android:nextFocusDown="@id/player_lock" + android:padding="10dp" + android:scaleType="fitCenter" + android:scaleX="-1" + android:src="@drawable/netflix_skip_forward" + android:tintMode="src_in" + app:tint="@color/white" + tools:ignore="ContentDescription" /> + android:id="@+id/player_ffwd_holder" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical|end" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toRightOf="@id/player_rew_holder" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintWidth_percent="0.5"> + android:id="@+id/exo_ffwd_text" + android:layout_width="200dp" + android:layout_height="40dp" + android:layout_gravity="center" + android:gravity="center" + android:textColor="@color/white" + android:textSize="19sp" + android:textStyle="bold" + tools:text="10" /> + android:background="@drawable/video_tap_button_skip" + android:nextFocusRight="@id/exo_rew" + android:nextFocusUp="@id/player_go_back" + android:nextFocusDown="@id/player_lock" + android:padding="10dp" + android:scaleType="fitCenter" + android:src="@drawable/netflix_skip_forward" + android:tintMode="src_in" + app:tint="@color/white" + tools:ignore="ContentDescription" /> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:layout_marginBottom="20dp" + android:gravity="center" + android:orientation="horizontal" + android:paddingTop="4dp" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent"> + android:id="@id/exo_prev" + style="@style/ExoMediaButton.Previous" + android:tintMode="src_in" + app:tint="?attr/colorPrimaryDark" + tools:ignore="ContentDescription" /> + android:id="@id/exo_repeat_toggle" + style="@style/ExoMediaButton" + android:tintMode="src_in" + app:tint="?attr/colorPrimaryDark" + tools:ignore="ContentDescription" /> + android:id="@id/exo_next" + style="@style/ExoMediaButton.Next" + android:tintMode="src_in" + app:tint="?attr/colorPrimaryDark" + tools:ignore="ContentDescription" /> + android:id="@id/exo_vr" + style="@style/ExoMediaButton.VR" + android:tintMode="src_in" + app:tint="?attr/colorPrimaryDark" + tools:ignore="ContentDescription" /> + android:id="@id/exo_play" + android:layout_width="0dp" + android:layout_height="0dp" + android:tintMode="src_in" + app:tint="?attr/colorPrimaryDark" + tools:ignore="ContentDescription" /> + android:id="@id/exo_pause" + android:layout_width="0dp" + android:layout_height="0dp" + android:tintMode="src_in" + app:tint="?attr/colorPrimaryDark" + tools:ignore="ContentDescription" /> + android:id="@+id/player_open_source" + android:layout_width="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_constraintTop_toTopOf="parent" + app:tint="@color/white" /> + android:id="@+id/bottom_player_bar" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="10dp" + android:gravity="center_vertical" + android:orientation="horizontal" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent"> + android:id="@+id/player_video_bar" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="horizontal"> + android:id="@id/exo_position" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginStart="20dp" + android:gravity="end" + android:includeFontPadding="false" + android:minWidth="50dp" + android:paddingLeft="4dp" + android:paddingRight="4dp" + android:textColor="@android:color/white" + android:textSize="14sp" + android:textStyle="normal" + tools:text="15:30" /> + app:scrubber_color="?attr/colorPrimary" + app:scrubber_dragged_size="26dp" + app:scrubber_enabled_size="24dp" + app:unplayed_color="@color/videoProgress" /> + android:id="@id/exo_duration" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginEnd="20dp" + android:includeFontPadding="false" + android:minWidth="50dp" + android:paddingLeft="4dp" + android:paddingRight="4dp" + android:textColor="@android:color/white" + android:textSize="14sp" + android:textStyle="normal" + tools:text="23:20" /> + android:id="@+id/player_fullscreen" + android:layout_width="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" /> + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="horizontal"> + android:id="@+id/player_progressbar_left_holder" + android:layout_width="100dp" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:gravity="start" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toLeftOf="@+id/centerMenuView" + app:layout_constraintTop_toTopOf="parent" + tools:alpha="1" + tools:visibility="visible"> + android:id="@+id/player_progressbar_left_icon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_marginBottom="220dp" + android:src="@drawable/ic_baseline_volume_up_24" + app:tint="@android:color/white" + tools:ignore="ContentDescription"> + android:id="@+id/player_progressbar_left" + style="@android:style/Widget.Material.ProgressBar.Horizontal" + android:layout_width="4dp" + android:layout_height="150dp" + android:layout_centerInParent="true" + android:layout_gravity="end|center_vertical" + android:layout_marginStart="40dp" + android:indeterminate="false" + android:max="100" + android:progress="100" + android:progressDrawable="@drawable/progress_drawable_vertical" + tools:progress="30" /> + android:id="@+id/player_progressbar_right_holder" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:gravity="right" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toRightOf="@+id/centerMenuView" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:alpha="1" + tools:ignore="RtlHardcoded" + tools:visibility="visible"> + android:id="@+id/player_progressbar_right_icon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_marginBottom="220dp" + android:src="@drawable/ic_baseline_brightness_7_24" + app:tint="@android:color/white" + tools:ignore="ContentDescription"> + android:id="@+id/player_progressbar_right" + style="@android:style/Widget.Material.ProgressBar.Horizontal" + android:layout_width="4dp" + android:layout_height="150dp" + android:layout_centerHorizontal="true" + android:layout_centerVertical="true" + android:layout_gravity="end|center_vertical" + android:layout_marginEnd="40dp" + android:indeterminate="false" + android:max="100" + android:progress="100" + android:progressDrawable="@drawable/progress_drawable_vertical" /> diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index f0bb2214..13089cc2 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -82,6 +82,8 @@ @color/chip_color_text @color/chip_color_text @color/chip_color_text + @font/google_sans + @font/google_sans