mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
cleanup
This commit is contained in:
parent
c996b584a5
commit
283e74062d
@ -17,7 +17,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.squareup.picasso.Picasso
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import retrofit2.HttpException
|
||||
import java.io.IOException
|
||||
|
@ -7,8 +7,6 @@ import android.util.Log
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.obj.PlaylistId
|
||||
import com.github.libretube.preferences.PreferenceHelper
|
||||
@ -16,7 +14,6 @@ import com.github.libretube.util.RetrofitInstance
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import retrofit2.HttpException
|
||||
import java.io.IOException
|
||||
|
@ -43,14 +43,14 @@ class VideoOptionsDialog(private val videoId: String, context: Context) : Dialog
|
||||
) { _, which ->
|
||||
// For now, this checks the position of the option with the position that is in the
|
||||
// list. I don't like it, but we will do like this for now.
|
||||
when (which) {
|
||||
when (optionsList[which]) {
|
||||
// This for example will be the "Background mode" option
|
||||
0 -> {
|
||||
context?.getString(R.string.playOnBackground) -> {
|
||||
BackgroundMode.getInstance()
|
||||
.playOnBackgroundMode(requireContext(), videoId)
|
||||
}
|
||||
// Add Video to Playlist Dialog
|
||||
1 -> {
|
||||
context?.getString(R.string.addToPlaylist) -> {
|
||||
val token = PreferenceHelper.getToken(requireContext())
|
||||
if (token != "") {
|
||||
val newFragment = AddtoPlaylistDialog()
|
||||
@ -62,7 +62,7 @@ class VideoOptionsDialog(private val videoId: String, context: Context) : Dialog
|
||||
Toast.makeText(context, R.string.login_first, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
2 -> {
|
||||
context?.getString(R.string.share) -> {
|
||||
val shareDialog = ShareDialog(videoId, false)
|
||||
// using parentFragmentManager is important here
|
||||
shareDialog.show(parentFragmentManager, "ShareDialog")
|
||||
|
Loading…
x
Reference in New Issue
Block a user