@@ -410,8 +410,11 @@ public void onOptionChanged(@NonNull String option, boolean value) {
410
410
else if (c == '2' && value ) oneHandMode = 2 ;
411
411
else if (c == '3' ) oneHandMode = value ? 1 : 2 ;
412
412
else oneHandMode = 0 ;
413
+
413
414
loadBackground ();
414
- initKeyboard ();
415
+ if (keyboardSwitcher != null ) keyboardSwitcher .newOrReset ();
416
+ resetKeyboard ();
417
+ bindKeyboardToInputView ();
415
418
}
416
419
}
417
420
if (mainKeyboardView != null ) mainKeyboardView .invalidateAllKeys ();
@@ -512,7 +515,9 @@ private void loadBackground() {
512
515
513
516
int [] padding =
514
517
mConfig .getKeyboardPadding (oneHandMode , orientation == Configuration .ORIENTATION_LANDSCAPE );
515
- Timber .i ("padding= %s %s %s" , padding [0 ], padding [1 ], padding [2 ]);
518
+ Timber .i (
519
+ "update KeyboardPadding: Trime.loadBackground, padding= %s %s %s" ,
520
+ padding [0 ], padding [1 ], padding [2 ]);
516
521
mainKeyboardView .setPadding (padding [0 ], 0 , padding [1 ], padding [2 ]);
517
522
518
523
final Drawable d3 = mConfig .getDrawable_ ("root_background" );
@@ -549,6 +554,10 @@ public void resetCandidate() {
549
554
/** 重置鍵盤、候選條、狀態欄等 !!注意,如果其中調用Rime.setOption,切換方案會卡住 */
550
555
private void reset () {
551
556
if (inputRootBinding == null ) return ;
557
+ final LinearLayout symbolInputView = inputRootBinding .symbol .symbolInput ;
558
+ final LinearLayout mainInputView = inputRootBinding .main .mainInput ;
559
+ if (symbolInputView != null ) symbolInputView .setVisibility (View .GONE );
560
+ if (mainInputView != null ) mainInputView .setVisibility (View .VISIBLE );
552
561
getImeConfig ().reset ();
553
562
loadConfig ();
554
563
getImeConfig ().initCurrentColors ();
@@ -563,7 +572,7 @@ public void initKeyboard() {
563
572
setNavBarColor ();
564
573
mNeedUpdateRimeOption = true ; // 不能在Rime.onMessage中調用set_option,會卡死
565
574
bindKeyboardToInputView ();
566
- loadBackground ();
575
+ // loadBackground(); // reset()调用过resetCandidate(),resetCandidate()一键调用过loadBackground ();
567
576
updateComposing (); // 切換主題時刷新候選
568
577
}
569
578
0 commit comments