mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-09 16:17:44 +00:00
no need to provide KeyboardIconsSet when creating a toolbar key
This commit is contained in:
parent
8284adb32c
commit
538a26a9b8
3 changed files with 5 additions and 6 deletions
|
@ -21,7 +21,6 @@ import helium314.keyboard.keyboard.MainKeyboardView
|
|||
import helium314.keyboard.keyboard.PointerTracker
|
||||
import helium314.keyboard.keyboard.internal.KeyDrawParams
|
||||
import helium314.keyboard.keyboard.internal.KeyVisualAttributes
|
||||
import helium314.keyboard.keyboard.internal.KeyboardIconsSet
|
||||
import helium314.keyboard.keyboard.internal.keyboard_parser.floris.KeyCode
|
||||
import helium314.keyboard.latin.ClipboardHistoryManager
|
||||
import helium314.keyboard.latin.R
|
||||
|
@ -68,7 +67,7 @@ class ClipboardHistoryView @JvmOverloads constructor(
|
|||
keyboardViewAttr.recycle()
|
||||
if (Settings.getValues().mSecondaryStripVisible) {
|
||||
getEnabledClipboardToolbarKeys(context.prefs())
|
||||
.forEach { toolbarKeys.add(createToolbarKey(context, KeyboardIconsSet.instance, it)) }
|
||||
.forEach { toolbarKeys.add(createToolbarKey(context, it)) }
|
||||
}
|
||||
fitsSystemWindows = true
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ class SuggestionStripView(context: Context, attrs: AttributeSet?, defStyle: Int)
|
|||
)
|
||||
if (mToolbarMode == ToolbarMode.TOOLBAR_KEYS || mToolbarMode == ToolbarMode.EXPANDABLE) {
|
||||
for (key in getEnabledToolbarKeys(context.prefs())) {
|
||||
val button = createToolbarKey(context, KeyboardIconsSet.instance, key)
|
||||
val button = createToolbarKey(context, key)
|
||||
button.layoutParams = toolbarKeyLayoutParams
|
||||
setupKey(button, colors)
|
||||
toolbar.addView(button)
|
||||
|
@ -157,7 +157,7 @@ class SuggestionStripView(context: Context, attrs: AttributeSet?, defStyle: Int)
|
|||
}
|
||||
if (!Settings.getValues().mSuggestionStripHiddenPerUserSettings) {
|
||||
for (pinnedKey in getPinnedToolbarKeys(context.prefs())) {
|
||||
val button = createToolbarKey(context, KeyboardIconsSet.instance, pinnedKey)
|
||||
val button = createToolbarKey(context, pinnedKey)
|
||||
button.layoutParams = toolbarKeyLayoutParams
|
||||
setupKey(button, colors)
|
||||
pinnedKeys.addView(button)
|
||||
|
|
|
@ -21,7 +21,7 @@ import kotlinx.coroutines.launch
|
|||
import java.util.EnumMap
|
||||
import java.util.Locale
|
||||
|
||||
fun createToolbarKey(context: Context, iconsSet: KeyboardIconsSet, key: ToolbarKey): ImageButton {
|
||||
fun createToolbarKey(context: Context, key: ToolbarKey): ImageButton {
|
||||
val button = ImageButton(context, null, R.attr.suggestionWordStyle)
|
||||
button.scaleType = ImageView.ScaleType.CENTER
|
||||
button.tag = key
|
||||
|
@ -29,7 +29,7 @@ fun createToolbarKey(context: Context, iconsSet: KeyboardIconsSet, key: ToolbarK
|
|||
if (contentDescriptionId != 0)
|
||||
button.contentDescription = context.getString(contentDescriptionId)
|
||||
setToolbarButtonActivatedState(button)
|
||||
button.setImageDrawable(iconsSet.getNewDrawable(key.name, context))
|
||||
button.setImageDrawable(KeyboardIconsSet.instance.getNewDrawable(key.name, context))
|
||||
return button
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue