Skip to content

Commit 2999ccd

Browse files
committed
Don't show key borders in mini keyboard
1 parent 9eee610 commit 2999ccd

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3-
<!--used after long pressing a key to highlight the currently selected key alternative on minikeyboard-->
4-
<item android:drawable="@drawable/minikeyboard_selected_background_outlined" android:state_focused="true"/>
5-
<item android:drawable="@drawable/key_background_outlined"/>
3+
<!--used after long pressing a key to highlight the currently selected key alternative on minikeyboard-->
4+
<item android:drawable="@drawable/minikeyboard_selected_background" android:state_focused="true" />
5+
<item android:drawable="@drawable/key_background_outlined" />
66
</selector>

app/src/main/res/drawable/minikeyboard_selected_background_outlined.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)