Twidere-App-Android-Twitter.../twidere/src/main/kotlin/org/mariotaku/twidere/view/FixedEditText.kt

29 lines
798 B
Kotlin
Raw Normal View History

package org.mariotaku.twidere.view
import android.content.Context
import android.util.AttributeSet
import org.mariotaku.chameleon.view.ChameleonEditText
2017-02-13 17:44:56 +01:00
import org.mariotaku.twidere.text.util.SafeEditableFactory
import org.mariotaku.twidere.text.util.SafeSpannableFactory
/**
* Created by mariotaku on 2017/2/3.
*/
class FixedEditText(context: Context, attrs: AttributeSet? = null) : ChameleonEditText(context, attrs) {
2017-02-13 17:44:56 +01:00
init {
setSpannableFactory(SafeSpannableFactory)
setEditableFactory(SafeEditableFactory)
}
override fun onTextContextMenuItem(id: Int): Boolean {
try {
return super.onTextContextMenuItem(id)
} catch (e: AbstractMethodError) {
// http://crashes.to/s/69acd0ea0de
return true
}
}
}