Skip to content

Commit 1b6e4b9

Browse files
authored
Merge pull request #797 from wordpress-mobile/merge-release/1.3.22-master
Merge release/1.3.22 into master
2 parents b4c7478 + 026e41e commit 1b6e4b9

File tree

5 files changed

+21
-43
lines changed

5 files changed

+21
-43
lines changed

.travis.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Changelog
2+
## [v1.3.22](https://github.com/wordpress-mobile/AztecEditor-Android/releases/tag/v1.3.22)
3+
### Fixed
4+
- Fix for crash on Samsung Clipboard ListView on Android 8.X #795
5+
26
## [v1.3.21](https://github.com/wordpress-mobile/AztecEditor-Android/releases/tag/v1.3.21)
37
### Changed
48
- Some performance improvements, mostly visible via the WPAndroid app https://github.com/wordpress-mobile/gutenberg-mobile/issues/672

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<h1><img align="center" width=50px height=50px src="https://github.com/wordpress-mobile/AztecEditor-iOS/raw/develop/RepoAssets/aztec.png" alt="Aztec Logo"/>&nbsp;Aztec: Native HTML Editor for Android</h1>
22

3-
[![Build Status](https://travis-ci.org/wordpress-mobile/AztecEditor-Android.svg?branch=develop)](https://travis-ci.org/wordpress-mobile/AztecEditor-Android)
3+
[![CircleCI](https://circleci.com/gh/wordpress-mobile/AztecEditor-Android.svg?style=svg)](https://circleci.com/gh/wordpress-mobile/AztecEditor-Android)
44

55
Aztec (which extends EditText) is a rich-text editor component for writing HTML
66
documents in Android.
@@ -105,7 +105,7 @@ repositories {
105105
```
106106
```gradle
107107
dependencies {
108-
api ('com.github.wordpress-mobile.WordPress-Aztec-Android:aztec:v1.3.21')
108+
api ('com.github.wordpress-mobile.WordPress-Aztec-Android:aztec:v1.3.22')
109109
}
110110
```
111111

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import android.view.WindowManager
5555
import android.view.inputmethod.BaseInputConnection
5656
import android.widget.CheckBox
5757
import android.widget.EditText
58+
import android.widget.Toast
5859
import kotlinx.coroutines.Dispatchers
5960
import kotlinx.coroutines.runBlocking
6061
import kotlinx.coroutines.withContext
@@ -1384,6 +1385,8 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
13841385
max = Math.max(0, Math.max(selectionStart, selectionEnd))
13851386
}
13861387

1388+
var clipboardIdentifier = resources.getIdentifier("android:id/clipboard", "id", context.packageName)
1389+
13871390
when (id) {
13881391
android.R.id.paste -> paste(text, min, max)
13891392
android.R.id.pasteAsPlainText -> paste(text, min, max, true)
@@ -1400,7 +1403,17 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
14001403
deleteInlineStyleFromTheBeginning()
14011404
}
14021405
}
1403-
else -> return super.onTextContextMenuItem(id)
1406+
// Fix for crash when pasting text on Samsung Devices running Android 8.
1407+
// Ref: https://github.com/wordpress-mobile/WordPress-Android/issues/8827
1408+
clipboardIdentifier -> {
1409+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && Build.VERSION.SDK_INT < 28
1410+
&& Build.MANUFACTURER.toLowerCase().equals("samsung")) {
1411+
// Nope return true
1412+
Toast.makeText(context, R.string.samsung_disabled_custom_clipboard, Toast.LENGTH_LONG).show()
1413+
} else {
1414+
return super.onTextContextMenuItem(id)
1415+
}
1416+
} else -> return super.onTextContextMenuItem(id)
14041417
}
14051418

14061419
return true

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +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>
56

67
<!-- LINK DIALOG -->
78
<string name="link_dialog_title">Insert link</string>

0 commit comments

Comments
 (0)