Merge remote-tracking branch 'origin/master'

This commit is contained in:
Blatzar 2022-11-01 23:29:41 +01:00
commit b57a7c3772
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) {
@ -129,7 +166,7 @@ class ResultFragmentPhone : ResultFragment() {
down.nextFocusUpId = upper.id down.nextFocusUpId = upper.id
} }
var selectSeason : String? = null var selectSeason: String? = null
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
val apiName = arguments?.getString(API_NAME_BUNDLE) ?: return val apiName = arguments?.getString(API_NAME_BUNDLE) ?: return
@ -301,13 +338,14 @@ 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)
setFocusUpAndDown(result_resume_series_button, result_season_button) setFocusUpAndDown(result_resume_series_button, result_season_button)
//else //else
// setFocusUpAndDown(result_bookmark_button, result_season_button) // setFocusUpAndDown(result_bookmark_button, result_season_button)
} }
observe(viewModel.selectedDubStatus) { status -> observe(viewModel.selectedDubStatus) { status ->
@ -317,8 +355,8 @@ class ResultFragmentPhone : ResultFragment() {
if (result_season_button?.isVisible != true && result_episode_select?.isVisible != true) { if (result_season_button?.isVisible != true && result_episode_select?.isVisible != true) {
if (result_resume_parent?.isVisible == true) if (result_resume_parent?.isVisible == true)
setFocusUpAndDown(result_resume_series_button, result_dub_select) setFocusUpAndDown(result_resume_series_button, result_dub_select)
//else //else
// setFocusUpAndDown(result_bookmark_button, result_dub_select) // setFocusUpAndDown(result_bookmark_button, result_dub_select)
} }
} }
observe(viewModel.selectedRange) { range -> observe(viewModel.selectedRange) { range ->
@ -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

@ -136,7 +136,7 @@ object UIHelper {
navigation, arguments navigation, arguments
) )
} }
} catch (t : Throwable) { } catch (t: Throwable) {
logError(t) logError(t)
} }
} }
@ -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"

File diff suppressed because it is too large Load Diff

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

@ -1,452 +1,467 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
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/player_holder" android:id="@+id/player_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:screenOrientation="landscape" android:screenOrientation="landscape"
tools:orientation="vertical"> tools:orientation="vertical">
<TextView <TextView
android:id="@+id/player_time_text" android:id="@+id/player_time_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="200dp" android:layout_height="200dp"
android:gravity="center" android:gravity="center"
android:shadowColor="@android:color/black" android:shadowColor="@android:color/black"
android:shadowRadius="10.0" android:shadowRadius="10.0"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="30sp" android:textSize="30sp"
tools:text="+100" /> tools:text="+100" />
<FrameLayout <FrameLayout
android:id="@+id/subtitle_holder" android:id="@+id/subtitle_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<View <View
android:id="@+id/shadow_overlay" android:id="@+id/shadow_overlay"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/black_overlay" /> android:background="@color/black_overlay" />
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
android:id="@+id/player_intro_play" android:id="@+id/player_intro_play"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- <View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/player_gradient_tv" />
-->
<!--
<ImageView
android:id="@+id/result_trailer_thumbnail"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:layout_gravity="center"
android:scaleType="centerCrop" />-->
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="60dp"
android:background="@drawable/player_gradient_tv" /> android:layout_gravity="bottom"
android:background="@drawable/background_shadow" />
<TextView <TextView
android:textSize="20sp" android:layout_width="wrap_content"
android:textStyle="bold" android:layout_height="wrap_content"
android:textColor="@android:color/white" android:layout_gravity="start|bottom"
android:text="@string/trailer" android:padding="10dp"
android:padding="10dp" android:text="@string/trailer"
android:layout_gravity="start|bottom" android:textColor="@android:color/white"
android:layout_width="wrap_content" android:textSize="20sp"
android:layout_height="wrap_content" /> android:textStyle="bold" />
<ImageView <ImageView
android:layout_gravity="center" android:layout_width="60dp"
android:src="@drawable/play_button" android:layout_height="60dp"
android:layout_width="60dp" android:layout_gravity="center"
android:layout_height="60dp" /> android:src="@drawable/play_button" />
</FrameLayout> </FrameLayout>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/player_video_holder" android:id="@+id/player_video_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<!--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" app:layout_constraintBottom_toBottomOf="parent"
android:id="@+id/player_buffering" app:layout_constraintLeft_toLeftOf="parent"
android:layout_gravity="center" app:layout_constraintRight_toRightOf="parent"
android:layout_height="wrap_content" app:layout_constraintTop_toTopOf="parent"
android:layout_width="wrap_content" /> tools:visibility="visible" />
<!-- This nested layout is necessary because of buffering and clicking--> <!-- This nested layout is necessary because of buffering and clicking-->
<FrameLayout <FrameLayout
app:layout_constraintBottom_toBottomOf="parent" android:id="@+id/player_pause_play_holder_holder"
app:layout_constraintLeft_toLeftOf="parent" android:layout_width="100dp"
app:layout_constraintRight_toRightOf="parent" android:layout_height="100dp"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent"
android:layout_width="100dp" app:layout_constraintLeft_toLeftOf="parent"
android:layout_height="100dp" app:layout_constraintRight_toRightOf="parent"
android:id="@+id/player_pause_play_holder_holder"> 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:nextFocusLeft="@id/exo_rew" android:layout_height="70dp"
android:nextFocusRight="@id/exo_ffwd" android:layout_gravity="center"
android:nextFocusUp="@id/player_go_back" android:background="@drawable/video_tap_button"
android:nextFocusDown="@id/player_lock" android:nextFocusLeft="@id/exo_rew"
android:layout_gravity="center" android:nextFocusRight="@id/exo_ffwd"
android:src="@drawable/netflix_pause" android:nextFocusUp="@id/player_go_back"
android:background="@drawable/video_tap_button" android:nextFocusDown="@id/player_lock"
android:layout_width="70dp" android:src="@drawable/netflix_pause"
android:layout_height="70dp" app:tint="@color/white"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
</FrameLayout> </FrameLayout>
</FrameLayout> </FrameLayout>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/player_center_menu" android:id="@+id/player_center_menu"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="100dp" android:layout_height="100dp"
android:layout_gravity="center" android:layout_gravity="center"
android:gravity="center" android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal"
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">
<FrameLayout <FrameLayout
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"
android:layout_width="200dp" android:layout_width="200dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_gravity="center" android:layout_gravity="center"
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="19sp" android:textSize="19sp"
android:textStyle="bold" android:textStyle="bold"
tools:text="10" /> tools:text="10" />
<ImageButton <ImageButton
android:id="@id/exo_rew" android:id="@id/exo_rew"
android:layout_width="70dp" android:layout_width="70dp"
android:layout_height="70dp" android:layout_height="70dp"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/video_tap_button_skip" android:background="@drawable/video_tap_button_skip"
android:nextFocusLeft="@id/exo_rew" android:nextFocusLeft="@id/exo_rew"
android:nextFocusUp="@id/player_go_back" android:nextFocusUp="@id/player_go_back"
android:nextFocusDown="@id/player_lock" android:nextFocusDown="@id/player_lock"
android:padding="10dp" android:padding="10dp"
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"
android:layout_width="200dp" android:layout_width="200dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_gravity="center" android:layout_gravity="center"
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="19sp" android:textSize="19sp"
android:textStyle="bold" android:textStyle="bold"
tools:text="10" /> tools:text="10" />
<ImageButton <ImageButton
android:id="@id/exo_ffwd" android:id="@id/exo_ffwd"
android:layout_width="70dp" android:layout_width="70dp"
android:layout_height="70dp" android:layout_height="70dp"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/video_tap_button_skip" android:background="@drawable/video_tap_button_skip"
android:nextFocusRight="@id/exo_rew" android:nextFocusRight="@id/exo_rew"
android:nextFocusUp="@id/player_go_back" android:nextFocusUp="@id/player_go_back"
android:nextFocusDown="@id/player_lock" android:nextFocusDown="@id/player_lock"
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>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginBottom="20dp" android:layout_marginBottom="20dp"
android:gravity="center" android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingTop="4dp" android:paddingTop="4dp"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"> app:layout_constraintEnd_toEndOf="parent">
<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" android:layout_height="0dp"
tools:ignore="ContentDescription" android:tintMode="src_in"
android:layout_height="0dp" app:tint="?attr/colorPrimaryDark"
android:layout_width="0dp" /> 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" android:layout_height="0dp"
tools:ignore="ContentDescription" android:tintMode="src_in"
android:layout_height="0dp" app:tint="?attr/colorPrimaryDark"
android:layout_width="0dp" /> tools:ignore="ContentDescription" />
</LinearLayout> </LinearLayout>
<ImageView <ImageView
android:background="?android:attr/selectableItemBackgroundBorderless" android:id="@+id/player_open_source"
android:id="@+id/player_open_source" android:layout_width="24dp"
app:tint="@color/white" android:layout_height="24dp"
android:src="@drawable/ic_baseline_public_24" android:layout_margin="20dp"
android:layout_margin="20dp" android:background="?android:attr/selectableItemBackgroundBorderless"
android:layout_width="24dp" android:src="@drawable/ic_baseline_public_24"
android:layout_height="24dp" 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"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
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
android:id="@id/exo_position" android:id="@id/exo_position"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginStart="20dp" android:layout_marginStart="20dp"
android:gravity="end" android:gravity="end"
android:includeFontPadding="false" android:includeFontPadding="false"
android:minWidth="50dp" android:minWidth="50dp"
android:paddingLeft="4dp" android:paddingLeft="4dp"
android:paddingRight="4dp" android:paddingRight="4dp"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="14sp" android:textSize="14sp"
android:textStyle="normal" android:textStyle="normal"
tools:text="15:30" /> tools:text="15:30" />
<!--app:buffered_color="@color/videoCache"--> <!--app:buffered_color="@color/videoCache"-->
<com.google.android.exoplayer2.ui.DefaultTimeBar <com.google.android.exoplayer2.ui.DefaultTimeBar
android:id="@id/exo_progress" android:id="@id/exo_progress"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_weight="1" android:layout_weight="1"
app:bar_height="2dp" app:bar_height="2dp"
app:played_color="?attr/colorPrimary" app:played_color="?attr/colorPrimary"
app:scrubber_color="?attr/colorPrimary" app:scrubber_color="?attr/colorPrimary"
app:scrubber_dragged_size="26dp" app:scrubber_dragged_size="26dp"
app:scrubber_enabled_size="24dp" app:scrubber_enabled_size="24dp"
app:unplayed_color="@color/videoProgress" /> app:unplayed_color="@color/videoProgress" />
<!-- exo_duration--> <!-- exo_duration-->
<TextView <TextView
android:id="@id/exo_duration" android:id="@id/exo_duration"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginEnd="20dp" android:layout_marginEnd="20dp"
android:includeFontPadding="false" android:includeFontPadding="false"
android:minWidth="50dp" android:minWidth="50dp"
android:paddingLeft="4dp" android:paddingLeft="4dp"
android:paddingRight="4dp" android:paddingRight="4dp"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="14sp" android:textSize="14sp"
android:textStyle="normal" android:textStyle="normal"
tools:text="23:20" /> tools:text="23:20" />
</LinearLayout> </LinearLayout>
<ImageView <ImageView
android:background="?android:attr/selectableItemBackgroundBorderless" android:id="@+id/player_fullscreen"
android:id="@+id/player_fullscreen" android:layout_width="30dp"
app:tint="@color/white" android:layout_height="30dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:src="@drawable/baseline_fullscreen_24" android:layout_marginEnd="20dp"
android:layout_marginEnd="20dp" android:background="?android:attr/selectableItemBackgroundBorderless"
android:layout_width="30dp" android:src="@drawable/baseline_fullscreen_24"
android:layout_height="30dp" /> app:tint="@color/white" />
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout <LinearLayout
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">
<RelativeLayout <RelativeLayout
android:id="@+id/player_progressbar_left_holder" android:id="@+id/player_progressbar_left_holder"
android:layout_width="100dp" android:layout_width="100dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:gravity="start" android:gravity="start"
android:visibility="gone" android:visibility="gone"
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/centerMenuView" app:layout_constraintRight_toLeftOf="@+id/centerMenuView"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:alpha="1" tools:alpha="1"
tools:visibility="visible"> tools:visibility="visible">
<!--VERY hacky layout --> <!--VERY hacky layout -->
<ImageView <ImageView
android:id="@+id/player_progressbar_left_icon" android:id="@+id/player_progressbar_left_icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginBottom="220dp" android:layout_marginBottom="220dp"
android:src="@drawable/ic_baseline_volume_up_24" android:src="@drawable/ic_baseline_volume_up_24"
app:tint="@android:color/white" app:tint="@android:color/white"
tools:ignore="ContentDescription"> tools:ignore="ContentDescription">
</ImageView> </ImageView>
<ProgressBar <ProgressBar
android:id="@+id/player_progressbar_left" android:id="@+id/player_progressbar_left"
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_gravity="end|center_vertical" android:layout_centerInParent="true"
android:layout_marginStart="40dp" android:layout_gravity="end|center_vertical"
android:indeterminate="false" android:layout_marginStart="40dp"
android:max="100" android:indeterminate="false"
android:progress="100" android:max="100"
android:progressDrawable="@drawable/progress_drawable_vertical" android:progress="100"
tools:progress="30" android:progressDrawable="@drawable/progress_drawable_vertical"
android:layout_centerInParent="true" /> tools:progress="30" />
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/player_progressbar_right_holder" android:id="@+id/player_progressbar_right_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:gravity="right" android:gravity="right"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/centerMenuView" app:layout_constraintLeft_toRightOf="@+id/centerMenuView"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:alpha="1" tools:alpha="1"
tools:ignore="RtlHardcoded" tools:ignore="RtlHardcoded"
tools:visibility="visible"> tools:visibility="visible">
<ImageView <ImageView
android:id="@+id/player_progressbar_right_icon" android:id="@+id/player_progressbar_right_icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginBottom="220dp" android:layout_marginBottom="220dp"
android:src="@drawable/ic_baseline_brightness_7_24" android:src="@drawable/ic_baseline_brightness_7_24"
app:tint="@android:color/white" app:tint="@android:color/white"
tools:ignore="ContentDescription"> tools:ignore="ContentDescription">
</ImageView> </ImageView>
<ProgressBar <ProgressBar
android:id="@+id/player_progressbar_right" android:id="@+id/player_progressbar_right"
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_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_gravity="end|center_vertical" android:layout_gravity="end|center_vertical"
android:layout_marginEnd="40dp" android:layout_marginEnd="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" />
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>

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">