removed quality selector

This commit is contained in:
aayush262 2024-01-26 10:32:02 +05:30
parent 00ce6ce755
commit 4a5eab13c9
5 changed files with 0 additions and 203 deletions

View file

@ -147,9 +147,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
private lateinit var skipTimeText: TextView
private lateinit var timeStampText: TextView
private lateinit var animeTitle: TextView
private lateinit var videoName: TextView
private lateinit var videoInfo: TextView
private lateinit var serverInfo: TextView
private lateinit var episodeTitle: Spinner
private var orientationListener: OrientationEventListener? = null
@ -924,21 +922,9 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
title = media.userPreferredName
episodes = media.anime?.episodes ?: return startMainActivity(this)
videoName = playerView.findViewById(R.id.exo_video_name)
videoInfo = playerView.findViewById(R.id.exo_video_info)
serverInfo = playerView.findViewById(R.id.exo_server_info)
if (!settings.videoInfo) {
videoName.visibility = View.GONE
videoInfo.visibility = View.GONE
serverInfo.visibility = View.GONE
} else {
videoName.isSelected = true
}
model.watchSources = if (media.isAdult) HAnimeSources else AnimeSources
serverInfo.text = model.watchSources!!.names.getOrNull(media.selected!!.sourceIndex)
?: model.watchSources!!.names[0]
model.epChanged.observe(this) {
epChanging = !it
@ -1408,10 +1394,6 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
.setRendererDisabled(TRACK_TYPE_VIDEO, false)
.setRendererDisabled(C.TRACK_TYPE_AUDIO, false)
.setRendererDisabled(C.TRACK_TYPE_TEXT, false)
.setMinVideoSize(
loadData("maxWidth", this) ?: 720,
loadData("maxHeight", this) ?: 480
)
.setMaxVideoSize(1, 1)
//.setOverrideForType(
// TrackSelectionOverride(trackSelector, 2))
@ -1613,14 +1595,8 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
val height = (exoPlayer.videoFormat ?: return).height
val width = (exoPlayer.videoFormat ?: return).width
if (video?.format != VideoType.CONTAINER) {
saveData("maxHeight", height)
saveData("maxWidth", width)
}
aspectRatio = Rational(width, height)
videoName.text = episode.selectedExtractor
videoInfo.text = "$width x $height"
if (exoPlayer.duration < playbackPosition)

View file

@ -3,8 +3,6 @@ package ani.dantotsu.settings
import java.io.Serializable
data class PlayerSettings(
//Video
var videoInfo: Boolean = true,
var defaultSpeed: Int = 5,
var cursedSpeeds: Boolean = false,
var resize: Int = 0,

View file

@ -74,27 +74,6 @@ class PlayerSettingsActivity : AppCompatActivity() {
}
//Video
binding.playerSettingsVideoInfo.isChecked = settings.videoInfo
binding.playerSettingsVideoInfo.setOnCheckedChangeListener { _, isChecked ->
settings.videoInfo = isChecked
saveData(player, settings)
}
binding.playerSettingsQualityHeight.setText(
(loadData<Int>("maxHeight", toast = false) ?: 480).toString()
)
binding.playerSettingsQualityHeight.addTextChangedListener {
val height = binding.playerSettingsQualityHeight.text.toString().toIntOrNull()
saveData("maxHeight", height)
}
binding.playerSettingsQualityWidth.setText(
(loadData<Int>("maxWidth", toast = false) ?: 720).toString()
)
binding.playerSettingsQualityWidth.addTextChangedListener {
val height = binding.playerSettingsQualityWidth.text.toString().toIntOrNull()
saveData("maxWidth", height)
}
val speeds =
arrayOf(

View file

@ -90,134 +90,6 @@
android:paddingEnd="32dp"
android:text="@string/video" />
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/playerSettingsVideoInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:checked="true"
android:drawableStart="@drawable/ic_round_info_24"
android:drawablePadding="16dp"
app:drawableTint="?attr/colorPrimary"
android:elegantTextHeight="true"
android:fontFamily="@font/poppins_bold"
android:minHeight="64dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/video_info"
android:textAlignment="viewStart"
android:textColor="?attr/colorOnBackground"
app:cornerRadius="0dp"
app:showText="false"
app:thumbTint="@color/button_switch_track">
</com.google.android.material.materialswitch.MaterialSwitch>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-8dp"
android:layout_marginBottom="8dp"
android:alpha="0.58"
android:fontFamily="@font/poppins_family"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/video_info_info"
android:textSize="14sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:drawablePadding="16dp"
android:fontFamily="@font/poppins_bold"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/default_quality"
app:drawableStartCompat="@drawable/ic_round_high_quality_24"
app:drawableTint="?attr/colorPrimary" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="16dp"
android:orientation="horizontal">
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="54dp"
android:layout_weight="1"
android:hint="@string/height"
app:boxCornerRadiusBottomEnd="8dp"
app:boxCornerRadiusBottomStart="8dp"
app:boxCornerRadiusTopEnd="8dp"
app:boxCornerRadiusTopStart="8dp"
app:endIconMode="none"
app:hintAnimationEnabled="true">
<AutoCompleteTextView
android:id="@+id/playerSettingsQualityHeight"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/poppins_bold"
android:inputType="number"
android:maxLength="4"
android:padding="8dp"
android:textColor="?android:attr/textColorSecondary"
android:textSize="14sp"
tools:ignore="LabelFor,TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<View
android:layout_width="16dp"
android:layout_height="match_parent" />
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="54dp"
android:layout_weight="1"
android:hint="@string/width"
app:boxCornerRadiusBottomEnd="8dp"
app:boxCornerRadiusBottomStart="8dp"
app:boxCornerRadiusTopEnd="8dp"
app:boxCornerRadiusTopStart="8dp"
app:endIconMode="none"
app:hintAnimationEnabled="true">
<AutoCompleteTextView
android:id="@+id/playerSettingsQualityWidth"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/poppins_bold"
android:inputType="number"
android:maxLength="4"
android:padding="8dp"
android:textColor="?android:attr/textColorSecondary"
android:textSize="14sp"
tools:ignore="LabelFor,TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:alpha="0.58"
android:fontFamily="@font/poppins_family"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/default_quality_info"
android:textSize="14sp" />
<Button
android:id="@+id/playerSettingsSpeed"
style="@style/Widget.Material3.Button.TextButton"

View file

@ -383,34 +383,6 @@
</LinearLayout>
<TextView
android:id="@+id/exo_video_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:alpha="0.58"
android:maxLength="15"
android:ellipsize="marquee"
android:singleLine="true"
android:textAlignment="textEnd"
android:textColor="@color/bg_white"
android:textSize="12sp"
tools:ignore="TextContrastCheck"
tools:text="720x1080" />
<TextView
android:id="@+id/exo_server_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:alpha="0.58"
android:fontFamily="@font/poppins_bold"
android:textAlignment="textEnd"
android:textColor="@color/bg_white"
android:textSize="12sp"
tools:ignore="TextContrastCheck"
tools:text="@string/server_selector" />
<TextView
android:id="@+id/exo_video_info"
android:layout_width="match_parent"