diff --git a/app/src/main/java/cfpi_fpsi/eu/titanboard/TitanboardIME.java b/app/src/main/java/cfpi_fpsi/eu/titanboard/TitanboardIME.java index 8d212fb..0a4e09c 100644 --- a/app/src/main/java/cfpi_fpsi/eu/titanboard/TitanboardIME.java +++ b/app/src/main/java/cfpi_fpsi/eu/titanboard/TitanboardIME.java @@ -1,5 +1,6 @@ package cfpi_fpsi.eu.titanboard; +import android.annotation.SuppressLint; import android.inputmethodservice.InputMethodService; import android.os.Build; import android.os.Vibrator; @@ -96,9 +97,12 @@ public class TitanboardIME extends InputMethodService { return false; // If it's the backspace key, we remove one character. case KeyEvent.KEYCODE_DEL: - conn.deleteSurroundingText(1, 0); adjustMetaKeyStateAfterKeypress(); - return true; + if (conn.getSelectedText(0) == null) { + conn.deleteSurroundingText(1, 0); + return true; + } + return false; case KeyEvent.KEYCODE_SPACE: conn.commitText(" ", 1); adjustMetaKeyStateAfterKeypress(); @@ -196,6 +200,9 @@ public class TitanboardIME extends InputMethodService { mMetaKeyLatched = MetaKey.NONE; mMetaKeyLocked = MetaKey.NONE; updateMetaStateTextView(); + mInputView.findViewById(R.id.extra_view).setVisibility(View.GONE); + Button key = (Button) mInputView.findViewById(R.id.expand_button); + key.setText("▲"); } private String getKey(int keyCode) { @@ -216,6 +223,7 @@ public class TitanboardIME extends InputMethodService { } } + @SuppressLint("SetTextI18n") private void updateMetaStateTextView() { TextView stateView = mInputView.findViewById(R.id.state); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { diff --git a/app/src/main/res/layout/input.xml b/app/src/main/res/layout/input.xml index d294643..acffaa5 100644 --- a/app/src/main/res/layout/input.xml +++ b/app/src/main/res/layout/input.xml @@ -41,7 +41,8 @@ android:layout_width="10dp" android:layout_height="wrap_content" android:layout_weight="1" - android:text="aa" /> + android:text="aa" + android:typeface="normal" /> @@ -240,6 +241,7 @@ android:text="&" />