diff --git a/app/src/main/java/com/github/libretube/AddtoPlaylistDialog.kt b/app/src/main/java/com/github/libretube/AddtoPlaylistDialog.kt index 8358525ea..2e1ad5499 100644 --- a/app/src/main/java/com/github/libretube/AddtoPlaylistDialog.kt +++ b/app/src/main/java/com/github/libretube/AddtoPlaylistDialog.kt @@ -7,7 +7,6 @@ import android.util.Log import android.util.TypedValue import android.view.View import android.widget.* -import androidx.appcompat.app.AlertDialog import androidx.core.text.HtmlCompat import androidx.fragment.app.DialogFragment import androidx.fragment.app.Fragment diff --git a/app/src/main/java/com/github/libretube/DownloadDialog.kt b/app/src/main/java/com/github/libretube/DownloadDialog.kt index fffbb7f4e..18c693f6b 100644 --- a/app/src/main/java/com/github/libretube/DownloadDialog.kt +++ b/app/src/main/java/com/github/libretube/DownloadDialog.kt @@ -7,7 +7,6 @@ import android.util.Log import android.util.TypedValue import android.view.View import android.widget.* -import androidx.appcompat.app.AlertDialog import androidx.core.text.HtmlCompat import androidx.fragment.app.DialogFragment import com.google.android.material.dialog.MaterialAlertDialogBuilder diff --git a/app/src/main/java/com/github/libretube/LoginDialog.kt b/app/src/main/java/com/github/libretube/LoginDialog.kt index 0cf6b3db7..e4bea2cba 100644 --- a/app/src/main/java/com/github/libretube/LoginDialog.kt +++ b/app/src/main/java/com/github/libretube/LoginDialog.kt @@ -10,16 +10,13 @@ import android.widget.Button import android.widget.EditText import android.widget.TextView import android.widget.Toast -import androidx.appcompat.app.AlertDialog import androidx.core.text.HtmlCompat import androidx.fragment.app.DialogFragment import androidx.lifecycle.lifecycleScope import com.github.libretube.obj.Login import com.google.android.material.dialog.MaterialAlertDialogBuilder -import org.w3c.dom.Text import retrofit2.HttpException import java.io.IOException -import java.lang.Exception class LoginDialog : DialogFragment() { private val TAG = "LoginDialog" diff --git a/app/src/main/java/com/github/libretube/PlayerFragment.kt b/app/src/main/java/com/github/libretube/PlayerFragment.kt index a34872143..a1c218dda 100644 --- a/app/src/main/java/com/github/libretube/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/PlayerFragment.kt @@ -20,7 +20,6 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.* -import androidx.appcompat.app.AlertDialog import androidx.constraintlayout.motion.widget.MotionLayout import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.app.ActivityCompat @@ -59,12 +58,12 @@ 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 org.chromium.net.CronetEngine +import retrofit2.HttpException import java.io.IOException import java.net.URLEncoder import java.util.concurrent.Executors import kotlin.math.abs -import org.chromium.net.CronetEngine -import retrofit2.HttpException var isFullScreen = false diff --git a/app/src/main/java/com/github/libretube/SearchFragment.kt b/app/src/main/java/com/github/libretube/SearchFragment.kt index 2ae30fd63..9db4e0d82 100644 --- a/app/src/main/java/com/github/libretube/SearchFragment.kt +++ b/app/src/main/java/com/github/libretube/SearchFragment.kt @@ -12,9 +12,10 @@ import android.view.ViewGroup import android.view.WindowManager import android.view.inputmethod.EditorInfo import android.view.inputmethod.InputMethodManager -import android.widget.* +import android.widget.ArrayAdapter +import android.widget.AutoCompleteTextView +import android.widget.ImageView import android.widget.TextView.* -import androidx.appcompat.app.AlertDialog import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope import androidx.preference.PreferenceManager @@ -23,12 +24,12 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.github.libretube.adapters.SearchAdapter import com.github.libretube.adapters.SearchHistoryAdapter -import java.io.IOException import com.google.android.material.dialog.MaterialAlertDialogBuilder 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" diff --git a/app/src/main/java/com/github/libretube/SettingsActivity.kt b/app/src/main/java/com/github/libretube/SettingsActivity.kt index ef81ffde2..24d621647 100644 --- a/app/src/main/java/com/github/libretube/SettingsActivity.kt +++ b/app/src/main/java/com/github/libretube/SettingsActivity.kt @@ -1,7 +1,6 @@ package com.github.libretube import android.Manifest -import android.app.AlertDialog import android.content.* import android.content.pm.PackageManager import android.net.Uri @@ -18,20 +17,20 @@ import androidx.appcompat.app.AppCompatActivity import androidx.core.app.ActivityCompat import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment -import com.google.android.material.color.DynamicColors import androidx.lifecycle.lifecycleScope import androidx.preference.ListPreference import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceManager +import com.google.android.material.color.DynamicColors import com.google.android.material.dialog.MaterialAlertDialogBuilder +import org.json.JSONObject +import org.json.JSONTokener +import retrofit2.HttpException import java.io.IOException import java.io.InputStream import java.util.zip.ZipEntry import java.util.zip.ZipInputStream -import org.json.JSONObject -import org.json.JSONTokener -import retrofit2.HttpException class SettingsActivity : AppCompatActivity(), diff --git a/app/src/main/java/com/github/libretube/adapters/PlaylistsAdapter.kt b/app/src/main/java/com/github/libretube/adapters/PlaylistsAdapter.kt index 19dcfeb1f..7ac6b366c 100644 --- a/app/src/main/java/com/github/libretube/adapters/PlaylistsAdapter.kt +++ b/app/src/main/java/com/github/libretube/adapters/PlaylistsAdapter.kt @@ -8,7 +8,6 @@ import android.view.View import android.view.ViewGroup import android.widget.ImageView import android.widget.TextView -import androidx.appcompat.app.AlertDialog import androidx.core.os.bundleOf import androidx.recyclerview.widget.RecyclerView import com.github.libretube.MainActivity @@ -16,11 +15,12 @@ import com.github.libretube.R import com.github.libretube.RetrofitInstance import com.github.libretube.obj.PlaylistId import com.github.libretube.obj.Playlists +import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.squareup.picasso.Picasso -import java.io.IOException import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch import retrofit2.HttpException +import java.io.IOException class PlaylistsAdapter( private val playlists: MutableList, @@ -47,7 +47,7 @@ class PlaylistsAdapter( Picasso.get().load(playlist.thumbnail).into(thumbnailImage) holder.v.findViewById(R.id.playlist_title).text = playlist.name holder.v.findViewById(R.id.delete_playlist).setOnClickListener { - val builder = AlertDialog.Builder(holder.v.context) + val builder = MaterialAlertDialogBuilder(holder.v.context) builder.setTitle(R.string.deletePlaylist) builder.setMessage(R.string.areYouSure) builder.setPositiveButton(R.string.yes) { dialog, which ->