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

View file

@ -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(

View file

@ -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 {

View file

@ -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<ExtractorLink> = 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
//}) {

View file

@ -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.*

View file

@ -88,6 +88,7 @@ data class ResultData(
var syncData: Map<String, String>,
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(),

View file

@ -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) {

View file

@ -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<String, String>? = 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)

View file

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

View file

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

File diff suppressed because it is too large Load diff

View file

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

View file

@ -1,452 +1,467 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
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">
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">
<TextView
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/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" />
<FrameLayout
android:id="@+id/subtitle_holder"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id/subtitle_holder"
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:id="@+id/shadow_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black_overlay" />
android:id="@+id/shadow_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black_overlay" />
</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_height="match_parent">
android:layout_height="match_parent"
android:layout_gravity="center"
android:scaleType="centerCrop" />-->
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/player_gradient_tv" />
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_gravity="bottom"
android:background="@drawable/background_shadow" />
<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_height="wrap_content" />
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" />
<ImageView
android:layout_gravity="center"
android:src="@drawable/play_button"
android:layout_width="60dp"
android:layout_height="60dp" />
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center"
android:src="@drawable/play_button" />
</FrameLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/player_video_holder"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id/player_video_holder"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--use for thinner app:trackThickness="3dp" com.google.android.material.progressindicator.CircularProgressIndicator-->
<ProgressBar
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:id="@+id/player_buffering"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:focusable="false"
android:clickable="false"
android:focusableInTouchMode="false"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:indeterminate="true"
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" />
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" />
<!-- This nested layout is necessary because of buffering and clicking-->
<FrameLayout
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="100dp"
android:layout_height="100dp"
android:id="@+id/player_pause_play_holder_holder">
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">
<FrameLayout
tools:ignore="uselessParent"
android:id="@+id/player_pause_play_holder"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id/player_pause_play_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="uselessParent">
<ImageView
app:tint="@color/white"
android:id="@+id/player_pause_play"
android:nextFocusLeft="@id/exo_rew"
android:nextFocusRight="@id/exo_ffwd"
android:nextFocusUp="@id/player_go_back"
android:nextFocusDown="@id/player_lock"
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:layout_gravity="center"
android:nextFocusRight="@id/exo_ffwd"
android:src="@drawable/netflix_pause"
android:background="@drawable/video_tap_button"
android:nextFocusUp="@id/player_go_back"
android:nextFocusDown="@id/player_lock"
android:layout_width="70dp"
android:layout_height="70dp"
tools:ignore="ContentDescription" />
android:src="@drawable/netflix_pause"
app:tint="@color/white"
tools:ignore="ContentDescription" />
</FrameLayout>
</FrameLayout>
<androidx.constraintlayout.widget.ConstraintLayout
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_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">
<FrameLayout
android:id="@+id/player_rew_holder"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintWidth_percent="0.5"
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">
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">
<TextView
android:id="@+id/exo_rew_text"
android:layout_width="200dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:id="@+id/exo_rew_text"
android:layout_width="200dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:gravity="center"
android:textColor="@color/white"
android:textSize="19sp"
android:gravity="center"
android:textColor="@color/white"
android:textSize="19sp"
android:textStyle="bold"
tools:text="10" />
android:textStyle="bold"
tools:text="10" />
<ImageButton
android:id="@id/exo_rew"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_gravity="center"
android:id="@id/exo_rew"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_gravity="center"
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"
app:tint="@color/white"
android:tintMode="src_in"
tools:ignore="ContentDescription" />
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" />
</FrameLayout>
<FrameLayout
android:id="@+id/player_ffwd_holder"
android:layout_width="0dp"
app:layout_constraintWidth_percent="0.5"
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">
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">
<TextView
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: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" />
<ImageButton
android:id="@id/exo_ffwd"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_gravity="center"
android:id="@id/exo_ffwd"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_gravity="center"
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"
app:tint="@color/white"
android:tintMode="src_in"
tools:ignore="ContentDescription" />
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" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
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: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">
<ImageButton
android:id="@id/exo_prev"
style="@style/ExoMediaButton.Previous"
app:tint="?attr/colorPrimaryDark"
android:tintMode="src_in"
tools:ignore="ContentDescription" />
android:id="@id/exo_prev"
style="@style/ExoMediaButton.Previous"
android:tintMode="src_in"
app:tint="?attr/colorPrimaryDark"
tools:ignore="ContentDescription" />
<ImageButton
android:id="@id/exo_repeat_toggle"
style="@style/ExoMediaButton"
app:tint="?attr/colorPrimaryDark"
android:tintMode="src_in"
tools:ignore="ContentDescription" />
android:id="@id/exo_repeat_toggle"
style="@style/ExoMediaButton"
android:tintMode="src_in"
app:tint="?attr/colorPrimaryDark"
tools:ignore="ContentDescription" />
<ImageButton
android:id="@id/exo_next"
style="@style/ExoMediaButton.Next"
app:tint="?attr/colorPrimaryDark"
android:tintMode="src_in"
tools:ignore="ContentDescription" />
android:id="@id/exo_next"
style="@style/ExoMediaButton.Next"
android:tintMode="src_in"
app:tint="?attr/colorPrimaryDark"
tools:ignore="ContentDescription" />
<ImageButton
android:id="@id/exo_vr"
style="@style/ExoMediaButton.VR"
app:tint="?attr/colorPrimaryDark"
android:tintMode="src_in"
tools:ignore="ContentDescription" />
android:id="@id/exo_vr"
style="@style/ExoMediaButton.VR"
android:tintMode="src_in"
app:tint="?attr/colorPrimaryDark"
tools:ignore="ContentDescription" />
<ImageButton
android:id="@id/exo_play"
app:tint="?attr/colorPrimaryDark"
android:tintMode="src_in"
tools:ignore="ContentDescription"
android:layout_height="0dp"
android:layout_width="0dp" />
android:id="@id/exo_play"
android:layout_width="0dp"
android:layout_height="0dp"
android:tintMode="src_in"
app:tint="?attr/colorPrimaryDark"
tools:ignore="ContentDescription" />
<ImageButton
android:id="@id/exo_pause"
app:tint="?attr/colorPrimaryDark"
android:tintMode="src_in"
tools:ignore="ContentDescription"
android:layout_height="0dp"
android:layout_width="0dp" />
android:id="@id/exo_pause"
android:layout_width="0dp"
android:layout_height="0dp"
android:tintMode="src_in"
app:tint="?attr/colorPrimaryDark"
tools:ignore="ContentDescription" />
</LinearLayout>
<ImageView
android:background="?android:attr/selectableItemBackgroundBorderless"
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_height="24dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
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" />
<LinearLayout
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/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">
<LinearLayout
android:layout_weight="1"
android:id="@+id/player_video_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:id="@+id/player_video_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
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" />
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:buffered_color="@color/videoCache"-->
<com.google.android.exoplayer2.ui.DefaultTimeBar
android:id="@id/exo_progress"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
app:bar_height="2dp"
app:played_color="?attr/colorPrimary"
android:id="@id/exo_progress"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
app:bar_height="2dp"
app:played_color="?attr/colorPrimary"
app:scrubber_color="?attr/colorPrimary"
app:scrubber_dragged_size="26dp"
app:scrubber_enabled_size="24dp"
app:unplayed_color="@color/videoProgress" />
app:scrubber_color="?attr/colorPrimary"
app:scrubber_dragged_size="26dp"
app:scrubber_enabled_size="24dp"
app:unplayed_color="@color/videoProgress" />
<!-- exo_duration-->
<TextView
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/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" />
</LinearLayout>
<ImageView
android:background="?android:attr/selectableItemBackgroundBorderless"
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_height="30dp" />
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" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<RelativeLayout
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_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">
<!--VERY hacky layout -->
<ImageView
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_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">
</ImageView>
<ProgressBar
android:id="@+id/player_progressbar_left"
style="@android:style/Widget.Material.ProgressBar.Horizontal"
android:layout_width="4dp"
android:layout_height="150dp"
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:layout_centerInParent="true" />
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" />
</RelativeLayout>
<RelativeLayout
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_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">
<ImageView
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_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">
</ImageView>
<ProgressBar
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" />
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" />
</RelativeLayout>
</LinearLayout>
</FrameLayout>

View file

@ -82,6 +82,8 @@
<item name="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="fontFamily">@font/google_sans</item>
<item name="android:fontFamily">@font/google_sans</item>
</style>
<style name="AmoledMode">