Skip to content

Commit

Permalink
removed quality selector
Browse files Browse the repository at this point in the history
  • Loading branch information
aayush2622 committed Jan 26, 2024
1 parent 00ce6ce commit 4a5eab1
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 203 deletions.
24 changes: 0 additions & 24 deletions app/src/main/java/ani/dantotsu/media/anime/ExoplayerView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/ani/dantotsu/settings/PlayerSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
21 changes: 0 additions & 21 deletions app/src/main/java/ani/dantotsu/settings/PlayerSettingsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
128 changes: 0 additions & 128 deletions app/src/main/res/layout/activity_player_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
28 changes: 0 additions & 28 deletions app/src/main/res/layout/exo_player_control_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4a5eab1

Please sign in to comment.