@@ -51,8 +51,7 @@ class KeyboardView(
51
51
context : Context ,
52
52
private val theme : Theme ,
53
53
private val keyboard : Keyboard ,
54
- ) : View(context),
55
- View .OnClickListener {
54
+ ) : View(context) {
56
55
private var mCurrentKeyIndex = NOT_A_KEY
57
56
private val keyTextSize = theme.generalStyle.keyTextSize
58
57
private val labelTextSize =
@@ -111,11 +110,7 @@ class KeyboardView(
111
110
112
111
// Working variable
113
112
private val mCoordinates = IntArray (2 )
114
- private val mPopupKeyboard = PopupWindow (context)
115
- private var mMiniKeyboardOnScreen = false
116
113
private var mPopupParent: View = this
117
- private var mMiniKeyboardOffsetX = 0
118
- private var mMiniKeyboardOffsetY = 0
119
114
private val mKeys get() = keyboard.keys
120
115
121
116
var keyboardActionListener: KeyboardActionListener ? = null
@@ -418,15 +413,6 @@ class KeyboardView(
418
413
val isCapsOn: Boolean
419
414
get() = keyboard.mShiftKey?.isOn ? : false
420
415
421
- /* *
422
- * 關閉彈出鍵盤
423
- *
424
- * @param v 鍵盤視圖
425
- */
426
- override fun onClick (v : View ) {
427
- dismissPopupKeyboard()
428
- }
429
-
430
416
public override fun onMeasure (
431
417
widthMeasureSpec : Int ,
432
418
heightMeasureSpec : Int ,
@@ -802,8 +788,6 @@ class KeyboardView(
802
788
}
803
789
mHandler.removeMessages(MSG_REMOVE_PREVIEW )
804
790
getLocationInWindow(mCoordinates)
805
- mCoordinates[0 ] + = mMiniKeyboardOffsetX // Offset may be zero
806
- mCoordinates[1 ] + = mMiniKeyboardOffsetY // Offset may be zero
807
791
808
792
// Set the preview background state
809
793
mPreviewText.background.setState(EMPTY_STATE_SET )
@@ -1001,12 +985,6 @@ class KeyboardView(
1001
985
}
1002
986
}
1003
987
1004
- // Needs to be called after the gesture detector gets a turn, as it may have
1005
- // displayed the mini keyboard
1006
- if (mMiniKeyboardOnScreen && action != MotionEvent .ACTION_CANCEL ) {
1007
- return true
1008
- }
1009
-
1010
988
fun modifiedPointerDown () {
1011
989
mAbortKey = false
1012
990
mStartX = touchX
@@ -1089,7 +1067,7 @@ class KeyboardView(
1089
1067
showPreview(NOT_A_KEY )
1090
1068
Arrays .fill(mKeyIndices, NOT_A_KEY )
1091
1069
if (mRepeatKeyIndex != NOT_A_KEY && ! mAbortKey) repeatKey()
1092
- if (mRepeatKeyIndex == NOT_A_KEY && ! mMiniKeyboardOnScreen && ! mAbortKey) {
1070
+ if (mRepeatKeyIndex == NOT_A_KEY && ! mAbortKey) {
1093
1071
Timber .d(" onModifiedTouchEvent: detectAndSendKey" )
1094
1072
detectAndSendKey(
1095
1073
mCurrentKey,
@@ -1159,7 +1137,6 @@ class KeyboardView(
1159
1137
1160
1138
MotionEvent .ACTION_CANCEL -> {
1161
1139
removeMessages()
1162
- dismissPopupKeyboard()
1163
1140
mAbortKey = true
1164
1141
showPreview(NOT_A_KEY )
1165
1142
invalidateKey(mKeys[mCurrentKey])
@@ -1188,7 +1165,6 @@ class KeyboardView(
1188
1165
mPreviewPopup.dismiss()
1189
1166
}
1190
1167
removeMessages()
1191
- dismissPopupKeyboard()
1192
1168
freeDrawingBuffer()
1193
1169
}
1194
1170
@@ -1197,14 +1173,6 @@ class KeyboardView(
1197
1173
freeDrawingBuffer()
1198
1174
}
1199
1175
1200
- private fun dismissPopupKeyboard () {
1201
- if (mPopupKeyboard.isShowing) {
1202
- mPopupKeyboard.dismiss()
1203
- mMiniKeyboardOnScreen = false
1204
- invalidateAllKeys()
1205
- }
1206
- }
1207
-
1208
1176
private fun resetMultiTap () {
1209
1177
mLastSentIndex = - 1
1210
1178
// final int mTapCount = 0;
0 commit comments