mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-29 03:32:42 +00:00
More deprecation warnings.
This commit is contained in:
parent
1ea0e67785
commit
ec9aafe0df
@ -22,6 +22,7 @@ import io.casey.musikcube.remote.ui.settings.model.Connection
|
||||
import io.casey.musikcube.remote.ui.settings.model.ConnectionsDb
|
||||
import io.casey.musikcube.remote.ui.shared.activity.BaseActivity
|
||||
import io.casey.musikcube.remote.ui.shared.extension.*
|
||||
import io.casey.musikcube.remote.util.getParcelableCompat
|
||||
import javax.inject.Inject
|
||||
|
||||
private const val EXTRA_CONNECTION = "extra_connection"
|
||||
@ -196,12 +197,12 @@ private class RenameTask(val db: ConnectionsDb, val connection: Connection, val
|
||||
|
||||
class ConfirmDeleteDialog : DialogFragment() {
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val connection = arguments!!.getParcelable<Connection>(EXTRA_CONNECTION)
|
||||
val connection = requireArguments().getParcelableCompat<Connection>(EXTRA_CONNECTION)
|
||||
|
||||
return when (connection == null) {
|
||||
true -> throw IllegalArgumentException("invalid connection")
|
||||
else -> {
|
||||
AlertDialog.Builder(activity!!)
|
||||
AlertDialog.Builder(requireActivity())
|
||||
.setTitle(R.string.settings_confirm_delete_title)
|
||||
.setMessage(getString(R.string.settings_confirm_delete_message, connection.name))
|
||||
.setNegativeButton(R.string.button_no, null)
|
||||
@ -229,7 +230,7 @@ class ConfirmDeleteDialog : DialogFragment() {
|
||||
|
||||
class RenameDialog : DialogFragment() {
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val connection = arguments!!.getParcelable<Connection>(EXTRA_CONNECTION)
|
||||
val connection = requireArguments().getParcelableCompat<Connection>(EXTRA_CONNECTION)
|
||||
|
||||
return when (connection == null) {
|
||||
true -> throw IllegalArgumentException("invalid connection")
|
||||
@ -242,7 +243,7 @@ class RenameDialog : DialogFragment() {
|
||||
edit.setText(connection.name)
|
||||
edit.selectAll()
|
||||
|
||||
AlertDialog.Builder(activity!!)
|
||||
AlertDialog.Builder(requireActivity())
|
||||
.setTitle(R.string.settings_save_as_title)
|
||||
.setNegativeButton(R.string.button_cancel) { _, _ -> hideKeyboard() }
|
||||
.setOnCancelListener { hideKeyboard() }
|
||||
|
Loading…
x
Reference in New Issue
Block a user