For #25808: Suppress onBackPressed deprecation.

This commit is contained in:
mcarare 2022-11-16 13:29:36 +02:00 committed by mergify[bot]
parent 2e9fd871d6
commit 5ddeba154c
5 changed files with 6 additions and 0 deletions

View File

@ -70,6 +70,7 @@ class BookmarkSearchDialogFragment : AppCompatDialogFragment(), UserInteractionH
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return object : Dialog(requireContext(), this.theme) {
@Deprecated("Deprecated in Java")
override fun onBackPressed() {
this@BookmarkSearchDialogFragment.onBackPressed()
}

View File

@ -70,6 +70,7 @@ class HistorySearchDialogFragment : AppCompatDialogFragment(), UserInteractionHa
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return object : Dialog(requireContext(), this.theme) {
@Deprecated("Deprecated in Java")
override fun onBackPressed() {
this@HistorySearchDialogFragment.onBackPressed()
}

View File

@ -154,6 +154,7 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return object : Dialog(requireContext(), this.theme) {
@Deprecated("Deprecated in Java")
override fun onBackPressed() {
this@SearchDialogFragment.onBackPressed()
}

View File

@ -16,6 +16,7 @@ class TabsTrayDialog(
theme: Int,
private val interactor: () -> BrowserTrayInteractor,
) : Dialog(context, theme) {
@Deprecated("Deprecated in Java")
override fun onBackPressed() {
if (interactor.invoke().onBackPressed()) {
return

View File

@ -163,6 +163,7 @@ class TrackingProtectionPanelDialogFragment : AppCompatDialogFragment(), UserInt
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return if (args.gravity == Gravity.BOTTOM) {
object : BottomSheetDialog(requireContext(), this.theme) {
@Deprecated("Deprecated in Java")
override fun onBackPressed() {
this@TrackingProtectionPanelDialogFragment.onBackPressed()
}
@ -176,6 +177,7 @@ class TrackingProtectionPanelDialogFragment : AppCompatDialogFragment(), UserInt
}
} else {
object : Dialog(requireContext()) {
@Deprecated("Deprecated in Java")
override fun onBackPressed() {
this@TrackingProtectionPanelDialogFragment.onBackPressed()
}