X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fdialogs%2FCreateHomeScreenShortcutDialog.kt;h=32c4e51a20bf7545c146abc73bd0eef930799579;hb=031def95c6d9bfc14113fe86b4a5690233d93ce2;hp=21e40d47f0a1a19311d87fbf55b056306f2bb69d;hpb=bc2e180db377eedadbe1ea455d8fb311ead8f9d6;p=PrivacyBrowserAndroid.git diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateHomeScreenShortcutDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateHomeScreenShortcutDialog.kt index 21e40d47..32c4e51a 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateHomeScreenShortcutDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateHomeScreenShortcutDialog.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2015-2020 Soren Stoutner . + * Copyright © 2015-2021 Soren Stoutner . * * This file is part of Privacy Browser . * @@ -50,19 +50,19 @@ import com.stoutner.privacybrowser.R import java.io.ByteArrayOutputStream -// Declare the class constants. +// Define the class constants. private const val SHORTCUT_NAME = "shortcut_name" private const val URL_STRING = "url_string" private const val FAVORITE_ICON_BYTE_ARRAY = "favorite_icon_byte_array" -class CreateHomeScreenShortcutDialog: DialogFragment() { +class CreateHomeScreenShortcutDialog : DialogFragment() { // Declare the class views. private lateinit var shortcutNameEditText: EditText private lateinit var urlEditText: EditText private lateinit var openWithPrivacyBrowserRadioButton: RadioButton companion object { - // `@JvmStatic` will no longer be required once all the code has transitioned to Kotlin. Also, the function can then be moved out of a companion object and just become a package-level function. + // `@JvmStatic` will no longer be required once all the code has transitioned to Kotlin. @JvmStatic fun createDialog(shortcutName: String, urlString: String, favoriteIconBitmap: Bitmap): CreateHomeScreenShortcutDialog { // Create a favorite icon byte array output stream. @@ -118,7 +118,7 @@ class CreateHomeScreenShortcutDialog: DialogFragment() { dialogBuilder.setIcon(favoriteIconDrawable) // Set the view. The parent view is null because it will be assigned by the alert dialog. - dialogBuilder.setView(requireActivity().layoutInflater.inflate(R.layout.create_home_screen_shortcut_dialog, null)) + dialogBuilder.setView(layoutInflater.inflate(R.layout.create_home_screen_shortcut_dialog, null)) // Set a listener on the close button. Using null closes the dialog without doing anything else. dialogBuilder.setNegativeButton(R.string.cancel, null)