Skip to content

Commit

Permalink
fix: show toolbar whenever selectLiquidKeyboard() is called
Browse files Browse the repository at this point in the history
This fixes an unintentional side effect caused by commit db63dab.

refs #1177
  • Loading branch information
goofyz authored and Bambooin committed Jan 18, 2024
1 parent c07b2c4 commit 8a4177d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions app/src/main/java/com/osfans/trime/ime/core/Trime.java
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ public void selectLiquidKeyboard(final int tabIndex) {
mTabRoot.setBackground(mCandidateRoot.getBackground());
mTabRoot.move(tabView.getHightlightLeft(), tabView.getHightlightRight());
}
showLiquidKeyboardToolbar();
} else {
symbolKeyboardType = SymbolKeyboardType.NO_KEY;
// 设置液体键盘处于隐藏状态
Expand Down Expand Up @@ -1109,8 +1110,7 @@ public int updateComposing() {
Timber.d("updateComposing() SymbolKeyboardType=%s", symbolKeyboardType.toString());
if (symbolKeyboardType != SymbolKeyboardType.NO_KEY
&& symbolKeyboardType != SymbolKeyboardType.CANDIDATE) {
mComposition.setWindow();
showCompositionView(false);
showLiquidKeyboardToolbar();
} else {
mComposition.setVisibility(View.VISIBLE);
startNum = mComposition.setWindow(minPopupSize, minPopupCheckSize, Integer.MAX_VALUE);
Expand All @@ -1133,6 +1133,11 @@ public int updateComposing() {
return startNum;
}

private void showLiquidKeyboardToolbar() {
mComposition.changeToLiquidKeyboardToolbar();
showCompositionView(false);
}

public void showDialogAboveInputView(@NonNull final Dialog dialog) {
final IBinder token = inputRootBinding.inputRoot.getWindowToken();
final Window window = dialog.getWindow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ else if (m.containsKey("candidate")) {
}

/** 设置悬浮窗, 用于liquidKeyboard的悬浮窗工具栏 */
public void setWindow() {
public void changeToLiquidKeyboardToolbar() {
if (getVisibility() != View.VISIBLE) return;
if (liquid_keyboard_window_comp.isEmpty()) {
this.setVisibility(GONE);
Expand Down

0 comments on commit 8a4177d

Please sign in to comment.