mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +05:30
Merge branch 'libre-tube:master' into master
This commit is contained in:
commit
281b315ce8
@ -140,6 +140,7 @@ class PlayerFragment : Fragment() {
|
||||
private lateinit var thumbnailUrl: String
|
||||
private lateinit var chapters: List<ChapterSegment>
|
||||
private val sponsorBlockPrefs = SponsorBlockPrefs()
|
||||
private lateinit var subtitle: MutableList<SubtitleConfiguration>
|
||||
|
||||
private var autoRotationEnabled = true
|
||||
|
||||
@ -1093,7 +1094,6 @@ class PlayerFragment : Fragment() {
|
||||
}
|
||||
|
||||
private fun setMediaSource(
|
||||
subtitle: MutableList<SubtitleConfiguration>,
|
||||
videoUri: Uri,
|
||||
audioUrl: String
|
||||
) {
|
||||
@ -1117,7 +1117,6 @@ class PlayerFragment : Fragment() {
|
||||
private fun setResolutionAndSubtitles(response: Streams) {
|
||||
val videoFormatPreference =
|
||||
PreferenceHelper.getString(requireContext(), "player_video_format", "WEBM")
|
||||
val defres = PreferenceHelper.getString(requireContext(), "default_res", "")!!
|
||||
|
||||
var videosNameArray: Array<CharSequence> = arrayOf()
|
||||
var videosUrlArray: Array<Uri> = arrayOf()
|
||||
@ -1133,13 +1132,13 @@ class PlayerFragment : Fragment() {
|
||||
if (vid.format.equals(videoFormatPreference) && vid.url != null) { // preferred format
|
||||
videosNameArray += vid.quality.toString()
|
||||
videosUrlArray += vid.url!!.toUri()
|
||||
} else if (vid.quality.equals("LBRY") && vid.format.equals("MP4")) { // LBRY MP4 format)
|
||||
} else if (vid.quality.equals("LBRY") && vid.format.equals("MP4")) { // LBRY MP4 format
|
||||
videosNameArray += "LBRY MP4"
|
||||
videosUrlArray += vid.url!!.toUri()
|
||||
}
|
||||
}
|
||||
// create a list of subtitles
|
||||
val subtitle = mutableListOf<SubtitleConfiguration>()
|
||||
subtitle = mutableListOf<SubtitleConfiguration>()
|
||||
response.subtitles!!.forEach {
|
||||
subtitle.add(
|
||||
SubtitleConfiguration.Builder(it.url!!.toUri())
|
||||
@ -1148,50 +1147,12 @@ class PlayerFragment : Fragment() {
|
||||
.build()
|
||||
)
|
||||
}
|
||||
// set resolution in the beginning
|
||||
when {
|
||||
// search for the default resolution in the videoNamesArray, select quality if found
|
||||
defres != "" -> {
|
||||
run lit@{
|
||||
videosNameArray.forEachIndexed { index, pipedStream ->
|
||||
if (pipedStream.contains(defres)) {
|
||||
val videoUri = videosUrlArray[index]
|
||||
val audioUrl = getMostBitRate(response.audioStreams!!)
|
||||
setMediaSource(subtitle, videoUri, audioUrl)
|
||||
playerBinding.qualityText.text = videosNameArray[index]
|
||||
return@lit
|
||||
} else if (response.hls != null) {
|
||||
val mediaItem: MediaItem = MediaItem.Builder()
|
||||
.setUri(response.hls)
|
||||
.setSubtitleConfigurations(subtitle)
|
||||
.build()
|
||||
exoPlayer.setMediaItem(mediaItem)
|
||||
} else {
|
||||
Toast.makeText(
|
||||
context,
|
||||
getString(R.string.unknown_error),
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// if defres doesn't match use hls if available
|
||||
response.hls != null -> {
|
||||
val mediaItem: MediaItem = MediaItem.Builder()
|
||||
.setUri(response.hls)
|
||||
.setSubtitleConfigurations(subtitle)
|
||||
.build()
|
||||
exoPlayer.setMediaItem(mediaItem)
|
||||
}
|
||||
// otherwise use the first list entry
|
||||
else -> {
|
||||
val videoUri = videosUrlArray[0]
|
||||
val audioUrl = getMostBitRate(response.audioStreams!!)
|
||||
setMediaSource(subtitle, videoUri, audioUrl)
|
||||
playerBinding.qualityText.text = videosNameArray[0]
|
||||
}
|
||||
}
|
||||
// set media source and resolution in the beginning
|
||||
setStreamSource(
|
||||
response,
|
||||
videosNameArray,
|
||||
videosUrlArray
|
||||
)
|
||||
|
||||
playerBinding.qualityText.setOnClickListener {
|
||||
// Dialog for quality selection
|
||||
@ -1217,7 +1178,7 @@ class PlayerFragment : Fragment() {
|
||||
} else {
|
||||
val videoUri = videosUrlArray[which]
|
||||
val audioUrl = getMostBitRate(response.audioStreams!!)
|
||||
setMediaSource(subtitle, videoUri, audioUrl)
|
||||
setMediaSource(videoUri, audioUrl)
|
||||
}
|
||||
exoPlayer.seekTo(lastPosition)
|
||||
playerBinding.qualityText.text = videosNameArray[which]
|
||||
@ -1227,6 +1188,50 @@ class PlayerFragment : Fragment() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun setStreamSource(
|
||||
streams: Streams,
|
||||
videosNameArray: Array<CharSequence>,
|
||||
videosUrlArray: Array<Uri>
|
||||
) {
|
||||
val defRes = PreferenceHelper.getString(
|
||||
requireContext(),
|
||||
"default_resolution",
|
||||
"hls"
|
||||
)!!
|
||||
|
||||
if (defRes != "hls") {
|
||||
videosNameArray.forEachIndexed { index, pipedStream ->
|
||||
// search for quality preference in the available stream sources
|
||||
if (pipedStream.contains(defRes)) {
|
||||
val videoUri = videosUrlArray[index]
|
||||
val audioUrl = getMostBitRate(streams.audioStreams!!)
|
||||
setMediaSource(videoUri, audioUrl)
|
||||
playerBinding.qualityText.text = videosNameArray[index]
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if default resolution isn't set or available, use hls if available
|
||||
if (streams.hls != null) {
|
||||
val mediaItem: MediaItem = MediaItem.Builder()
|
||||
.setUri(streams.hls)
|
||||
.setSubtitleConfigurations(subtitle)
|
||||
.build()
|
||||
exoPlayer.setMediaItem(mediaItem)
|
||||
playerBinding.qualityText.text = context?.getString(R.string.hls)
|
||||
return
|
||||
}
|
||||
|
||||
// if nothing found, use the first list entry
|
||||
if (videosUrlArray.isNotEmpty()) {
|
||||
val videoUri = videosUrlArray[0]
|
||||
val audioUrl = getMostBitRate(streams.audioStreams!!)
|
||||
setMediaSource(videoUri, audioUrl)
|
||||
playerBinding.qualityText.text = videosNameArray[0]
|
||||
}
|
||||
}
|
||||
|
||||
private fun createExoPlayer(view: View) {
|
||||
val bufferingGoal =
|
||||
PreferenceHelper.getString(requireContext(), "buffering_goal", "50")?.toInt()!! * 1000
|
||||
@ -1298,7 +1303,8 @@ class PlayerFragment : Fragment() {
|
||||
playerBinding.exoPlayPause.visibility = visibility
|
||||
playerBinding.exoBottomBar.visibility = visibility
|
||||
playerBinding.closeImageButton.visibility = visibility
|
||||
playerBinding.exoTitle.visibility = visibility
|
||||
playerBinding.exoTitle.visibility =
|
||||
if (isLocked && Globals.isFullScreen) View.VISIBLE else View.INVISIBLE
|
||||
|
||||
// disable double tap to seek when the player is locked
|
||||
if (isLocked) enableDoubleTapToSeek() else disableDoubleTapToSeek()
|
||||
|
@ -3,7 +3,7 @@ package com.github.libretube.preferences
|
||||
import android.os.Bundle
|
||||
import androidx.preference.ListPreference
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import androidx.preference.SwitchPreference
|
||||
import androidx.preference.SwitchPreferenceCompat
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.activities.SettingsActivity
|
||||
import com.github.libretube.dialogs.RequireRestartDialog
|
||||
@ -25,6 +25,13 @@ class AppearanceSettings : PreferenceFragmentCompat() {
|
||||
true
|
||||
}
|
||||
|
||||
val pureTheme = findPreference<SwitchPreferenceCompat>("pure_theme")
|
||||
pureTheme?.setOnPreferenceChangeListener { _, _ ->
|
||||
val restartDialog = RequireRestartDialog()
|
||||
restartDialog.show(childFragmentManager, "RequireRestartDialog")
|
||||
true
|
||||
}
|
||||
|
||||
val accentColor = findPreference<ListPreference>("accent_color")
|
||||
updateAccentColorValues(accentColor!!)
|
||||
accentColor.setOnPreferenceChangeListener { _, _ ->
|
||||
@ -46,7 +53,7 @@ class AppearanceSettings : PreferenceFragmentCompat() {
|
||||
true
|
||||
}
|
||||
|
||||
val hideTrending = findPreference<SwitchPreference>("hide_trending_page")
|
||||
val hideTrending = findPreference<SwitchPreferenceCompat>("hide_trending_page")
|
||||
hideTrending?.setOnPreferenceChangeListener { _, _ ->
|
||||
val restartDialog = RequireRestartDialog()
|
||||
restartDialog.show(childFragmentManager, "RequireRestartDialog")
|
||||
|
@ -18,7 +18,7 @@ import androidx.lifecycle.lifecycleScope
|
||||
import androidx.preference.ListPreference
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import androidx.preference.SwitchPreference
|
||||
import androidx.preference.SwitchPreferenceCompat
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.activities.SettingsActivity
|
||||
import com.github.libretube.dialogs.CustomInstanceDialog
|
||||
@ -146,7 +146,7 @@ class InstanceSettings : PreferenceFragmentCompat() {
|
||||
true
|
||||
}
|
||||
|
||||
val authInstanceToggle = findPreference<SwitchPreference>("auth_instance_toggle")
|
||||
val authInstanceToggle = findPreference<SwitchPreferenceCompat>("auth_instance_toggle")
|
||||
authInstanceToggle?.setOnPreferenceChangeListener { _, newValue ->
|
||||
authInstance.isVisible = newValue == true
|
||||
logout()
|
||||
|
@ -18,15 +18,15 @@ object ThemeHelper {
|
||||
|
||||
fun updateTheme(activity: AppCompatActivity) {
|
||||
val themeMode = PreferenceHelper.getString(activity, "theme_toggle", "A")!!
|
||||
val blackModeEnabled = themeMode == "O"
|
||||
val pureThemeEnabled = PreferenceHelper.getBoolean(activity, "pure_theme", false)
|
||||
|
||||
updateAccentColor(activity, blackModeEnabled)
|
||||
updateAccentColor(activity, pureThemeEnabled)
|
||||
updateThemeMode(themeMode)
|
||||
}
|
||||
|
||||
private fun updateAccentColor(
|
||||
activity: AppCompatActivity,
|
||||
blackThemeEnabled: Boolean
|
||||
pureThemeEnabled: Boolean
|
||||
) {
|
||||
val theme = when (
|
||||
PreferenceHelper.getString(
|
||||
@ -37,15 +37,16 @@ object ThemeHelper {
|
||||
) {
|
||||
"my" -> {
|
||||
applyDynamicColors(activity)
|
||||
if (blackThemeEnabled) R.style.MaterialYou_Black
|
||||
if (pureThemeEnabled) R.style.MaterialYou_Pure
|
||||
else R.style.MaterialYou
|
||||
}
|
||||
"red" -> if (blackThemeEnabled) R.style.Theme_Red_Black else R.style.Theme_Red
|
||||
"blue" -> if (blackThemeEnabled) R.style.Theme_Blue_Black else R.style.Theme_Blue
|
||||
"yellow" -> if (blackThemeEnabled) R.style.Theme_Yellow_Black else R.style.Theme_Yellow
|
||||
"green" -> if (blackThemeEnabled) R.style.Theme_Green_Black else R.style.Theme_Green
|
||||
"purple" -> if (blackThemeEnabled) R.style.Theme_Purple_Black else R.style.Theme_Purple
|
||||
else -> if (blackThemeEnabled) R.style.Theme_Purple_Black else R.style.Theme_Purple
|
||||
// set the theme, use the pure theme if enabled
|
||||
"red" -> if (pureThemeEnabled) R.style.Theme_Red_Pure else R.style.Theme_Red
|
||||
"blue" -> if (pureThemeEnabled) R.style.Theme_Blue_Pure else R.style.Theme_Blue
|
||||
"yellow" -> if (pureThemeEnabled) R.style.Theme_Yellow_Pure else R.style.Theme_Yellow
|
||||
"green" -> if (pureThemeEnabled) R.style.Theme_Green_Pure else R.style.Theme_Green
|
||||
"purple" -> if (pureThemeEnabled) R.style.Theme_Purple_Pure else R.style.Theme_Purple
|
||||
else -> if (pureThemeEnabled) R.style.Theme_Purple_Pure else R.style.Theme_Purple
|
||||
}
|
||||
activity.setTheme(theme)
|
||||
}
|
||||
@ -62,7 +63,6 @@ object ThemeHelper {
|
||||
"A" -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
|
||||
"L" -> AppCompatDelegate.MODE_NIGHT_NO
|
||||
"D" -> AppCompatDelegate.MODE_NIGHT_YES
|
||||
"O" -> AppCompatDelegate.MODE_NIGHT_YES
|
||||
else -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
|
||||
}
|
||||
AppCompatDelegate.setDefaultNightMode(mode)
|
||||
|
10
app/src/main/res/drawable/ic_invert_colors.xml
Normal file
10
app/src/main/res/drawable/ic_invert_colors.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?android:attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M12,4.81L12,19c-3.31,0 -6,-2.63 -6,-5.87c0,-1.56 0.62,-3.03 1.75,-4.14L12,4.81M6.35,7.56L6.35,7.56C4.9,8.99 4,10.96 4,13.13C4,17.48 7.58,21 12,21c4.42,0 8,-3.52 8,-7.87c0,-2.17 -0.9,-4.14 -2.35,-5.57l0,0L12,2L6.35,7.56z"
|
||||
android:fillColor="#000000"/>
|
||||
</vector>
|
@ -1,4 +1,10 @@
|
||||
<vector android:height="24dp" android:viewportHeight="48"
|
||||
android:viewportWidth="48" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="m24.1,38 l5.7,-5.65 -5.7,-5.65 -2.1,2.1 2.15,2.15q-1.4,0.05 -2.725,-0.45 -1.325,-0.5 -2.375,-1.55 -1,-1 -1.525,-2.3 -0.525,-1.3 -0.525,-2.6 0,-0.85 0.225,-1.7t0.625,-1.65l-2.2,-2.2q-0.85,1.25 -1.25,2.65T14,24q0,1.9 0.75,3.75t2.2,3.3q1.45,1.45 3.25,2.175 1.8,0.725 3.7,0.775L22,35.9ZM32.35,29.5q0.85,-1.25 1.25,-2.65T34,24q0,-1.9 -0.725,-3.775T31.1,16.9q-1.45,-1.45 -3.275,-2.15t-3.725,-0.7L26,12.1 23.9,10l-5.7,5.65 5.7,5.65 2.1,-2.1 -2.2,-2.2q1.35,0 2.75,0.525t2.4,1.525q1,1 1.525,2.3 0.525,1.3 0.525,2.6 0,0.85 -0.225,1.7t-0.625,1.65ZM24,44q-4.1,0 -7.75,-1.575 -3.65,-1.575 -6.375,-4.3 -2.725,-2.725 -4.3,-6.375Q4,28.1 4,24q0,-4.15 1.575,-7.8 1.575,-3.65 4.3,-6.35 2.725,-2.7 6.375,-4.275Q19.9,4 24,4q4.15,0 7.8,1.575 3.65,1.575 6.35,4.275 2.7,2.7 4.275,6.35Q44,19.85 44,24q0,4.1 -1.575,7.75 -1.575,3.65 -4.275,6.375t-6.35,4.3Q28.15,44 24,44Z"/>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?android:attr/colorControlNormal"
|
||||
android:viewportWidth="48"
|
||||
android:viewportHeight="48">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="m24.1,38 l5.7,-5.65 -5.7,-5.65 -2.1,2.1 2.15,2.15q-1.4,0.05 -2.725,-0.45 -1.325,-0.5 -2.375,-1.55 -1,-1 -1.525,-2.3 -0.525,-1.3 -0.525,-2.6 0,-0.85 0.225,-1.7t0.625,-1.65l-2.2,-2.2q-0.85,1.25 -1.25,2.65T14,24q0,1.9 0.75,3.75t2.2,3.3q1.45,1.45 3.25,2.175 1.8,0.725 3.7,0.775L22,35.9ZM32.35,29.5q0.85,-1.25 1.25,-2.65T34,24q0,-1.9 -0.725,-3.775T31.1,16.9q-1.45,-1.45 -3.275,-2.15t-3.725,-0.7L26,12.1 23.9,10l-5.7,5.65 5.7,5.65 2.1,-2.1 -2.2,-2.2q1.35,0 2.75,0.525t2.4,1.525q1,1 1.525,2.3 0.525,1.3 0.525,2.6 0,0.85 -0.225,1.7t-0.625,1.65ZM24,44q-4.1,0 -7.75,-1.575 -3.65,-1.575 -6.375,-4.3 -2.725,-2.725 -4.3,-6.375Q4,28.1 4,24q0,-4.15 1.575,-7.8 1.575,-3.65 4.3,-6.35 2.725,-2.7 6.375,-4.275Q19.9,4 24,4q4.15,0 7.8,1.575 3.65,1.575 6.35,4.275 2.7,2.7 4.275,6.35Q44,19.85 44,24q0,4.1 -1.575,7.75 -1.575,3.65 -4.275,6.375t-6.35,4.3Q28.15,44 24,44Z" />
|
||||
</vector>
|
||||
|
@ -20,28 +20,21 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layoutDirection="ltr"
|
||||
android:paddingStart="@dimen/exo_styled_bottom_bar_time_padding"
|
||||
android:paddingLeft="@dimen/exo_styled_bottom_bar_time_padding"
|
||||
android:paddingEnd="@dimen/exo_styled_bottom_bar_time_padding"
|
||||
android:paddingRight="@dimen/exo_styled_bottom_bar_time_padding">
|
||||
android:layout_marginStart="5dp"
|
||||
android:layoutDirection="ltr">
|
||||
|
||||
<ImageButton
|
||||
<ImageView
|
||||
android:id="@+id/close_imageButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="#00FFFFFF"
|
||||
android:padding="@dimen/exo_icon_padding"
|
||||
style="@style/PlayerControlTop"
|
||||
android:src="@drawable/ic_close"
|
||||
app:tint="@android:color/white" />
|
||||
|
||||
<ImageButton
|
||||
<ImageView
|
||||
android:id="@+id/lock_player"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#00FFFFFF"
|
||||
android:padding="@dimen/exo_icon_padding"
|
||||
style="@style/PlayerControlTop"
|
||||
android:layout_marginStart="-5dp"
|
||||
android:scaleX=".9"
|
||||
android:scaleY=".9"
|
||||
android:src="@drawable/ic_unlocked" />
|
||||
|
||||
</LinearLayout>
|
||||
@ -64,42 +57,26 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layoutDirection="ltr"
|
||||
android:paddingStart="@dimen/exo_styled_bottom_bar_time_padding"
|
||||
android:paddingLeft="@dimen/exo_styled_bottom_bar_time_padding"
|
||||
android:paddingEnd="@dimen/exo_styled_bottom_bar_time_padding"
|
||||
android:paddingRight="@dimen/exo_styled_bottom_bar_time_padding">
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layoutDirection="ltr">
|
||||
|
||||
<ImageButton
|
||||
<ImageView
|
||||
android:id="@+id/aspect_ratio_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="5dp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:padding="@dimen/exo_icon_padding"
|
||||
style="@style/PlayerControlTop"
|
||||
android:layout_marginTop="-1dp"
|
||||
android:scaleX=".9"
|
||||
android:scaleY=".9"
|
||||
android:src="@drawable/ic_aspect_ratio" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/speed_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginHorizontal="5dp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:padding="@dimen/exo_icon_padding"
|
||||
android:text="1x"
|
||||
android:textColor="#FFFFFF" />
|
||||
style="@style/PlayerControlTop"
|
||||
android:text="1x" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/quality_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginHorizontal="5dp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:padding="@dimen/exo_icon_padding"
|
||||
android:text="@string/hls"
|
||||
android:textColor="#FFFFFF" />
|
||||
style="@style/PlayerControlTop"
|
||||
android:text="@string/hls" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@ -116,7 +93,6 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="-5dp"
|
||||
android:paddingStart="@dimen/exo_styled_bottom_bar_time_padding"
|
||||
android:paddingLeft="@dimen/exo_styled_bottom_bar_time_padding"
|
||||
android:paddingEnd="@dimen/exo_styled_bottom_bar_time_padding"
|
||||
@ -147,6 +123,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_weight="1"
|
||||
android:visibility="invisible">
|
||||
|
||||
@ -175,17 +152,17 @@
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/repeat_toggle"
|
||||
style="@style/PlayerButton"
|
||||
style="@style/PlayerControlBottom"
|
||||
android:src="@drawable/ic_repeat"
|
||||
app:tint="@android:color/darker_gray" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@id/exo_subtitle"
|
||||
style="@style/PlayerButton" />
|
||||
style="@style/PlayerControlBottom" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/fullscreen"
|
||||
style="@style/PlayerButton"
|
||||
style="@style/PlayerControlBottom"
|
||||
android:src="@drawable/ic_fullscreen"
|
||||
app:tint="@android:color/white" />
|
||||
|
||||
|
@ -363,7 +363,7 @@
|
||||
android:layout_height="0dp"
|
||||
android:background="?attr/colorSurface"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_percent="0.3"
|
||||
app:layout_constraintHeight_percent="0.275"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
</style>
|
||||
|
||||
<style name="MaterialYou.Black" parent="MaterialYou">
|
||||
<style name="MaterialYou.Pure" parent="MaterialYou">
|
||||
|
||||
<item name="android:colorBackground">@android:color/black</item>
|
||||
<item name="colorSurface">@android:color/black</item>
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.Red.Black" parent="Theme.Red">
|
||||
<style name="Theme.Red.Pure" parent="Theme.Red">
|
||||
|
||||
<item name="android:colorBackground">@android:color/black</item>
|
||||
<item name="colorSurface">@android:color/black</item>
|
||||
@ -58,7 +58,7 @@
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.Blue.Black" parent="Theme.Blue">
|
||||
<style name="Theme.Blue.Pure" parent="Theme.Blue">
|
||||
|
||||
<item name="android:colorBackground">@android:color/black</item>
|
||||
<item name="colorSurface">@android:color/black</item>
|
||||
@ -83,7 +83,7 @@
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.Yellow.Black" parent="Theme.Yellow">
|
||||
<style name="Theme.Yellow.Pure" parent="Theme.Yellow">
|
||||
|
||||
<item name="android:colorBackground">@android:color/black</item>
|
||||
<item name="colorSurface">@android:color/black</item>
|
||||
@ -108,7 +108,7 @@
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.Green.Black" parent="Theme.Green">
|
||||
<style name="Theme.Green.Pure" parent="Theme.Green">
|
||||
|
||||
<item name="android:colorBackground">@android:color/black</item>
|
||||
<item name="colorSurface">@android:color/black</item>
|
||||
@ -133,7 +133,7 @@
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.Purple.Black" parent="Theme.Purple">
|
||||
<style name="Theme.Purple.Pure" parent="Theme.Purple">
|
||||
|
||||
<item name="android:colorBackground">@android:color/black</item>
|
||||
<item name="colorSurface">@android:color/black</item>
|
||||
|
@ -533,14 +533,12 @@
|
||||
<item>@string/systemDefault</item>
|
||||
<item>@string/lightTheme</item>
|
||||
<item>@string/darkTheme</item>
|
||||
<item>@string/oledTheme</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="themesValue">
|
||||
<item>A</item>
|
||||
<item>L</item>
|
||||
<item>D</item>
|
||||
<item>O</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="accents">
|
||||
@ -583,7 +581,7 @@
|
||||
<item>144p</item>
|
||||
</string-array>
|
||||
<string-array name="defresValue">
|
||||
<item></item>
|
||||
<item>hls</item>
|
||||
<item>1080p</item>
|
||||
<item>720p</item>
|
||||
<item>480p</item>
|
||||
|
@ -239,4 +239,6 @@
|
||||
<string name="never">Never</string>
|
||||
<string name="autoRotatePlayer">Auto fullscreen</string>
|
||||
<string name="autoRotatePlayer_summary">Automatically switch to player fullscreen when the device gets turned.</string>
|
||||
<string name="pure_theme">Pure theme</string>
|
||||
<string name="pure_theme_summary">Pure white/black theme</string>
|
||||
</resources>
|
@ -104,14 +104,26 @@
|
||||
|
||||
</style>
|
||||
|
||||
<style name="PlayerButton">
|
||||
<style name="PlayerControlBottom">
|
||||
|
||||
<item name="android:padding">9dp</item>
|
||||
<item name="android:layout_height">36dp</item>
|
||||
<item name="android:layout_width">36dp</item>
|
||||
<item name="android:layout_gravity">center</item>
|
||||
<item name="android:background">?attr/selectableItemBackground</item>
|
||||
<item name="android:background">?attr/selectableItemBackgroundBorderless</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="PlayerControlTop">
|
||||
|
||||
<item name="android:padding">9dp</item>
|
||||
<item name="android:layout_height">match_parent</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_gravity">center</item>
|
||||
<item name="android:background">?attr/selectableItemBackgroundBorderless</item>
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
</resources>
|
@ -8,6 +8,13 @@
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.MaterialYou.Pure" parent="MaterialYou">
|
||||
|
||||
<item name="android:colorBackground">@android:color/white</item>
|
||||
<item name="colorSurface">@android:color/white</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.Red" parent="Theme.Material3.Light.NoActionBar">
|
||||
|
||||
<item name="colorPrimary">@color/red_light_accentLight</item>
|
||||
@ -27,6 +34,13 @@
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.Red.Pure" parent="Theme.Red">
|
||||
|
||||
<item name="android:colorBackground">@android:color/white</item>
|
||||
<item name="colorSurface">@android:color/white</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.Blue" parent="Theme.Material3.Light.NoActionBar">
|
||||
|
||||
<item name="colorPrimary">@color/blue_light_accentLight</item>
|
||||
@ -46,6 +60,13 @@
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.Blue.Pure" parent="Theme.Blue">
|
||||
|
||||
<item name="android:colorBackground">@android:color/white</item>
|
||||
<item name="colorSurface">@android:color/white</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.Yellow" parent="Theme.Material3.Light.NoActionBar">
|
||||
|
||||
<item name="colorPrimary">@color/yellow_light_accentLight</item>
|
||||
@ -65,6 +86,13 @@
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.Yellow.Pure" parent="Theme.Yellow">
|
||||
|
||||
<item name="android:colorBackground">@android:color/white</item>
|
||||
<item name="colorSurface">@android:color/white</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.Green" parent="Theme.Material3.Light.NoActionBar">
|
||||
|
||||
<item name="colorPrimary">@color/green_light_accentLight</item>
|
||||
@ -84,6 +112,13 @@
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.Green.Pure" parent="Theme.Green">
|
||||
|
||||
<item name="android:colorBackground">@android:color/white</item>
|
||||
<item name="colorSurface">@android:color/white</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.Purple" parent="Theme.Material3.Light.NoActionBar">
|
||||
|
||||
<item name="colorPrimary">@color/purple_light_accentLight</item>
|
||||
@ -103,4 +138,11 @@
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.Purple.Pure" parent="Theme.Purple">
|
||||
|
||||
<item name="android:colorBackground">@android:color/white</item>
|
||||
<item name="colorSurface">@android:color/white</item>
|
||||
|
||||
</style>
|
||||
|
||||
</resources>
|
@ -33,7 +33,7 @@
|
||||
|
||||
<PreferenceCategory app:title="@string/search_history">
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:icon="@drawable/ic_history_filled"
|
||||
app:key="search_history_toggle"
|
||||
@ -48,13 +48,13 @@
|
||||
|
||||
<PreferenceCategory app:title="@string/watch_history">
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:icon="@drawable/ic_time_outlined"
|
||||
app:key="watch_history_toggle"
|
||||
app:title="@string/watch_history" />
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:icon="@drawable/ic_play_filled"
|
||||
app:key="watch_position_toggle"
|
||||
|
@ -13,6 +13,13 @@
|
||||
app:title="@string/app_theme"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:icon="@drawable/ic_invert_colors"
|
||||
android:summary="@string/pure_theme_summary"
|
||||
app:defaultValue="false"
|
||||
app:key="pure_theme"
|
||||
app:title="@string/pure_theme" />
|
||||
|
||||
<ListPreference
|
||||
android:icon="@drawable/ic_color"
|
||||
app:defaultValue="purple"
|
||||
@ -44,7 +51,7 @@
|
||||
app:title="@string/defaultTab"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
android:icon="@drawable/ic_trending"
|
||||
app:defaultValue="false"
|
||||
app:key="hide_trending_page"
|
||||
@ -73,7 +80,7 @@
|
||||
|
||||
<PreferenceCategory>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:icon="@drawable/ic_list"
|
||||
app:key="related_streams_toggle"
|
||||
|
@ -23,7 +23,7 @@
|
||||
app:key="clearCustomInstances"
|
||||
app:title="@string/clear_customInstances" />
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:icon="@drawable/ic_auth"
|
||||
app:key="auth_instance_toggle"
|
||||
|
@ -6,10 +6,10 @@
|
||||
|
||||
<ListPreference
|
||||
android:icon="@drawable/ic_hd"
|
||||
app:defaultValue=""
|
||||
app:defaultValue="hls"
|
||||
app:entries="@array/defres"
|
||||
app:entryValues="@array/defresValue"
|
||||
app:key="default_res"
|
||||
app:key="default_resolution"
|
||||
app:title="@string/defres"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user