@@ -378,7 +378,9 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
378378
379379 mShowKeyBorders = context.config.showKeyBorders
380380 mUsingSystemTheme = context.config.isUsingSystemTheme
381- mKeyBackground = if (mShowKeyBorders) {
381+
382+ val isMainKeyboard = changedView == null || changedView != mini_keyboard_view
383+ mKeyBackground = if (mShowKeyBorders && isMainKeyboard) {
382384 resources.getDrawable(R .drawable.keyboard_key_selector_outlined, context.theme)
383385 } else {
384386 resources.getDrawable(R .drawable.keyboard_key_selector, context.theme)
@@ -392,7 +394,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
392394 val darkerColor = getKeyboardBackgroundColor()
393395 val miniKeyboardBackgroundColor = getToolbarColor(4 )
394396
395- if (changedView != null && changedView == mini_keyboard_view ) {
397+ if (! isMainKeyboard ) {
396398 val previewBackground = background as LayerDrawable
397399 previewBackground.findDrawableByLayerId(R .id.button_background_shape).applyColorFilter(miniKeyboardBackgroundColor)
398400 previewBackground.findDrawableByLayerId(R .id.button_background_stroke).applyColorFilter(strokeColor)
@@ -1570,7 +1572,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
15701572
15711573 private fun maybeDarkenColor (color : Int , factor : Int ): Int {
15721574 // use darker background color when key borders are enabled
1573- if (context.config.showKeyBorders && ! context.isUsingSystemDarkTheme() ) {
1575+ if (context.config.showKeyBorders) {
15741576 val darkerColor = color.darkenColor(factor)
15751577 return if (darkerColor == Color .WHITE ) {
15761578 resources.getColor(R .color.md_grey_200, context.theme)
0 commit comments