osfans / trime

同文安卓輸入法平臺3.x/Android-rime/Rime Input Method Engine for Android
http://osfans.github.io/trime/
GNU General Public License v3.0
3.08k stars 372 forks source link

调用粘贴板出错 #802

Closed xz-dev closed 2 months ago

xz-dev commented 2 years ago

Describe the bug 参考 https://github.com/osfans/trime/blob/6db78b1a68c19a604fa1e6f9d4cc596d0c71c975/app/src/main/assets/rime/trime.yaml#L913 给键盘添加了一个粘贴板

# gBoardColemakArime.trime.custom.yaml

patch:
  preset_keyboards/default/height: 55
  preset_keyboards/colemak_en/height: 55
  preset_keyboards/symbols/height: 55
  preset_keyboards/symbols_en/height: 55
  preset_keyboards/symbols_alt_zh/height: 55
  preset_keyboards/symbols_alt_en/height: 55
  preset_keyboards/number/height: 55
  preset_keyboards/default/keys/@32/+: { long_click: VOICE_ASSIST }
  preset_keys/+:
    liquid_keyboard_clipboard:
      { label: 剪贴, send: function, command: liquid_keyboard, option: "剪贴" }
  preset_keyboards/default/keys/@29/+: { long_click: liquid_keyboard_clipboard }

在调起时应用崩溃 错误日志:

time: 1657529606515
msg: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
stacktrace: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.get(ArrayList.java:437)
    at com.osfans.trime.ime.symbol.TabManager.getTag(TabManager.java:42)
    at com.osfans.trime.ime.symbol.LiquidKeyboard.select(LiquidKeyboard.java:86)
    at com.osfans.trime.ime.core.Trime.selectLiquidKeyboard(Trime.java:444)
    at com.osfans.trime.ime.core.Trime.selectLiquidKeyboard(Trime.java:464)
    at com.osfans.trime.ime.text.TextInputManager.onEvent(TextInputManager.kt:365)
    at com.osfans.trime.ime.keyboard.KeyboardView.onLongPress(KeyboardView.java:1406)
    at com.osfans.trime.ime.keyboard.KeyboardView.openPopupIfRequired(KeyboardView.java:1299)
    at com.osfans.trime.ime.keyboard.KeyboardView.access$500(KeyboardView.java:64)
    at com.osfans.trime.ime.keyboard.KeyboardView$MyHandler.handleMessage(KeyboardView.java:331)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7872)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

Screenshots Screenshot_20220711-170131_Niagara Launcher

Smartphone (please complete the following information):

ivysrono commented 2 years ago

fdroid 3.2.7 复现

linsui commented 2 years ago

https://github.com/osfans/trime/issues/785

UQJRlex commented 2 years ago

能否提供一下你所使用的 Gboard 风格的主题 trime.yaml 文件?谢谢。

xz-dev commented 2 years ago

能否提供一下你所使用的 Gboard 风格的主题 trime.yaml 文件?谢谢。

基于 https://github.com/blueset/trime-gboard-dark-colemak ColemakGboard.zip

WhiredPlanck commented 6 months ago

@xz-dev 请尝试最新稳定版/每夜版看看还会这样吗?