Commit e7662227 authored by Marcin Wiącek's avatar Marcin Wiącek
Browse files

Pasting URL to URL bar without formatting (Android M and higher)

parent 7c163d86
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -677,6 +677,14 @@ open class InlineAutocompleteEditText @JvmOverloads constructor(
        windowFocusChangeListener?.invoke(hasFocus)
    }

    override fun onTextContextMenuItem(id: Int): Boolean {
        var newId = id
        if (newId == android.R.id.paste && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            newId = android.R.id.pasteAsPlainText
        }
        return super.onTextContextMenuItem(newId)
    }

    @Suppress("ClickableViewAccessibility")
    override fun onTouchEvent(event: MotionEvent): Boolean {
        return if (Build.VERSION.SDK_INT == Build.VERSION_CODES.M &&