X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fdialogs%2FSaveDialog.kt;fp=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fdialogs%2FSaveDialog.kt;h=dca20947c0ed69f644a917d75bca8cab0d0e9603;hp=c6dd64470bf3a60660f9a6633414245e890df38b;hb=e6befb69eb16e4c633623df508bfb9de370e204f;hpb=35dd941d73d9d72a1ae8c16add68f20615affada diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/SaveDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/SaveDialog.kt index c6dd6447..dca20947 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/SaveDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/SaveDialog.kt @@ -207,11 +207,11 @@ class SaveDialog : DialogFragment() { // Update the UI when the URL changes. urlEditText.addTextChangedListener(object : TextWatcher { - override fun beforeTextChanged(charSequence: CharSequence?, i: Int, i1: Int, i2: Int) { + override fun beforeTextChanged(charSequence: CharSequence?, start: Int, count: Int, after: Int) { // Do nothing. } - override fun onTextChanged(charSequence: CharSequence?, i: Int, i1: Int, i2: Int) { + override fun onTextChanged(charSequence: CharSequence?, start: Int, before: Int, count: Int) { // Do nothing. } @@ -230,7 +230,7 @@ class SaveDialog : DialogFragment() { blobUrlWarningTextView.visibility = View.GONE // Enable the save button if the edit texts are populated and this isn't a blob URL. - saveButton.isEnabled = urlToSave.isNotEmpty() && fileName.isNotEmpty() && !blobUrl + saveButton.isEnabled = urlToSave.isNotBlank() && fileName.isNotBlank() && !blobUrl // Determine if this is a data URL. val dataUrl = urlToSave.startsWith("data:") @@ -259,11 +259,11 @@ class SaveDialog : DialogFragment() { // Update the UI when the file name changes. fileNameEditText.addTextChangedListener(object : TextWatcher { - override fun beforeTextChanged(charSequence: CharSequence?, p1: Int, p2: Int, p3: Int) { + override fun beforeTextChanged(charSequence: CharSequence?, start: Int, count: Int, after: Int) { // Do nothing. } - override fun onTextChanged(charSequence: CharSequence?, p1: Int, p2: Int, p3: Int) { + override fun onTextChanged(charSequence: CharSequence?, start: Int, before: Int, count: Int) { // Do nothing. } @@ -276,7 +276,7 @@ class SaveDialog : DialogFragment() { val blobUrl = urlToSave.startsWith("blob:") // Enable the save button if the edit texts are populated and this isn't a blob URL (or a data URL using Android's download manager). - saveButton.isEnabled = urlToSave.isNotEmpty() && fileName.isNotEmpty() && !blobUrl && !dataUrlWarningTextView.isVisible + saveButton.isEnabled = urlToSave.isNotBlank() && fileName.isNotBlank() && !blobUrl && !dataUrlWarningTextView.isVisible } })