|
59 | 59 | *
|
60 | 60 | * @author <a href="https://88250.b3log.org">Liang Ding</a>
|
61 | 61 | * @author <a href="https://github.com/wwxiaoqi">Jane Haring</a>
|
62 |
| - * @version 1.4.0.0, Mar 28, 2025 |
| 62 | + * @version 1.4.0.1, Apr 6, 2025 |
63 | 63 | * @since 1.0.0
|
64 | 64 | */
|
65 | 65 | public final class Utils {
|
@@ -127,20 +127,24 @@ public static String getChannel(final PackageManager pm) {
|
127 | 127 | public static void registerSoftKeyboardToolbar(final Activity activity, final WebView webView) {
|
128 | 128 | KeyboardUtils.registerSoftInputChangedListener(activity, height -> {
|
129 | 129 | if (activity.isInMultiWindowMode()) {
|
| 130 | + Utils.logInfo("keyboard", "In multi window mode, do not show keyboard toolbar"); |
130 | 131 | return;
|
131 | 132 | }
|
132 | 133 |
|
133 | 134 | final long now = System.currentTimeMillis();
|
134 | 135 | if (KeyboardUtils.isSoftInputVisible(activity)) {
|
135 | 136 | webView.evaluateJavascript("javascript:showKeyboardToolbar()", null);
|
136 | 137 | lastShowKeyboard = now;
|
| 138 | + Utils.logInfo("keyboard", "Show keyboard toolbar"); |
137 | 139 | } else {
|
138 | 140 | if (now - lastShowKeyboard < 500) {
|
139 | 141 | // 短时间内键盘显示又隐藏,强制再次显示键盘 https://github.com/siyuan-note/siyuan/issues/11098#issuecomment-2273704439
|
140 | 142 | KeyboardUtils.showSoftInput(activity);
|
| 143 | + Utils.logInfo("keyboard", "Force show keyboard"); |
141 | 144 | return;
|
142 | 145 | }
|
143 | 146 | webView.evaluateJavascript("javascript:hideKeyboardToolbar()", null);
|
| 147 | + Utils.logInfo("keyboard", "Hide keyboard toolbar"); |
144 | 148 | }
|
145 | 149 | });
|
146 | 150 | }
|
|
0 commit comments