@@ -225,9 +225,12 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
225225 mLabelTextSize = resources.getDimension(R .dimen.label_text_size).toInt()
226226 mPreviewHeight = resources.getDimension(R .dimen.key_height).toInt()
227227 mSpaceMoveThreshold = resources.getDimension(R .dimen.medium_margin).toInt()
228- mTextColor = context.safeStorageContext.getProperTextColor()
229- mBackgroundColor = context.safeStorageContext.getProperBackgroundColor()
230- mPrimaryColor = context.safeStorageContext.getProperPrimaryColor()
228+
229+ with (context.safeStorageContext) {
230+ mTextColor = getProperTextColor()
231+ mBackgroundColor = getProperBackgroundColor()
232+ mPrimaryColor = getProperPrimaryColor()
233+ }
231234
232235 mPreviewPopup = PopupWindow (context)
233236 mPreviewText = inflater.inflate(resources.getLayout(R .layout.keyboard_key_preview), null ) as TextView
@@ -383,7 +386,6 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
383386 mUsingSystemTheme = config.isUsingSystemTheme
384387 }
385388
386-
387389 val isMainKeyboard = changedView == null || changedView != mini_keyboard_view
388390 mKeyBackground = if (mShowKeyBorders && isMainKeyboard) {
389391 resources.getDrawable(R .drawable.keyboard_key_selector_outlined, context.theme)
@@ -429,7 +431,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
429431 pinned_clipboard_items.applyColorFilter(mTextColor)
430432 clipboard_clear.applyColorFilter(mTextColor)
431433
432- toolbar_holder.beInvisibleIf(! context.shouldShowKeyboardToolbar )
434+ toolbar_holder.beInvisibleIf(context.isDeviceLocked )
433435 }
434436
435437 mClipboardManagerHolder?.apply {
@@ -1492,7 +1494,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
14921494 }
14931495 }
14941496
1495- val adapter = ClipsKeyboardAdapter (context, clips, refreshClipsListener) { clip ->
1497+ val adapter = ClipsKeyboardAdapter (context.safeStorageContext , clips, refreshClipsListener) { clip ->
14961498 mOnKeyboardActionListener!! .onText(clip.value)
14971499 vibrateIfNeeded()
14981500 }
0 commit comments