Skip to content

Commit 75c0b6c

Browse files
authored
Merge pull request #882 from wordpress-mobile/revert-834-fix/ime-iob-fix
Revert "Fix/ime iob fix"
2 parents 41bdd4c + 9eaf5c9 commit 75c0b6c

File tree

4 files changed

+1
-111
lines changed

4 files changed

+1
-111
lines changed

.idea/inspectionProfiles/profiles_settings.xml

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

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

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ import android.view.MotionEvent
4949
import android.view.View
5050
import android.view.WindowManager
5151
import android.view.inputmethod.BaseInputConnection
52-
import android.view.inputmethod.EditorInfo
53-
import android.view.inputmethod.InputConnection
5452
import android.widget.CheckBox
5553
import android.widget.EditText
5654
import android.widget.Toast
@@ -73,7 +71,6 @@ import org.wordpress.aztec.handlers.ListHandler
7371
import org.wordpress.aztec.handlers.ListItemHandler
7472
import org.wordpress.aztec.handlers.PreformatHandler
7573
import org.wordpress.aztec.handlers.QuoteHandler
76-
import org.wordpress.aztec.ime.EditorInfoUtils
7774
import org.wordpress.aztec.plugins.IAztecPlugin
7875
import org.wordpress.aztec.plugins.IToolbarButton
7976
import org.wordpress.aztec.source.Format
@@ -122,7 +119,6 @@ import org.wordpress.aztec.watchers.event.text.BeforeTextChangedEventData
122119
import org.wordpress.aztec.watchers.event.text.OnTextChangedEventData
123120
import org.wordpress.aztec.watchers.event.text.TextWatcherEvent
124121
import org.xml.sax.Attributes
125-
import java.lang.ref.WeakReference
126122
import java.security.MessageDigest
127123
import java.security.NoSuchAlgorithmException
128124
import java.util.ArrayList
@@ -297,9 +293,6 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
297293

298294
private var focusOnVisible = true
299295

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

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

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)