From f2f7f963e69a55a37b1e72d419b24b8271e119cd Mon Sep 17 00:00:00 2001 From: David xu Date: Mon, 5 Mar 2018 22:09:28 +0800 Subject: [PATCH] =?UTF-8?q?feat=20for=20-=20=E2=80=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/termux/app/ExtraKeysView.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/termux/app/ExtraKeysView.java b/app/src/main/java/com/termux/app/ExtraKeysView.java index 0601be2c..d8784a7f 100644 --- a/app/src/main/java/com/termux/app/ExtraKeysView.java +++ b/app/src/main/java/com/termux/app/ExtraKeysView.java @@ -71,6 +71,9 @@ public final class ExtraKeysView extends GridLayout { case "↓": keyCode = KeyEvent.KEYCODE_DPAD_DOWN; break; + case "―": + chars = "-"; + break; default: chars = keyName; } @@ -150,7 +153,7 @@ public final class ExtraKeysView extends GridLayout { removeAllViews(); String[][] buttons = { - {"ESC", "/", "-", "HOME", "↑", "END", "PGUP"}, + {"ESC", "/", "―", "HOME", "↑", "END", "PGUP"}, {"TAB", "CTRL", "ALT", "←", "↓", "→", "PGDN"} }; @@ -227,10 +230,10 @@ public final class ExtraKeysView extends GridLayout { } return true; case MotionEvent.ACTION_MOVE: - if ("-/".contains(buttonText)) { + if ("―/".contains(buttonText)) { if (popupWindow == null && event.getY() < 0) { v.setBackgroundColor(BUTTON_COLOR); - String text = "-".equals(buttonText) ? "|" : "\\"; + String text = "―".equals(buttonText) ? "|" : "\\"; popup(v, text); } if (popupWindow != null && event.getY() > 0) { @@ -248,11 +251,11 @@ public final class ExtraKeysView extends GridLayout { scheduledExecutor = null; } if (longPressCount == 0) { - if (popupWindow != null && "-/".contains(buttonText)) { + if (popupWindow != null && "―/".contains(buttonText)) { popupWindow.setContentView(null); popupWindow.dismiss(); popupWindow = null; - sendKey(root, "-".equals(buttonText) ? "|" : "\\"); + sendKey(root, "―".equals(buttonText) ? "|" : "\\"); } else { v.performClick(); }