mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
ktlint
This commit is contained in:
parent
16cccc0a5d
commit
a5c0f3154b
@ -27,11 +27,11 @@ import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.libretube.adapters.SearchAdapter
|
||||
import com.github.libretube.adapters.SearchHistoryAdapter
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import java.io.IOException
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import retrofit2.HttpException
|
||||
import java.io.IOException
|
||||
|
||||
class SearchFragment : Fragment() {
|
||||
private val TAG = "SearchFragment"
|
||||
|
@ -9,7 +9,6 @@ import android.widget.Toast
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.preference.PreferenceManager
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import java.net.URLEncoder
|
||||
|
||||
/**
|
||||
* Dialog with different options for a selected video.
|
||||
@ -52,11 +51,12 @@ class VideoOptionsDialog(private val videoId: String, context: Context) : Dialog
|
||||
}
|
||||
// Add Video to Playlist Dialog
|
||||
1 -> {
|
||||
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
|
||||
val sharedPreferences = PreferenceManager
|
||||
.getDefaultSharedPreferences(requireContext())
|
||||
val token = sharedPreferences.getString("token", "")
|
||||
if (token != "") {
|
||||
val newFragment = AddtoPlaylistDialog()
|
||||
var bundle = Bundle()
|
||||
val bundle = Bundle()
|
||||
bundle.putString("videoId", videoId)
|
||||
newFragment.arguments = bundle
|
||||
newFragment.show(parentFragmentManager, "AddToPlaylist")
|
||||
@ -65,6 +65,7 @@ class VideoOptionsDialog(private val videoId: String, context: Context) : Dialog
|
||||
}
|
||||
}
|
||||
2 -> {
|
||||
/* crashes
|
||||
val sharedPreferences =
|
||||
PreferenceManager.getDefaultSharedPreferences(requireContext())
|
||||
val instancePref = sharedPreferences.getString(
|
||||
@ -77,8 +78,6 @@ class VideoOptionsDialog(private val videoId: String, context: Context) : Dialog
|
||||
getString(R.string.instance),
|
||||
getString(R.string.youtube)
|
||||
)
|
||||
/*
|
||||
// crashes
|
||||
MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle(getString(R.string.share))
|
||||
.setItems(
|
||||
@ -101,7 +100,10 @@ class VideoOptionsDialog(private val videoId: String, context: Context) : Dialog
|
||||
*/
|
||||
val intent = Intent()
|
||||
intent.action = Intent.ACTION_SEND
|
||||
intent.putExtra(Intent.EXTRA_TEXT, "https://piped.kavin.rocks/watch?v=$videoId")
|
||||
intent.putExtra(
|
||||
Intent.EXTRA_TEXT,
|
||||
"https://piped.kavin.rocks/watch?v=$videoId"
|
||||
)
|
||||
intent.type = "text/plain"
|
||||
startActivity(Intent.createChooser(intent, "Share Url To:"))
|
||||
}
|
||||
|
@ -11,10 +11,13 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.libretube.*
|
||||
import com.github.libretube.MainActivity
|
||||
import com.github.libretube.PlayerFragment
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.VideoOptionsDialog
|
||||
import com.github.libretube.formatShort
|
||||
import com.github.libretube.obj.SearchItem
|
||||
import com.squareup.picasso.Picasso
|
||||
import kotlinx.coroutines.NonDisposableHandle.parent
|
||||
|
||||
class SearchAdapter(
|
||||
private val searchItems: MutableList<SearchItem>,
|
||||
|
Loading…
x
Reference in New Issue
Block a user