X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fdialogs%2FSaveDialog.kt;h=77cd1c1acb7b16434b6c7614b58e71842450cb72;hp=c6dd64470bf3a60660f9a6633414245e890df38b;hb=HEAD;hpb=6696d6946875515ae71c46a62dede4df44ad4351 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 } })