Skip to content

Commit 4b571fc

Browse files
committed
Update InputConnection interface functions
Some functions has converted to nullable after API 28.
1 parent 15abb1c commit 4b571fc

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ abstract class InputConnectionWrapper(private val inputConnection: InputConnecti
106106
return inputConnection.getSelectedText(flags)
107107
}
108108

109-
override fun getTextAfterCursor(length: Int, flags: Int): CharSequence {
109+
override fun getTextAfterCursor(length: Int, flags: Int): CharSequence? {
110110
return inputConnection.getTextAfterCursor(length, flags)
111111
}
112112

113-
override fun getTextBeforeCursor(length: Int, flags: Int): CharSequence {
113+
override fun getTextBeforeCursor(length: Int, flags: Int): CharSequence? {
114114
return inputConnection.getTextBeforeCursor(length, flags)
115115
}
116116

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import android.os.Bundle
55
import android.text.Editable
66
import android.text.Selection
77
import android.text.Spanned
8-
import android.text.TextUtils
98
import android.text.style.SuggestionSpan
109
import android.view.KeyEvent
1110
import android.view.inputmethod.BaseInputConnection
@@ -22,7 +21,7 @@ import android.view.inputmethod.InputContentInfo
2221
*/
2322
class SamsungInputConnection(
2423
private val mTextView: AztecText,
25-
private val baseInputConnection: InputConnection,
24+
private val baseInputConnection: InputConnection
2625
) : BaseInputConnection(mTextView, true) {
2726

2827
override fun getEditable(): Editable {
@@ -178,11 +177,11 @@ class SamsungInputConnection(
178177
return baseInputConnection.getSelectedText(flags)
179178
}
180179

181-
override fun getTextAfterCursor(length: Int, flags: Int): CharSequence {
180+
override fun getTextAfterCursor(length: Int, flags: Int): CharSequence? {
182181
return baseInputConnection.getTextAfterCursor(length, flags)
183182
}
184183

185-
override fun getTextBeforeCursor(length: Int, flags: Int): CharSequence {
184+
override fun getTextBeforeCursor(length: Int, flags: Int): CharSequence? {
186185
return baseInputConnection.getTextBeforeCursor(length, flags)
187186
}
188187
}

0 commit comments

Comments
 (0)