make preview text size a tiny bit bigger

This commit is contained in:
tibbi 2022-01-21 16:59:54 +01:00
parent c51a131585
commit 6a6f200059
3 changed files with 3 additions and 7 deletions

View File

@ -16,7 +16,6 @@ import android.view.accessibility.AccessibilityManager
import android.widget.PopupWindow import android.widget.PopupWindow
import android.widget.TextView import android.widget.TextView
import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.mydebug
import com.simplemobiletools.keyboard.R import com.simplemobiletools.keyboard.R
import com.simplemobiletools.keyboard.extensions.config import com.simplemobiletools.keyboard.extensions.config
import com.simplemobiletools.keyboard.helpers.* import com.simplemobiletools.keyboard.helpers.*
@ -136,7 +135,6 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
private var mLastKeyTime: Long = 0 private var mLastKeyTime: Long = 0
private var mCurrentKeyTime: Long = 0 private var mCurrentKeyTime: Long = 0
private val mKeyIndices = IntArray(12) private val mKeyIndices = IntArray(12)
private var mGestureDetector: GestureDetector? = null
private var mPopupX = 0 private var mPopupX = 0
private var mPopupY = 0 private var mPopupY = 0
private var mRepeatKeyIndex: Int = NOT_A_KEY private var mRepeatKeyIndex: Int = NOT_A_KEY
@ -242,7 +240,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
mPreviewPopup = PopupWindow(context) mPreviewPopup = PopupWindow(context)
if (previewLayout != 0) { if (previewLayout != 0) {
mPreviewText = inflate.inflate(previewLayout, null) as TextView mPreviewText = inflate.inflate(previewLayout, null) as TextView
mPreviewTextSizeLarge = mPreviewText!!.textSize.toInt() mPreviewTextSizeLarge = context.resources.getDimension(R.dimen.preview_text_size).toInt()
mPreviewPopup.contentView = mPreviewText mPreviewPopup.contentView = mPreviewText
mPreviewPopup.setBackgroundDrawable(null) mPreviewPopup.setBackgroundDrawable(null)
} else { } else {
@ -252,9 +250,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
mPreviewPopup.isTouchable = false mPreviewPopup.isTouchable = false
mPopupKeyboard = PopupWindow(context) mPopupKeyboard = PopupWindow(context)
mPopupKeyboard.setBackgroundDrawable(null) mPopupKeyboard.setBackgroundDrawable(null)
//mPopupKeyboard.setClippingEnabled(false);
mPopupParent = this mPopupParent = this
//mPredicting = true;
mPaint = Paint() mPaint = Paint()
mPaint.isAntiAlias = true mPaint.isAntiAlias = true
mPaint.textSize = keyTextSize.toFloat() mPaint.textSize = keyTextSize.toFloat()
@ -924,7 +920,6 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
override fun onKey(primaryCode: Int, keyCodes: IntArray?) { override fun onKey(primaryCode: Int, keyCodes: IntArray?) {
onKeyboardActionListener!!.onKey(primaryCode, keyCodes) onKeyboardActionListener!!.onKey(primaryCode, keyCodes)
dismissPopupKeyboard() dismissPopupKeyboard()
mydebug("onkey")
} }
override fun onPress(primaryCode: Int) { override fun onPress(primaryCode: Int) {

View File

@ -2,4 +2,5 @@
<dimen name="popup_max_move_distance">60dp</dimen> <dimen name="popup_max_move_distance">60dp</dimen>
<dimen name="top_small_number_margin_width">12dp</dimen> <dimen name="top_small_number_margin_width">12dp</dimen>
<dimen name="top_small_number_margin_height">18dp</dimen> <dimen name="top_small_number_margin_height">18dp</dimen>
<dimen name="preview_text_size">26sp</dimen>
</resources> </resources>

View File

@ -21,6 +21,6 @@
</style> </style>
<style name="Widget.KeyboardViewPopup" parent="Widget.KeyboardView"> <style name="Widget.KeyboardViewPopup" parent="Widget.KeyboardView">
<item name="keyTextSize">26sp</item> <item name="keyTextSize">@dimen/preview_text_size</item>
</style> </style>
</resources> </resources>