Imporoved quality selector dialog

This commit is contained in:
archroid 2022-05-20 19:01:14 +04:30
parent bd1a5831d9
commit a9858e0728
No known key found for this signature in database
GPG Key ID: D8EE5C11EDF911B1

View File

@ -57,6 +57,7 @@ import com.google.android.exoplayer2.upstream.DefaultDataSource
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource
import com.google.android.exoplayer2.util.RepeatModeUtil
import com.google.android.material.button.MaterialButton
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.squareup.picasso.Picasso
import java.io.IOException
import java.net.URLEncoder
@ -505,8 +506,8 @@ class PlayerFragment : Fragment() {
view.findViewById<ImageButton>(R.id.quality_select).setOnClickListener {
// Dialog for quality selection
val builder: AlertDialog.Builder? = activity?.let {
AlertDialog.Builder(it)
val builder: MaterialAlertDialogBuilder? = activity?.let {
MaterialAlertDialogBuilder(it)
}
var lastPosition = exoPlayer.currentPosition
builder!!.setTitle(R.string.choose_quality_dialog)
@ -565,7 +566,7 @@ class PlayerFragment : Fragment() {
videosNameArray[which]
}
)
val dialog: AlertDialog? = builder?.create()
val dialog = builder?.create()
dialog?.show()
}
// Listener for play and pause icon change