diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
index 65278943..52791941 100644
--- a/.idea/codeStyles/Project.xml
+++ b/.idea/codeStyles/Project.xml
@@ -9,8 +9,9 @@
-
-
+
+
+
@@ -200,4 +201,4 @@
-
+
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
index 6e6eec11..79ee123c 100644
--- a/.idea/codeStyles/codeStyleConfig.xml
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -1,6 +1,5 @@
-
\ No newline at end of file
diff --git a/tangem-sdk-android/src/main/java/com/tangem/sdk/ui/common/TextInputEditTextExt.kt b/tangem-sdk-android/src/main/java/com/tangem/sdk/ui/common/TextInputEditTextExt.kt
new file mode 100644
index 00000000..9a9fad61
--- /dev/null
+++ b/tangem-sdk-android/src/main/java/com/tangem/sdk/ui/common/TextInputEditTextExt.kt
@@ -0,0 +1,41 @@
+package com.tangem.sdk.ui.common
+
+import android.os.Build
+import android.view.ActionMode
+import android.view.Menu
+import android.view.MenuItem
+import android.view.View
+import com.google.android.material.textfield.TextInputEditText
+import com.tangem.sdk.R
+
+internal fun TextInputEditText.disableContextMenu() {
+ setOnCreateContextMenuListener { _, _, _ -> }
+
+ customInsertionActionModeCallback = EmptyActionModeCallback
+ customSelectionActionModeCallback = EmptyActionModeCallback
+
+ setTextIsSelectable(false)
+
+ isLongClickable = false
+ setOnLongClickListener { false }
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
+ setTextSelectHandle(R.drawable.empty_text_selector)
+ setTextSelectHandleLeft(R.drawable.empty_text_selector)
+ setTextSelectHandleRight(R.drawable.empty_text_selector)
+ }
+}
+
+internal fun TextInputEditText.disableAutofill() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ setAutofillHints(null)
+ importantForAutofill = View.IMPORTANT_FOR_AUTOFILL_NO
+ }
+}
+
+private object EmptyActionModeCallback : ActionMode.Callback {
+ override fun onCreateActionMode(mode: ActionMode?, menu: Menu?): Boolean = false
+ override fun onPrepareActionMode(mode: ActionMode?, menu: Menu?): Boolean = false
+ override fun onActionItemClicked(mode: ActionMode?, item: MenuItem?): Boolean = false
+ override fun onDestroyActionMode(mode: ActionMode?) = Unit
+}
diff --git a/tangem-sdk-android/src/main/java/com/tangem/sdk/ui/widget/PinCodeModificationWidget.kt b/tangem-sdk-android/src/main/java/com/tangem/sdk/ui/widget/PinCodeModificationWidget.kt
index 3ed30f36..561fa1a0 100644
--- a/tangem-sdk-android/src/main/java/com/tangem/sdk/ui/widget/PinCodeModificationWidget.kt
+++ b/tangem-sdk-android/src/main/java/com/tangem/sdk/ui/widget/PinCodeModificationWidget.kt
@@ -18,6 +18,8 @@ import com.tangem.sdk.SessionViewDelegateState
import com.tangem.sdk.extensions.hideSoftKeyboard
import com.tangem.sdk.extensions.showSoftKeyboard
import com.tangem.sdk.postUI
+import com.tangem.sdk.ui.common.disableAutofill
+import com.tangem.sdk.ui.common.disableContextMenu
/**
* Created by Anton Zhilenkov on 05/08/2020.
@@ -32,7 +34,6 @@ class PinCodeModificationWidget(
private val tvScreenTitle: TextView = mainView.findViewById(R.id.tvScreenTitle)
private val tilPinCode: TextInputLayout = mainView.findViewById(R.id.tilPinCode)
- private val tilNewPinCode: TextInputLayout = mainView.findViewById(R.id.tilNewPinCode)
private val tilPinCodeConfirm: TextInputLayout = mainView.findViewById(R.id.tilPinCodeConfirm)
private val etPinCode: TextInputEditText = mainView.findViewById(R.id.etPinCode)
@@ -51,6 +52,12 @@ class PinCodeModificationWidget(
init {
setStateByMode()
setupInnerLogic()
+
+ etPinCode.disableContextMenu()
+ etPinCodeConfirm.disableContextMenu()
+
+ etPinCode.disableAutofill()
+ etPinCodeConfirm.disableAutofill()
}
override fun setState(params: SessionViewDelegateState) {
@@ -73,7 +80,6 @@ class PinCodeModificationWidget(
Mode.SET -> {
tvScreenTitle.text = getFormattedString(R.string.pin_set_code_format, nameOfPin)
tilPinCode.hint = nameOfPin
- tilNewPinCode.visibility = View.GONE
tilPinCodeConfirm.hint = getFormattedString(R.string.pin_set_code_confirm_format, nameOfPin)
btnSave.text = getString(R.string.common_continue)
}
@@ -81,7 +87,6 @@ class PinCodeModificationWidget(
tvScreenTitle.text = getFormattedString(R.string.pin_change_new_code_format, nameOfPin)
tilPinCode.hint = nameOfPin
etPinCode.inputType = InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
- tilNewPinCode.visibility = View.GONE
tilPinCodeConfirm.hint = getFormattedString(R.string.pin_set_code_confirm_format, nameOfPin)
etPinCodeConfirm.inputType = InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
btnSave.text = getString(R.string.common_continue)
diff --git a/tangem-sdk-android/src/main/java/com/tangem/sdk/ui/widget/PinCodeRequestWidget.kt b/tangem-sdk-android/src/main/java/com/tangem/sdk/ui/widget/PinCodeRequestWidget.kt
index 3991b908..bab43e06 100644
--- a/tangem-sdk-android/src/main/java/com/tangem/sdk/ui/widget/PinCodeRequestWidget.kt
+++ b/tangem-sdk-android/src/main/java/com/tangem/sdk/ui/widget/PinCodeRequestWidget.kt
@@ -17,6 +17,8 @@ import com.tangem.sdk.extensions.localizedDescription
import com.tangem.sdk.extensions.show
import com.tangem.sdk.extensions.showSoftKeyboard
import com.tangem.sdk.postUI
+import com.tangem.sdk.ui.common.disableAutofill
+import com.tangem.sdk.ui.common.disableContextMenu
/**
* Created by Anton Zhilenkov on 09/08/2020.
@@ -29,23 +31,24 @@ class PinCodeRequestWidget(mainView: View) : BaseSessionDelegateStateWidget(main
private val etPinCode = mainView.findViewById(R.id.etPinCode)
private val btnContinue = mainView.findViewById