Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolved clipboard issue on Android 7.0 #878

Merged
merged 3 commits into from
Dec 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1559,13 +1559,14 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
deleteInlineStyleFromTheBeginning()
}
}
// Fix for crash when pasting text on Samsung Devices running Android 8.
// Ref: https://github.com/wordpress-mobile/WordPress-Android/issues/8827
// Fix for crash when pasting text on Samsung Devices running Android 7 & 8.
// Android 7 Ref: https://github.com/wordpress-mobile/WordPress-Android/issues/10872
// Android 8 Ref: https://github.com/wordpress-mobile/WordPress-Android/issues/8827
clipboardIdentifier -> {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && Build.VERSION.SDK_INT < 28
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && Build.VERSION.SDK_INT < Build.VERSION_CODES.P
&& Build.MANUFACTURER.toLowerCase().equals("samsung")) {
// Nope return true
Toast.makeText(context, R.string.samsung_disabled_custom_clipboard, Toast.LENGTH_LONG).show()
Toast.makeText(context, context.getString(R.string.samsung_disabled_custom_clipboard, Build.VERSION.RELEASE), Toast.LENGTH_LONG).show()
} else {
return super.onTextContextMenuItem(id)
}
Expand Down
2 changes: 1 addition & 1 deletion aztec/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- GENERAL -->
<string name="cursor_moved">Cursor moved</string>
<string name="samsung_disabled_custom_clipboard">Sorry, this feature is disabled on Android 8. Please use the Paste action instead.</string>
<string name="samsung_disabled_custom_clipboard">Sorry, this feature is disabled on Android %1$s. Please use the Paste action instead.</string>
malinajirka marked this conversation as resolved.
Show resolved Hide resolved

<!-- LINK DIALOG -->
<string name="link_dialog_title">Insert link</string>
Expand Down