Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions app/src/main/java/be/scri/views/KeyboardView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import androidx.core.graphics.createBitmap
import androidx.core.graphics.toColorInt
import androidx.core.graphics.withSave
import be.scri.R
import be.scri.databinding.KeyboardPopupKeyboardBinding
import be.scri.databinding.KeyboardViewKeyboardBinding
import be.scri.extensions.adjustAlpha
import be.scri.extensions.applyColorFilter
Expand Down Expand Up @@ -324,15 +323,6 @@ class KeyboardView
private const val LEFT_RIGHT_CONJUGATE_KEY_EXTRA_HEIGHT = 340
}

private var popupBindingInternal: KeyboardPopupKeyboardBinding? = null
private val popupBinding: KeyboardPopupKeyboardBinding
get() {
if (popupBindingInternal == null) {
popupBindingInternal = KeyboardPopupKeyboardBinding.inflate(LayoutInflater.from(context))
}
return popupBindingInternal!!
}

var setPreview: Boolean = true
var setVibrate: Boolean = true

Expand Down Expand Up @@ -578,7 +568,7 @@ class KeyboardView

if (visibility == VISIBLE) {
mTextColor = context.getProperTextColor()
mBackgroundColor = context.getProperBackgroundColor()
mBackgroundColor = context.resources.getColor(R.color.annotateBlue)
mPrimaryColor = context.getProperPrimaryColor()
val strokeColor = context.getStrokeColor()

Expand All @@ -598,12 +588,12 @@ class KeyboardView

val miniKeyboardBackgroundColor =
if (context.config.isUsingSystemTheme) {
resources.getColor(R.color.you_keyboard_toolbar_color, context.theme)
resources.getColor(R.color.default_key_color, context.theme)
} else {
mBackgroundColor
resources.getColor(R.color.default_key_color, context.theme)
}

if (changedView == popupBinding.miniKeyboardView) {
if (changedView.id == R.id.mini_keyboard_view) {
val previewBackground = background as LayerDrawable

previewBackground
Expand All @@ -612,7 +602,7 @@ class KeyboardView

previewBackground
.findDrawableByLayerId(R.id.button_background_stroke)
.applyColorFilter(strokeColor)
.applyColorFilter(context.getColor(R.color.default_key_color))

background = previewBackground
} else {
Expand Down Expand Up @@ -875,7 +865,9 @@ class KeyboardView
"#d2d4da".toColorInt()
}
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR)
canvas.drawColor(mKeyboardBackgroundColor)
if (id != R.id.mini_keyboard_view) {
canvas.drawColor(mKeyboardBackgroundColor)
}

val keyCount = keys.size
for (i in 0 until keyCount) {
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/drawable/minikeyboard_background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/button_background_shape">
<shape android:shape="rectangle">
<solid android:color="@color/theme_dark_background_color" />
<corners android:radius="@dimen/small_margin" />
<solid android:color="@color/mini_keyboard_color" />
<corners android:radius="12dp" />
</shape>
</item>

Expand All @@ -12,8 +12,8 @@
<stroke
android:width="1dp"
android:color="@color/divider_grey" />
<solid android:color="@android:color/transparent" />
<corners android:radius="@dimen/small_margin" />
<solid android:color="@color/special_key_dark" />
<corners android:radius="12dp" />
</shape>
</item>
</layer-list>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/keyboard_popup_keyboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
style="@style/KeyboardViewPopup"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/you_keyboard_background_color" />
android:background="@drawable/minikeyboard_background" />
1 change: 1 addition & 0 deletions app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<color name="button_container_color">@color/you_button_background_color</color>
<color name="theme_scribe_blue">@color/dark_scribe_blue</color>
<color name="navigation_bar_color">@color/dark_keyboard_bg_color</color>
<color name="default_key_color">@color/dark_key_color</color>

<!-- Commons colors -->
<color name="you_status_bar_color">#20333D</color>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<color name="special_key_light">#aeb3be</color>
<color name="special_key_dark">#202020</color>
<color name="command_bar_color_dark">#2E2E2E</color>
<color name="mini_keyboard_color">#3F3F46</color>

<color name="nav_bar_selected_color_light">@color/dark_scribe_color</color>
<color name="nav_bar_selected_color_dark">@color/light_scribe_color</color>
Expand Down
Loading