Skip to content

Commit 41bdd4c

Browse files
authored
Merge pull request #878 from wordpress-mobile/issue/samsung-clipboard
Resolved clipboard issue on Android 7.0
2 parents fb91508 + af1e734 commit 41bdd4c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,13 +1570,14 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
15701570
deleteInlineStyleFromTheBeginning()
15711571
}
15721572
}
1573-
// Fix for crash when pasting text on Samsung Devices running Android 8.
1574-
// Ref: https://github.com/wordpress-mobile/WordPress-Android/issues/8827
1573+
// Fix for crash when pasting text on Samsung Devices running Android 7 & 8.
1574+
// Android 7 Ref: https://github.com/wordpress-mobile/WordPress-Android/issues/10872
1575+
// Android 8 Ref: https://github.com/wordpress-mobile/WordPress-Android/issues/8827
15751576
clipboardIdentifier -> {
1576-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && Build.VERSION.SDK_INT < 28
1577+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && Build.VERSION.SDK_INT < Build.VERSION_CODES.P
15771578
&& Build.MANUFACTURER.toLowerCase().equals("samsung")) {
15781579
// Nope return true
1579-
Toast.makeText(context, R.string.samsung_disabled_custom_clipboard, Toast.LENGTH_LONG).show()
1580+
Toast.makeText(context, context.getString(R.string.samsung_disabled_custom_clipboard, Build.VERSION.RELEASE), Toast.LENGTH_LONG).show()
15801581
} else {
15811582
return super.onTextContextMenuItem(id)
15821583
}

aztec/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!-- GENERAL -->
44
<string name="cursor_moved">Cursor moved</string>
5-
<string name="samsung_disabled_custom_clipboard">Sorry, this feature is disabled on Android 8. Please use the Paste action instead.</string>
5+
<string name="samsung_disabled_custom_clipboard">Sorry, this feature is disabled on Android %1$s. Please use the Paste action instead.</string>
66

77
<!-- LINK DIALOG -->
88
<string name="link_dialog_title">Insert link</string>

0 commit comments

Comments
 (0)