show a divider at the top of the keyboard at white or black bg

This commit is contained in:
tibbi 2022-01-29 20:52:44 +01:00
parent 5058167c04
commit ddcbd7751f
2 changed files with 25 additions and 0 deletions
app/src/main
kotlin/com/simplemobiletools/keyboard/views
res/layout

@ -282,7 +282,10 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
val layerDrawable = rippleBg.findDrawableByLayerId(R.id.clipboard_background_holder) as LayerDrawable
layerDrawable.findDrawableByLayerId(R.id.clipboard_background_shape).applyColorFilter(mBackgroundColor)
val wasDarkened = mBackgroundColor != mBackgroundColor.darkenColor()
mToolbarHolder?.apply {
top_keyboard_divider.beGoneIf(wasDarkened)
background = ColorDrawable(mBackgroundColor.darkenColor())
clipboard_value.apply {
background = rippleBg
@ -296,6 +299,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
}
mClipboardManagerHolder?.apply {
top_clipboard_divider.beGoneIf(wasDarkened)
clipboard_manager_holder.background = ColorDrawable(mBackgroundColor.darkenColor())
clipboard_manager_close.applyColorFilter(mTextColor)
clipboard_manager_manage.applyColorFilter(mTextColor)

@ -83,6 +83,16 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/top_keyboard_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@drawable/divider"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.simplemobiletools.keyboard.views.MyKeyboardView
@ -196,5 +206,16 @@
app:spanCount="2" />
</RelativeLayout>
<ImageView
android:id="@+id/top_clipboard_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@drawable/divider"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>