Skip to content

Commit 4416b4f

Browse files
authored
Revert "Fix/ime iob fix"
1 parent 9f2cb0c commit 4416b4f

File tree

3 files changed

+1
-104
lines changed

3 files changed

+1
-104
lines changed

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

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ import android.view.MotionEvent
4848
import android.view.View
4949
import android.view.WindowManager
5050
import android.view.inputmethod.BaseInputConnection
51-
import android.view.inputmethod.EditorInfo
52-
import android.view.inputmethod.InputConnection
5351
import android.widget.CheckBox
5452
import android.widget.EditText
5553
import android.widget.Toast
@@ -72,7 +70,6 @@ import org.wordpress.aztec.handlers.ListHandler
7270
import org.wordpress.aztec.handlers.ListItemHandler
7371
import org.wordpress.aztec.handlers.PreformatHandler
7472
import org.wordpress.aztec.handlers.QuoteHandler
75-
import org.wordpress.aztec.ime.EditorInfoUtils
7673
import org.wordpress.aztec.plugins.IAztecPlugin
7774
import org.wordpress.aztec.plugins.IToolbarButton
7875
import org.wordpress.aztec.source.Format
@@ -121,7 +118,6 @@ import org.wordpress.aztec.watchers.event.text.BeforeTextChangedEventData
121118
import org.wordpress.aztec.watchers.event.text.OnTextChangedEventData
122119
import org.wordpress.aztec.watchers.event.text.TextWatcherEvent
123120
import org.xml.sax.Attributes
124-
import java.lang.ref.WeakReference
125121
import java.security.MessageDigest
126122
import java.security.NoSuchAlgorithmException
127123
import java.util.ArrayList
@@ -296,9 +292,6 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
296292

297293
private var focusOnVisible = true
298294

299-
var inputConnectionRef: WeakReference<InputConnection>? = null
300-
var inputConnectionEditorInfo: EditorInfo? = null
301-
302295
interface OnSelectionChangedListener {
303296
fun onSelectionChanged(selStart: Int, selEnd: Int)
304297
}
@@ -670,45 +663,6 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
670663
}
671664
}
672665

673-
override fun onCreateInputConnection(outAttrs: EditorInfo) : InputConnection {
674-
// limiting the reuseInputConnection fix for Anroid 8.0.0 for now
675-
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.O) {
676-
return handleReuseInputConnection(outAttrs)
677-
}
678-
679-
return super.onCreateInputConnection(outAttrs)
680-
}
681-
682-
private fun handleReuseInputConnection(outAttrs: EditorInfo) : InputConnection {
683-
// initialize inputConnectionEditorInfo
684-
if (inputConnectionEditorInfo == null) {
685-
inputConnectionEditorInfo = outAttrs
686-
}
687-
688-
// now init the InputConnection, or replace if EditorInfo contains anything different
689-
if (inputConnectionRef?.get() == null || !EditorInfoUtils.areEditorInfosTheSame(outAttrs, inputConnectionEditorInfo!!)) {
690-
// we have a new InputConnection to create, save the new EditorInfo data and create it
691-
// we make a copy of the parameters being received, because super.onCreateInputConnection may make changes
692-
// to EditorInfo params being sent to it, and we want to preserve the same data we received in order
693-
// to compare.
694-
// (see https://android.googlesource.com/platform/frameworks/base/+/jb-mr0-release/core/java/android/widget/
695-
// TextView.java#5404)
696-
inputConnectionEditorInfo = EditorInfoUtils.copyEditorInfo(outAttrs)
697-
val localInputConnection = super.onCreateInputConnection(outAttrs)
698-
if (localInputConnection == null) {
699-
// in case super returns null, let's just observe the base implementation, no need to make
700-
// an InputConnectionWrapper of a null target
701-
return localInputConnection
702-
}
703-
// if non null, wrap the new InputConnection around our wrapper (used for logging purposes only)
704-
//inputConnection = AztecTextInputConnectionWrapper(localInputConnection, this)
705-
inputConnectionRef = WeakReference(localInputConnection)
706-
}
707-
708-
// return the existing inputConnection
709-
return inputConnectionRef?.get()!!
710-
}
711-
712666
override fun onRestoreInstanceState(state: Parcelable?) {
713667
disableTextChangedListener()
714668

aztec/src/main/kotlin/org/wordpress/aztec/ime/EditorInfoUtils.kt

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

aztec/src/main/kotlin/org/wordpress/aztec/plugins/CssUnderlinePlugin.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ class CssUnderlinePlugin : ISpanPostprocessor, ISpanPreprocessor {
4141
if (hiddenSpan.TAG == SPAN_TAG) {
4242
val parentStyle = hiddenSpan.attributes.getValue(CssStyleFormatter.STYLE_ATTRIBUTE)
4343
val childStyle = calypsoUnderlineSpan.attributes.getValue(CssStyleFormatter.STYLE_ATTRIBUTE)
44-
if (parentStyle != null && childStyle != null) {
45-
hiddenSpan.attributes.setValue(CssStyleFormatter.STYLE_ATTRIBUTE, CssStyleFormatter.mergeStyleAttributes(parentStyle, childStyle))
46-
}
44+
hiddenSpan.attributes.setValue(CssStyleFormatter.STYLE_ATTRIBUTE, CssStyleFormatter.mergeStyleAttributes(parentStyle, childStyle))
4745

4846
// remove the extra child span
4947
spannable.removeSpan(calypsoUnderlineSpan)

0 commit comments

Comments
 (0)