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

View File

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

View File

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