Merge pull request #183 from Merkost/direct_boot_aware

Direct boot aware
This commit is contained in:
Tibor Kaputa
2023-06-13 10:35:37 +02:00
committed by GitHub
9 changed files with 60 additions and 20 deletions

View File

@ -191,9 +191,12 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
mLabelTextSize = resources.getDimension(R.dimen.label_text_size).toInt()
mPreviewHeight = resources.getDimension(R.dimen.key_height).toInt()
mSpaceMoveThreshold = resources.getDimension(R.dimen.medium_margin).toInt()
mTextColor = context.getProperTextColor()
mBackgroundColor = context.getProperBackgroundColor()
mPrimaryColor = context.getProperPrimaryColor()
with (context.safeStorageContext) {
mTextColor = getProperTextColor()
mBackgroundColor = getProperBackgroundColor()
mPrimaryColor = getProperPrimaryColor()
}
mPreviewPopup = PopupWindow(context)
mPreviewText = inflater.inflate(resources.getLayout(R.layout.keyboard_key_preview), null) as TextView
@ -343,12 +346,14 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
}
fun setupKeyboard(changedView: View? = null) {
mTextColor = context.getProperTextColor()
mBackgroundColor = context.getProperBackgroundColor()
mPrimaryColor = context.getProperPrimaryColor()
with(context.safeStorageContext) {
mTextColor = getProperTextColor()
mBackgroundColor = getProperBackgroundColor()
mPrimaryColor = getProperPrimaryColor()
mShowKeyBorders = context.config.showKeyBorders
mUsingSystemTheme = context.config.isUsingSystemTheme
mShowKeyBorders = config.showKeyBorders
mUsingSystemTheme = config.isUsingSystemTheme
}
val isMainKeyboard = changedView == null || changedView != mini_keyboard_view
mKeyBackground = if (mShowKeyBorders && isMainKeyboard) {
@ -394,6 +399,8 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
settings_cog.applyColorFilter(mTextColor)
pinned_clipboard_items.applyColorFilter(mTextColor)
clipboard_clear.applyColorFilter(mTextColor)
toolbar_holder.beInvisibleIf(context.isDeviceLocked)
}
mClipboardManagerHolder?.apply {
@ -1413,7 +1420,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
}
}
val adapter = ClipsKeyboardAdapter(context, clips, refreshClipsListener) { clip ->
val adapter = ClipsKeyboardAdapter(context.safeStorageContext, clips, refreshClipsListener) { clip ->
mOnKeyboardActionListener!!.onText(clip.value)
vibrateIfNeeded()
}