From de7f1033d88b24bc3b37c2c96a50fb0b555b779c Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 8 Jan 2022 18:06:37 +0100 Subject: [PATCH] removing some debug touch drawing related code --- .../keyboard/views/MyKeyboardView.kt | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt index 703f37c..31208f8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt @@ -144,7 +144,6 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut * @see .isPreviewEnabled */ var isPreviewEnabled = true - private val mShowTouchPoints = true private var mPopupPreviewX = 0 private var mPopupPreviewY = 0 private var mLastX = 0 @@ -225,7 +224,6 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut var mHandler: Handler? = null companion object { - private const val DEBUG = false private const val NOT_A_KEY = -1 private val KEY_DELETE = intArrayOf(Keyboard.KEYCODE_DELETE) private val LONG_PRESSABLE_STATE_SET = intArrayOf(R.attr.state_long_pressable) @@ -618,22 +616,14 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut } canvas.translate((-key.x - kbdPaddingLeft).toFloat(), (-key.y - kbdPaddingTop).toFloat()) } + mInvalidatedKey = null // Overlay a dark rectangle to dim the keyboard if (mMiniKeyboardOnScreen) { paint.color = (mBackgroundDimAmount * 0xFF).toInt() shl 24 canvas.drawRect(0f, 0f, width.toFloat(), height.toFloat(), paint) } - if (DEBUG && mShowTouchPoints) { - paint.alpha = 128 - paint.color = -0x10000 - canvas.drawCircle(mStartX.toFloat(), mStartY.toFloat(), 3f, paint) - canvas.drawLine(mStartX.toFloat(), mStartY.toFloat(), mLastX.toFloat(), mLastY.toFloat(), paint) - paint.color = -0xffff01 - canvas.drawCircle(mLastX.toFloat(), mLastY.toFloat(), 3f, paint) - paint.color = -0xff0100 - canvas.drawCircle(((mStartX + mLastX) / 2).toFloat(), ((mStartY + mLastY) / 2).toFloat(), 2f, paint) - } + mCanvas!!.restore() mDrawPending = false mDirtyRect.setEmpty()