X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fdialogs%2FViewRequestDialog.kt;fp=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fdialogs%2FViewRequestDialog.kt;h=8c9aed2f581c55b5a0adbc156b25a72fdda099a7;hp=55e6bb585a31bd79a7f4dc8ea262cb2c9d5b39e6;hb=dc36dea65a4eb37496fb1ecbbd9f8e1906f50216;hpb=12042264a50769030361cf51b0ac197050209f0f diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewRequestDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewRequestDialog.kt index 55e6bb58..8c9aed2f 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewRequestDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewRequestDialog.kt @@ -1,5 +1,5 @@ /* - * Copyright 2018-2022 Soren Stoutner . + * Copyright 2018-2023 Soren Stoutner . * * This file is part of Privacy Browser Android . * @@ -41,29 +41,7 @@ private const val IS_LAST_REQUEST = "is_last_request" private const val REQUEST_DETAILS = "request_details" class ViewRequestDialog : DialogFragment() { - // Define the class variables. - private lateinit var viewRequestListener: ViewRequestListener - - // The public interface is used to send information back to the parent activity. - interface ViewRequestListener { - // Show the previous request. - fun onPrevious(currentId: Int) - - // Show the next request. - fun onNext(currentId: Int) - } - - override fun onAttach(context: Context) { - // Run the default commands. - super.onAttach(context) - - // Get a handle for the listener from the launching context. - viewRequestListener = context as ViewRequestListener - } - companion object { - // `@JvmStatic` will no longer be required once all the code has transitioned to Kotlin. - @JvmStatic fun request(id: Int, isLastRequest: Boolean, requestDetails: Array): ViewRequestDialog { // Create a bundle. val bundle = Bundle() @@ -84,6 +62,26 @@ class ViewRequestDialog : DialogFragment() { } } + // Define the class variables. + private lateinit var viewRequestListener: ViewRequestListener + + // The public interface is used to send information back to the parent activity. + interface ViewRequestListener { + // Show the previous request. + fun onPrevious(currentId: Int) + + // Show the next request. + fun onNext(currentId: Int) + } + + override fun onAttach(context: Context) { + // Run the default commands. + super.onAttach(context) + + // Get a handle for the listener from the launching context. + viewRequestListener = context as ViewRequestListener + } + override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { // Get the arguments from the bundle. val id = requireArguments().getInt(ID)