X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Ffragments%2FAboutVersionFragment.kt;h=b0f47002a6f622755ed29ef5d8a17547bcf32318;hp=2bac1522ca729b56807249a59438c7169a57796f;hb=dc36dea65a4eb37496fb1ecbbd9f8e1906f50216;hpb=12042264a50769030361cf51b0ac197050209f0f diff --git a/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutVersionFragment.kt b/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutVersionFragment.kt index 2bac1522..b0f47002 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutVersionFragment.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutVersionFragment.kt @@ -27,7 +27,6 @@ import android.content.ClipboardManager import android.content.Context import android.content.Intent import android.content.pm.PackageManager -import android.net.Uri import android.os.Build import android.os.Bundle import android.os.Handler @@ -160,7 +159,7 @@ class AboutVersionFragment : Fragment() { } // Define the save about version text activity result launcher. It must be defined before `onCreate()` is run or the app will crash. - private val saveAboutVersionTextActivityResultLauncher = registerForActivityResult(ActivityResultContracts.CreateDocument("text/plain")) { fileUri: Uri? -> + private val saveAboutVersionTextActivityResultLauncher = registerForActivityResult(ActivityResultContracts.CreateDocument("text/plain")) { fileUri -> // Only save the file if the URI is not null, which happens if the user exited the file picker by pressing back. if (fileUri != null) { // Initialize the file name string from the file URI last path segment. @@ -209,7 +208,7 @@ class AboutVersionFragment : Fragment() { } // Define the save about version image activity result launcher. It must be defined before `onCreate()` is run or the app will crash. - private val saveAboutVersionImageActivityResultLauncher = registerForActivityResult(ActivityResultContracts.CreateDocument("image/png")) { fileUri: Uri? -> + private val saveAboutVersionImageActivityResultLauncher = registerForActivityResult(ActivityResultContracts.CreateDocument("image/png")) { fileUri -> // Save the file if the URI is not null, which happens if the user exits the file picker by pressing back. if (fileUri != null) SaveAboutVersionImageCoroutine.saveImage(requireActivity(), fileUri, aboutVersionLayout.findViewById(R.id.about_version_linearlayout))