1
0
Fork 0

updated the Numpad view to use the Material 2 theme

This commit is contained in:
sspanak 2025-01-21 21:49:31 +02:00 committed by Dimo Karaivanov
parent 36932f55f9
commit 6a279838f9
67 changed files with 1235 additions and 954 deletions

View file

@ -53,7 +53,7 @@ abstract class UiHandler extends AbstractHandler {
protected void setStatusIcon(InputMode mode) {
if (!InputModeKind.isPassthrough(mode) && settings.isStatusIconEnabled()) {
showStatusIcon(R.drawable.ic_status);
showStatusIcon(R.drawable.ic_keyboard);
} else {
hideStatusIcon();
}

View file

@ -29,7 +29,7 @@ public class ItemNumpadWidth extends ItemDropDown {
options.put(100, "100 ");
super.populateIntegers(options);
float currentValue = 100f * settings.getNumpadWidth() / settings.getNumpadMaxWidth();
float currentValue = settings.getNumpadWidthPercent();
currentValue = Math.round(currentValue / 5f) * 5f;
currentValue = Math.max(Math.min(currentValue, 100f), 50f);

View file

@ -24,14 +24,11 @@ public class SettingsStore extends SettingsUI {
public final static byte SLOW_QUERY_TIME = 50; // ms
public final static int SLOW_QUERY_TIMEOUT = 3000; // ms
public final static float SOFT_KEY_AMOUNT_OF_KEY_SIZE_FOR_SWIPE = 0.5f; // 1 = full key size
public final static float SOFT_KEY_CONTENT_DEFAULT_SCALE = 1.15f; // % / 100
public final static int SOFT_KEY_DOUBLE_CLICK_DELAY = 500; // ms
public final static int SOFT_KEY_REPEAT_DELAY = 40; // ms
public final static int SOFT_KEY_TITLE_MAX_CHARS = 5;
public final static int SOFT_KEY_TITLE_MAX_CHARS_INDIC = 3;
public final static int SOFT_KEY_TITLE_SIZE = 18; // sp
public final static float SOFT_KEY_COMPLEX_LABEL_TITLE_RELATIVE_SIZE = 0.55f;
public final static float SOFT_KEY_COMPLEX_LABEL_ARABIC_TITLE_RELATIVE_SIZE = 0.72f;
public final static float SOFT_KEY_COMPLEX_LABEL_SUB_TITLE_RELATIVE_SIZE = 0.8f;
public final static int SUGGESTIONS_MAX = 20;
public final static int SUGGESTIONS_MIN = 8;
public final static int SUGGESTIONS_POSITIONS_LIMIT = 100;

View file

@ -84,7 +84,11 @@ public class SettingsUI extends SettingsTyping {
}
public int getNumpadWidth() {
return getStringifiedInt("pref_numpad_width", 100) * getNumpadMaxWidth() / 100;
return getNumpadWidthPercent() * getNumpadMaxWidth() / 100;
}
public int getNumpadWidthPercent() {
return getStringifiedInt("pref_numpad_width", 100);
}
public int getSettingsFontSize() {

View file

@ -4,24 +4,19 @@ import android.content.res.Resources;
import android.os.Build;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import java.util.ArrayList;
import java.util.Arrays;
import io.github.sspanak.tt9.R;
import io.github.sspanak.tt9.hacks.DeviceInfo;
import io.github.sspanak.tt9.ime.TraditionalT9;
import io.github.sspanak.tt9.languages.LanguageKind;
import io.github.sspanak.tt9.ui.main.keys.SoftKey;
import io.github.sspanak.tt9.ui.main.keys.SoftKeyFn;
import io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber;
import io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber0;
import io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber1;
import io.github.sspanak.tt9.ui.main.keys.SoftKeyPunctuation;
import io.github.sspanak.tt9.ui.main.keys.SoftKeyArrow;
import io.github.sspanak.tt9.ui.main.keys.SoftKeySettings;
class MainLayoutNumpad extends BaseMainLayout {
@ -44,45 +39,6 @@ class MainLayoutNumpad extends BaseMainLayout {
}
}
private int getBackgroundColor(@NonNull View contextView, boolean dark) {
return ContextCompat.getColor(
contextView.getContext(),
dark ? R.color.dark_numpad_background : R.color.numpad_background
);
}
private int getSeparatorColor(@NonNull View contextView, boolean dark) {
return ContextCompat.getColor(
contextView.getContext(),
dark ? R.color.dark_numpad_separator : R.color.numpad_separator
);
}
@Override
void setDarkTheme(boolean dark) {
if (view == null) {
return;
}
// background
view.setBackgroundColor(getBackgroundColor(view, dark));
// text
for (SoftKey key : getKeys()) {
key.setDarkTheme(dark);
}
// separators
int separatorColor = getSeparatorColor(view, dark);
for (View separator : getSeparators()) {
if (separator != null) {
separator.setBackgroundColor(separatorColor);
}
}
}
@Override void showCommandPalette() {}
@Override void hideCommandPalette() {}
@ -92,36 +48,28 @@ class MainLayoutNumpad extends BaseMainLayout {
@Override
void showTextEditingPalette() {
isTextEditingShown = true;
boolean notKorean = tt9 != null && !LanguageKind.isKorean(tt9.getLanguage());
view.findViewById(R.id.numpad_column_1).setVisibility(LinearLayout.GONE);
view.findViewById(R.id.numpad_column_2).setVisibility(LinearLayout.GONE);
view.findViewById(R.id.numpad_column_3).setVisibility(LinearLayout.GONE);
view.findViewById(R.id.numpad_column_101).setVisibility(LinearLayout.VISIBLE);
view.findViewById(R.id.numpad_column_102).setVisibility(LinearLayout.VISIBLE);
view.findViewById(R.id.numpad_column_103).setVisibility(LinearLayout.VISIBLE);
for (SoftKey key : getKeys()) {
int keyId = key.getId();
if (keyId == R.id.soft_key_0) {
key.setEnabled(tt9 != null && !tt9.isInputModeNumeric() && notKorean);
} else if (key.getClass().equals(SoftKeyNumber.class) || key instanceof SoftKeyNumber0 || key instanceof SoftKeyNumber1) {
key.setVisibility(View.GONE);
}
if (key.getClass().equals(SoftKeyPunctuation.class)) {
key.setVisibility(View.INVISIBLE);
}
if (key.getClass().equals(SoftKeyFn.class)) {
key.setVisibility(View.VISIBLE);
}
if (keyId == R.id.soft_key_rf3) {
key.render();
}
if (
keyId == R.id.soft_key_add_word
|| keyId == R.id.soft_key_lf3
|| keyId == R.id.soft_key_filter
|| keyId == R.id.soft_key_shift
|| keyId == R.id.soft_key_rf3
|| keyId == R.id.soft_key_lf4
|| (keyId == R.id.soft_key_filter_suggestions && notKorean)
|| keyId == R.id.soft_key_0
|| keyId == R.id.soft_key_100
) {
key.setEnabled(false);
key.render();
}
}
}
@ -130,30 +78,27 @@ class MainLayoutNumpad extends BaseMainLayout {
void hideTextEditingPalette() {
isTextEditingShown = false;
view.findViewById(R.id.numpad_column_1).setVisibility(LinearLayout.VISIBLE);
view.findViewById(R.id.numpad_column_2).setVisibility(LinearLayout.VISIBLE);
view.findViewById(R.id.numpad_column_3).setVisibility(LinearLayout.VISIBLE);
view.findViewById(R.id.numpad_column_101).setVisibility(LinearLayout.GONE);
view.findViewById(R.id.numpad_column_102).setVisibility(LinearLayout.GONE);
view.findViewById(R.id.numpad_column_103).setVisibility(LinearLayout.GONE);
for (SoftKey key : getKeys()) {
if (key.getClass().equals(SoftKeyNumber.class) || key.getClass().equals(SoftKeyPunctuation.class) || key instanceof SoftKeyNumber0 || key instanceof SoftKeyNumber1) {
key.setVisibility(View.VISIBLE);
key.setEnabled(true);
}
if (key.getClass().equals(SoftKeyFn.class)) {
key.setVisibility(View.GONE);
}
int keyId = key.getId();
if (keyId == R.id.soft_key_rf3) {
key.render();
}
if (
keyId == R.id.soft_key_add_word
|| keyId == R.id.soft_key_lf3
|| keyId == R.id.soft_key_filter
|| keyId == R.id.soft_key_shift
|| keyId == R.id.soft_key_rf3
|| keyId == R.id.soft_key_lf4
|| keyId == R.id.soft_key_filter_suggestions
|| keyId == R.id.soft_key_0
|| keyId == R.id.soft_key_100
) {
key.setEnabled(true);
key.render();
}
}
}
@ -188,15 +133,28 @@ class MainLayoutNumpad extends BaseMainLayout {
return;
}
ViewGroup table = view.findViewById(R.id.main_soft_keys);
int tableRowsCount = table.getChildCount();
for (SoftKey key : getKeys()) {
if ((key instanceof SoftKeyArrow)) {
continue;
}
for (int rowId = 0; rowId < tableRowsCount; rowId++) {
View row = table.getChildAt(rowId);
ViewGroup.LayoutParams layout = row.getLayoutParams();
// adjust the key height
ViewGroup.LayoutParams layout = key.getLayoutParams();
if (layout != null) {
layout.height = height;
row.setLayoutParams(layout);
key.setLayoutParams(layout);
}
// adjust the overlay height (if it exists)
ViewParent parent = key.getParent();
if (!(parent instanceof RelativeLayout)) {
continue;
}
layout = ((RelativeLayout) parent).getLayoutParams();
if (layout != null) {
layout.height = height;
((RelativeLayout) parent).setLayoutParams(layout);
}
}
}
@ -206,7 +164,7 @@ class MainLayoutNumpad extends BaseMainLayout {
if (height <= 0 || forceRecalculate) {
Resources resources = tt9.getResources();
height = getKeyHeightCompat() * 4
+ resources.getDimensionPixelSize(R.dimen.numpad_candidate_height)
+ resources.getDimensionPixelSize(R.dimen.numpad_suggestion_height)
+ Math.round(resources.getDimension(R.dimen.numpad_padding_bottom))
+ getBottomInsetSize();
}
@ -265,37 +223,47 @@ class MainLayoutNumpad extends BaseMainLayout {
return keys;
}
ViewGroup table = view.findViewById(R.id.main_soft_keys);
int tableRowsCount = table.getChildCount();
ViewGroup statusBar = view.findViewById(R.id.status_bar_container);
keys.add(statusBar.findViewById(R.id.soft_key_left_arrow));
keys.add(statusBar.findViewById(R.id.soft_key_right_arrow));
for (int rowId = 0; rowId < tableRowsCount; rowId++) {
View row = table.getChildAt(rowId);
if (row instanceof ViewGroup) {
keys.addAll(getKeysFromContainer((ViewGroup) row));
}
}
ViewGroup table = view.findViewById(R.id.main_soft_keys);
keys.add(table.findViewById(R.id.soft_key_settings));
keys.add(table.findViewById(R.id.soft_key_add_word));
keys.add(table.findViewById(R.id.soft_key_shift));
keys.add(table.findViewById(R.id.soft_key_lf4));
keys.add(table.findViewById(R.id.soft_key_numpad_backspace));
keys.add(table.findViewById(R.id.soft_key_filter));
keys.add(table.findViewById(R.id.soft_key_rf3));
keys.add(table.findViewById(R.id.soft_key_numpad_ok));
keys.add(table.findViewById(R.id.soft_key_0));
keys.add(table.findViewById(R.id.soft_key_1));
keys.add(table.findViewById(R.id.soft_key_2));
keys.add(table.findViewById(R.id.soft_key_3));
keys.add(table.findViewById(R.id.soft_key_4));
keys.add(table.findViewById(R.id.soft_key_5));
keys.add(table.findViewById(R.id.soft_key_6));
keys.add(table.findViewById(R.id.soft_key_7));
keys.add(table.findViewById(R.id.soft_key_8));
keys.add(table.findViewById(R.id.soft_key_9));
keys.add(table.findViewById(R.id.soft_key_punctuation_1));
keys.add(table.findViewById(R.id.soft_key_punctuation_2));
keys.add(table.findViewById(R.id.soft_key_100));
keys.add(table.findViewById(R.id.soft_key_101));
keys.add(table.findViewById(R.id.soft_key_102));
keys.add(table.findViewById(R.id.soft_key_103));
keys.add(table.findViewById(R.id.soft_key_104));
keys.add(table.findViewById(R.id.soft_key_105));
keys.add(table.findViewById(R.id.soft_key_106));
keys.add(table.findViewById(R.id.soft_key_107));
keys.add(table.findViewById(R.id.soft_key_108));
keys.add(table.findViewById(R.id.soft_key_109));
keys.addAll(getKeysFromContainer(view.findViewById(R.id.status_bar_container)));
return keys;
}
protected ArrayList<View> getSeparators() {
// it's fine... it's shorter, faster and easier to read than searching with 3 nested loops
return new ArrayList<>(Arrays.asList(
view.findViewById(R.id.separator_top),
view.findViewById(R.id.separator_candidates_1),
view.findViewById(R.id.separator_candidates_2),
view.findViewById(R.id.separator_candidates_bottom),
view.findViewById(R.id.separator_1_1),
view.findViewById(R.id.separator_1_2),
view.findViewById(R.id.separator_2_1),
view.findViewById(R.id.separator_2_2),
view.findViewById(R.id.separator_3_1),
view.findViewById(R.id.separator_3_2),
view.findViewById(R.id.separator_4_1),
view.findViewById(R.id.separator_4_2)
));
}
}

View file

@ -1,13 +1,23 @@
package io.github.sspanak.tt9.ui.main.keys;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Looper;
import android.text.SpannableStringBuilder;
import android.text.SpannableString;
import android.text.style.RelativeSizeSpan;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewParent;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.content.res.AppCompatResources;
import io.github.sspanak.tt9.ime.TraditionalT9;
import io.github.sspanak.tt9.preferences.settings.SettingsStore;
@ -30,7 +40,9 @@ public class SoftKey extends com.google.android.material.button.MaterialButton i
private static int lastPressedKey = -1;
private boolean ignoreLastPressedKey = false;
private boolean isTitleDisabled = false;
private Drawable icon = null;
private Drawable holdIcon = null;
private RelativeLayout overlay = null;
public SoftKey(Context context) {
@ -70,6 +82,16 @@ public class SoftKey extends com.google.android.material.button.MaterialButton i
}
protected float getTT9Width() {
return tt9 != null ? tt9.getSettings().getNumpadWidthPercent() / 100f : 1;
}
protected float getTT9Height() {
return tt9 != null ? (float) tt9.getSettings().getNumpadKeyHeight() / (float) tt9.getSettings().getNumpadKeyDefaultHeight() : 1;
}
@Override
public boolean onTouch(View view, MotionEvent event) {
super.onTouchEvent(event);
@ -159,14 +181,8 @@ public class SoftKey extends com.google.android.material.button.MaterialButton i
}
public void setDarkTheme(boolean darkEnabled) {
}
@Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
setTextColor(getTextColors().withAlpha(enabled ? 255 : 80));
public boolean isHoldEnabled() {
return true;
}
@ -187,14 +203,56 @@ public class SoftKey extends com.google.android.material.button.MaterialButton i
protected int getNoEmojiTitle() { return 0; }
protected int getCentralIcon() {
return -1;
}
protected int getHoldIcon() {
return -1;
}
protected void resetIconCache() {
icon = null;
holdIcon = null;
}
/**
* getSubTitle
* Generates a String describing what the key does.
* For example: "ABC" for 2-key; "" for Backspace key, "" for Settings key, and so on.
*
* The sub title label is optional.
* Generates a String describing the "hold" function of the key. The String will be displayed
* in the upper right corner.
*/
protected String getSubTitle() {
protected String getHoldText() {
return null;
}
/**
* Generates a String describing for the swipe up function of the key
*/
protected String getTopText() {
return null;
}
/**
* Generates a String describing for the swipe right function of the key
*/
protected String getRightText() {
return null;
}
/**
* Generates a String describing for the swipe down function of the key
*/
protected String getBottomText() {
return null;
}
/**
* Generates a String describing for the swipe left function of the key
*/
protected String getLeftText() {
return null;
}
@ -218,59 +276,166 @@ public class SoftKey extends com.google.android.material.button.MaterialButton i
/**
* Multiplier for the font size when there is only one label.
* A fail-safe method to get the central icon drawable.
*/
protected float getSingleLabelRelativeSize() {
return 1;
private Drawable getIconCompat() {
if (icon == null && getCentralIcon() > 0) {
icon = AppCompatResources.getDrawable(getContext(), getCentralIcon());
}
return icon;
}
/**
* Multiplier for the title font size when there are two labels.
* A fail-safe method to get the hold icon drawable.
*/
protected float getTitleRelativeSize() {
return SettingsStore.SOFT_KEY_COMPLEX_LABEL_TITLE_RELATIVE_SIZE;
private Drawable getHoldIconCompat() {
if (holdIcon == null && getHoldIcon() > 0) {
holdIcon = AppCompatResources.getDrawable(getContext(), getHoldIcon());
}
return holdIcon;
}
/**
* Multiplier for the subtitle font size when there are two labels.
* Multiplier for the main text font size. Used for automatically adjusting the font size to fit
* the key when changing the keyboard dimensions.
*/
protected float getSubTitleRelativeSize() {
return SettingsStore.SOFT_KEY_COMPLEX_LABEL_SUB_TITLE_RELATIVE_SIZE;
protected float getTitleScale() {
return SettingsStore.SOFT_KEY_CONTENT_DEFAULT_SCALE * Math.min(getTT9Width(), getTT9Height());
}
/**
* Same as getTitleScale(), but for keys that have icons instead of text.
*/
protected float getCentralIconScale() {
float width = getTT9Width();
return width > 0.95f ? Math.min(1.15f, getTT9Height()) : Math.min(width, getTT9Height());
}
/**
* Similar to getTitleScale(), adjusts the font size of the hold text or icon
*/
protected float getHoldElementScale() {
return SettingsStore.SOFT_KEY_CONTENT_DEFAULT_SCALE * Math.min(1, getTT9Height());
}
private void getOverlayWrapper() {
if (overlay == null) {
ViewParent parent = getParent();
if (parent instanceof RelativeLayout) {
overlay = (RelativeLayout) parent;
}
}
}
/**
* render
* Sets the key label using "getTitle()" and "getSubtitle()" or if they both
* return NULL, the XML "text" attribute will be preserved.
*
* If there is only name label, it will be centered and at normal font size.
* If there is also a function label, it will be displayed below the name label and both will
* have their font size adjusted to fit inside the key.
* Sets the key labels and icons using "getTitle()", "getCenterIcon()", "getHoldText()",
* "getTopText()", "getRightText()", "getHoldIcon()", etc. Also takes care of styling the labels
* depending on "isEnabled()" and "isHoldEnabled()".
*/
public void render() {
String title = getTitleCompat();
String subtitle = getSubTitle();
boolean isKeyEnabled = isEnabled();
boolean isHoldEnabled = isHoldEnabled();
renderTitle(isKeyEnabled);
getOverlayWrapper();
renderOverlayDrawable("overlay_icon", getIconCompat(), getCentralIconScale(), isKeyEnabled);
renderOverlayText("overlay_hold_text", getHoldText(), getHoldElementScale(), isKeyEnabled && isHoldEnabled);
renderOverlayDrawable("overlay_hold_icon", getHoldIconCompat(), getHoldElementScale(), isKeyEnabled && isHoldEnabled);
renderOverlayText("overlay_top_text", getTopText(), getHoldElementScale(), isKeyEnabled);
renderOverlayText("overlay_right_text", getRightText(), getHoldElementScale(), isKeyEnabled);
renderOverlayText("overlay_bottom_text", getBottomText(), getHoldElementScale(), isKeyEnabled);
renderOverlayText("overlay_left_text", getLeftText(), getHoldElementScale(), isKeyEnabled);
}
/**
* Renders the central text of the key and styles it based on "isEnabled".
*/
private void renderTitle(boolean isEnabled) {
String title = getTitleCompat();
if (title == null) {
return;
}
SpannableStringBuilder sb = new SpannableStringBuilder(title);
if (subtitle != null) {
sb.append(" ");
sb.append(subtitle);
setTextColor(getTextColors().withAlpha(isEnabled ? 255 : 110));
float scale = getTitleScale();
if (scale == 1) {
setText(title);
return;
}
setText(sb);
SpannableString text = new SpannableString(title);
text.setSpan(new RelativeSizeSpan(scale), 0, title.length(), 0);
setText(text);
}
protected void setTitleDisabled(boolean yes) {
isTitleDisabled = yes;
/**
* Renders text in the given overlay element, with optional scaling and alpha. The overlay
* text elements are either the "hold" text or the "swipe" text.
*/
private void renderOverlayText(String elementTag, @Nullable String text, float scale, boolean isEnabled) {
if (overlay == null) {
return;
}
View element = ((RelativeLayout) getParent()).findViewWithTag(elementTag);
if (!(element instanceof TextView el)) {
return;
}
el.setTextColor(el.getTextColors().withAlpha(isEnabled ? 255 : 110));
if (text == null || scale == 1) {
el.setText(text);
return;
}
SpannableString scaledText = new SpannableString(text);
scaledText.setSpan(new RelativeSizeSpan(scale), 0, scaledText.length(), 0);
el.setText(scaledText);
}
/**
* Renders one of the key icons. It could be either the central icon, in the place of the main title,
* or a hold icon, displayed in the upper right corner.
*/
private void renderOverlayDrawable(String elementTag, @Nullable Drawable drawable, float scale, boolean isEnabled) {
if (overlay == null) {
return;
}
View element = ((RelativeLayout) getParent()).findViewWithTag(elementTag);
if (!(element instanceof ImageView el)) {
return;
}
el.setImageDrawable(drawable);
if (!isEnabled) {
el.setColorFilter(Color.GRAY);
} else {
el.clearColorFilter();
}
if (drawable != null) {
el.setScaleX(scale);
el.setScaleY(scale);
}
}

View file

@ -3,12 +3,17 @@ package io.github.sspanak.tt9.ui.main.keys;
import android.content.Context;
import android.util.AttributeSet;
import io.github.sspanak.tt9.R;
public class SoftKeyAddWord extends SoftKey {
public SoftKeyAddWord(Context context) { super(context); }
public SoftKeyAddWord(Context context, AttributeSet attrs) { super(context, attrs); }
public SoftKeyAddWord(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); }
@Override protected String getTitle() { return ""; }
@Override
protected int getCentralIcon() {
return R.drawable.ic_fn_add_word;
}
@Override
protected boolean handleRelease() {
@ -22,9 +27,9 @@ public class SoftKeyAddWord extends SoftKey {
@Override
public void render() {
super.render();
if (tt9 != null) {
setEnabled(!tt9.isVoiceInputActive() && tt9.notLanguageSyllabary());
setEnabled(!tt9.isVoiceInputActive() && tt9.notLanguageSyllabary() && !tt9.isTextEditingActive());
}
super.render();
}
}

View file

@ -141,6 +141,12 @@ public class SoftKeyBackspace extends SwipeableKey {
}
@Override
protected float getTitleScale() {
return tt9 != null && tt9.getSettings().isMainLayoutNumpad() ? super.getTitleScale() : SettingsStore.SOFT_KEY_CONTENT_DEFAULT_SCALE;
}
@Override
protected int getNoEmojiTitle() {
return R.string.virtual_key_del;

View file

@ -0,0 +1,42 @@
package io.github.sspanak.tt9.ui.main.keys;
import android.content.Context;
import android.util.AttributeSet;
import io.github.sspanak.tt9.R;
public class SoftKeyFText extends SoftKeyFn {
public SoftKeyFText(Context context) {
super(context);
}
public SoftKeyFText(Context context, AttributeSet attrs) {
super(context, attrs);
}
public SoftKeyFText(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected String getTitle() {
return "";
}
@Override
protected int getCentralIcon() {
int keyId = getId();
if (keyId == R.id.soft_key_101) return R.drawable.ic_dpad_left;
if (keyId == R.id.soft_key_102) return R.drawable.ic_txt_select_none;
if (keyId == R.id.soft_key_103) return R.drawable.ic_dpad_right;
if (keyId == R.id.soft_key_104) return R.drawable.ic_txt_word_back;
if (keyId == R.id.soft_key_105) return R.drawable.ic_txt_select_all;
if (keyId == R.id.soft_key_106) return R.drawable.ic_txt_word_forward;
if (keyId == R.id.soft_key_107) return R.drawable.ic_txt_cut;
if (keyId == R.id.soft_key_108) return R.drawable.ic_txt_copy;
if (keyId == R.id.soft_key_109) return R.drawable.ic_txt_paste;
return -1;
}
}

View file

@ -2,6 +2,7 @@ package io.github.sspanak.tt9.ui.main.keys;
import android.content.Context;
import android.util.AttributeSet;
import android.view.Gravity;
import io.github.sspanak.tt9.languages.LanguageKind;
import io.github.sspanak.tt9.ui.Vibration;
@ -12,17 +13,10 @@ public class SoftKeyFilter extends SoftKey {
public SoftKeyFilter(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); }
@Override
protected float getTitleRelativeSize() {
return isKorean() ? 1.1f : super.getTitleRelativeSize() / 0.85f;
protected float getTitleScale() {
return isKorean() ? 1.5f * getTT9Height() : Math.min(getTT9Width(), getTT9Height());
}
@Override
protected float getSubTitleRelativeSize() {
return super.getSubTitleRelativeSize() / 0.85f;
}
private boolean isKorean() {
return tt9 != null && LanguageKind.isKorean(tt9.getLanguage());
}
@ -59,26 +53,34 @@ public class SoftKeyFilter extends SoftKey {
@Override
protected String getTitle() {
return isKorean() ? "" : "CLR";
return isKorean() ? "" : "FLTR";
}
@Override
protected String getSubTitle() {
return isKorean() ? null : "FLTR";
protected String getHoldText() {
return isKorean() ? null : "CLR";
}
@Override
public void render() {
super.render();
setGravity(
isKorean() ? Gravity.TOP | Gravity.CENTER_HORIZONTAL: Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL
);
if (tt9 != null) {
setEnabled(
!tt9.isInputModeNumeric()
&& !tt9.isInputModeABC()
&& !tt9.isVoiceInputActive()
&& (LanguageKind.isKorean(tt9.getLanguage()) || tt9.notLanguageSyllabary())
&& (
LanguageKind.isKorean(tt9.getLanguage())
|| (tt9.notLanguageSyllabary() && !tt9.isTextEditingActive())
)
);
}
super.render();
}
}

View file

@ -12,7 +12,11 @@ public class SoftKeyFn extends SoftKeyNumber {
@Override protected void handleHold() { preventRepeat(); }
@Override protected String getTitle() { return getNumber(getId()) + ""; }
@Override protected String getSubTitle() { return null; }
@Override
protected float getTitleScale() {
return 1;
}
@Override
protected int getNumber(int keyId) {

View file

@ -2,6 +2,7 @@ package io.github.sspanak.tt9.ui.main.keys;
import android.content.Context;
import android.util.AttributeSet;
import android.view.Gravity;
import io.github.sspanak.tt9.R;
import io.github.sspanak.tt9.ui.Vibration;
@ -11,14 +12,10 @@ public class SoftKeyLF4 extends SwipeableKey {
public SoftKeyLF4(Context context, AttributeSet attrs) { super(context, attrs); }
public SoftKeyLF4(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); }
@Override protected float getTitleRelativeSize() { return super.getTitleRelativeSize() / 0.85f; }
@Override protected float getSubTitleRelativeSize() { return super.getSubTitleRelativeSize() / 0.85f; }
private boolean areThereManyLanguages() {
return tt9 != null && tt9.getSettings().getEnabledLanguageIds().size() > 1;
}
@Override
protected void handleHold() {
preventRepeat();
@ -46,34 +43,42 @@ public class SoftKeyLF4 extends SwipeableKey {
}
}
protected String getHoldIcon() {
return "🌐";
}
protected String getPressIcon() {
@Override
protected String getTitle() {
return tt9 != null ? tt9.getInputModeName() : getContext().getString(R.string.virtual_key_input_mode);
}
@Override
protected String getTitle() {
return areThereManyLanguages() ? getHoldIcon() : getPressIcon();
protected int getHoldIcon() {
return areThereManyLanguages() ? R.drawable.ic_fn_next_language : -1;
}
@Override
protected String getSubTitle() {
return areThereManyLanguages() ? getPressIcon() : null;
protected float getHoldElementScale() {
return super.getHoldElementScale() * 0.8f;
}
@Override
public boolean isHoldEnabled() {
return tt9 != null && !tt9.isInputModeNumeric();
}
@Override
public void render() {
setTitleDisabled(tt9 != null && tt9.isInputModeNumeric() && areThereManyLanguages());
super.render();
if (tt9 != null && tt9.isInputModeNumeric()) {
resetIconCache();
}
setGravity(areThereManyLanguages() ? Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM : Gravity.CENTER);
setEnabled(
tt9 != null
&& !tt9.isVoiceInputActive()
&& !tt9.isNumericModeStrict()
&& !tt9.isInputModePhone()
&& !tt9.isTextEditingActive()
);
super.render();
}
}

View file

@ -5,21 +5,10 @@ import android.util.AttributeSet;
import android.util.SparseArray;
import android.view.KeyEvent;
import androidx.annotation.NonNull;
import java.util.ArrayList;
import java.util.Locale;
import io.github.sspanak.tt9.R;
import io.github.sspanak.tt9.ime.TraditionalT9;
import io.github.sspanak.tt9.ime.helpers.Key;
import io.github.sspanak.tt9.ime.modes.InputMode;
import io.github.sspanak.tt9.languages.Language;
import io.github.sspanak.tt9.languages.LanguageKind;
import io.github.sspanak.tt9.preferences.settings.SettingsStore;
import io.github.sspanak.tt9.ui.Vibration;
import io.github.sspanak.tt9.util.Logger;
import io.github.sspanak.tt9.util.TextTools;
public class SoftKeyNumber extends SoftKey {
private final static SparseArray<Integer> NUMBERS = new SparseArray<>() {{
@ -45,28 +34,9 @@ public class SoftKeyNumber extends SoftKey {
}};
public SoftKeyNumber(Context context) {
super(context);
}
public SoftKeyNumber(Context context, AttributeSet attrs) {
super(context, attrs);
}
public SoftKeyNumber(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
private boolean isArabicNumber() {
return tt9 != null && !tt9.isInputModeNumeric() && LanguageKind.isArabic(tt9.getLanguage());
}
@Override
protected float getTitleRelativeSize() {
return isArabicNumber() ? SettingsStore.SOFT_KEY_COMPLEX_LABEL_ARABIC_TITLE_RELATIVE_SIZE : SettingsStore.SOFT_KEY_COMPLEX_LABEL_TITLE_RELATIVE_SIZE;
}
public SoftKeyNumber(Context context) { super(context); }
public SoftKeyNumber(Context context, AttributeSet attrs) { super(context, attrs); }
public SoftKeyNumber(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); }
@Override
@ -114,11 +84,8 @@ public class SoftKeyNumber extends SoftKey {
}
@Override
protected String getTitle() {
int number = getNumber(getId());
if (isArabicNumber() && tt9.getLanguage() != null) {
protected String getLocalizedNumber(int number) {
if (isArabicNumber() && tt9 != null && tt9.getLanguage() != null) {
return tt9.getLanguage().getKeyNumber(number);
} else {
return String.valueOf(number);
@ -127,96 +94,13 @@ public class SoftKeyNumber extends SoftKey {
@Override
protected String getSubTitle() {
return tt9 == null ? null : getKeyCharList(tt9, getNumber(getId()));
protected float getHoldElementScale() {
float defaultScale = super.getHoldElementScale();
return tt9 != null && LanguageKind.isArabic(tt9.getLanguage()) ? defaultScale * 1.25f : defaultScale;
}
private String getKeyCharList(@NonNull TraditionalT9 tt9, int number) {
if (tt9.isInputModeNumeric()) {
return null; // no special labels in 123 mode
}
Language language = tt9.getLanguage();
if (language == null) {
Logger.d("SoftKeyNumber.getLabel", "Cannot generate a label when the language is NULL.");
return null;
}
ArrayList<String> chars = language.getKeyCharacters(number);
boolean isGreek = LanguageKind.isGreek(language);
boolean isLatinBased = LanguageKind.isLatinBased(language);
boolean isUppercase = tt9.getTextCase() == InputMode.CASE_UPPER;
final int maxChars = LanguageKind.isIndic(language) ? SettingsStore.SOFT_KEY_TITLE_MAX_CHARS_INDIC : SettingsStore.SOFT_KEY_TITLE_MAX_CHARS;
String displayChars = getDefaultCharList(chars, language.getLocale(), isGreek, isLatinBased, isUppercase);
if (displayChars.length() > maxChars) {
displayChars = abbreviateCharList(displayChars, language.getLocale(), isUppercase);
}
return displayChars;
}
/**
* Joins the key characters into a single string, skipping accented characters
* when neccessary
*/
private String getDefaultCharList(ArrayList<String> chars, Locale locale, boolean isGreek, boolean isLatinBased, boolean isUppercase) {
StringBuilder sb = new StringBuilder();
for (String currentLetter : chars) {
if (shouldSkipAccents(currentLetter.charAt(0), isGreek, isLatinBased)) {
continue;
}
sb.append(
isUppercase ? currentLetter.toUpperCase(locale) : currentLetter
);
}
return sb.toString();
}
/**
* In some languages there are many characters for a single key. Naturally, they can not all fit
* on one key. As suggested by the community, we could display them as "A-Z".
* @see <a href="https://github.com/sspanak/tt9/issues/628">Issue #628</a>
*/
private String abbreviateCharList(String chars, Locale locale, boolean isUppercase) {
String firstLetter = chars.substring(0, 1);
String lastLetter = chars.substring(chars.length() - 1);
boolean containsCombiningChars = TextTools.isCombining(firstLetter) || TextTools.isCombining(lastLetter);
return
(isUppercase ? firstLetter.toUpperCase(locale) : firstLetter)
+ (containsCombiningChars ? " " : "")
+ (isUppercase ? lastLetter.toUpperCase(locale) : lastLetter);
}
/**
* Reduces the number of displayed characters by leaving the most descriptive ones. This prevents
* the visual clutter on the keys.
*/
private boolean shouldSkipAccents(char currentLetter, boolean isGreek, boolean isLatinBased) {
return
// Latin. As suggested by the community, there is no need to display the accented letters. People are
// used to seeing just "ABC", "DEF", etc.
(isLatinBased && currentLetter > 'z')
// Cyrillic. Same as above.
|| currentLetter == 'ѝ' || currentLetter == 'ґ'
// Korean double consonants
|| (currentLetter == 'ㄲ' || currentLetter == 'ㄸ' || currentLetter == 'ㅃ' || currentLetter == 'ㅆ' || currentLetter == 'ㅉ')
// Greek diacritics and ending sigma
|| currentLetter == 'ς'
|| (isGreek && (currentLetter < 'α' || currentLetter > 'ω'))
// Hindi combining
|| (currentLetter >= 0x0900 && currentLetter <= 0x0903) || (currentLetter >= 0x093A && currentLetter <= 0x094F)
|| (currentLetter >= 0x0951 && currentLetter <= 0x0957) || currentLetter == 0x0962 || currentLetter == 0x0963
// Gujarati combining
|| (currentLetter >= 0x0A81 && currentLetter <= 0x0A83) || (currentLetter >= 0xABC && currentLetter <= 0x0ACD)
|| currentLetter == 0x0AE2 || currentLetter == 0x0AE3
;
private boolean isArabicNumber() {
return tt9 != null && !tt9.isInputModeNumeric() && LanguageKind.isArabic(tt9.getLanguage());
}
}

View file

@ -13,13 +13,18 @@ public class SoftKeyNumber0 extends SoftKeyNumber {
public SoftKeyNumber0(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); }
@Override
protected String getTitle() {
if (tt9 == null) {
return super.getTitle();
protected int getNumber(int keyId) {
return 0;
}
if (tt9.isNumericModeStrict()) {
return "0";
@Override
protected String getHoldText() {
if (tt9 == null) {
return null;
}
if (tt9.isTextEditingActive() || tt9.isNumericModeStrict()) {
return "";
} if (tt9.isNumericModeSigned()) {
return "+/-";
} else if (tt9.isInputModePhone()) {
@ -28,24 +33,16 @@ public class SoftKeyNumber0 extends SoftKeyNumber {
return CHARS_NUMERIC_MODE;
}
return super.getTitle();
return super.getLocalizedNumber(getNumber(getId()));
}
@Override
protected String getSubTitle() {
if (tt9 == null) {
return null;
protected String getTitle() {
if (tt9 == null || tt9.isInputModeNumeric()) {
return "0";
}
if (tt9.isNumericModeStrict()) {
return null;
} else if (tt9.isInputModeNumeric()) {
return "0";
} else if (LanguageKind.isKorean(tt9.getLanguage())) {
return getKoreanCharList();
} else {
return "";
}
return (LanguageKind.isKorean(tt9.getLanguage())) ? getKoreanCharList() : "";
}
private String getKoreanCharList() {
@ -64,11 +61,31 @@ public class SoftKeyNumber0 extends SoftKeyNumber {
}
@Override
protected float getSubTitleRelativeSize() {
protected float getTitleScale() {
if (tt9 != null && !tt9.isInputModeNumeric() && !LanguageKind.isKorean(tt9.getLanguage())) {
return 1.1f;
return 1.5f * getTT9Height();
}
return super.getSubTitleRelativeSize();
return super.getTitleScale();
}
@Override
public void render() {
if (tt9 != null && LanguageKind.isKorean(tt9.getLanguage()) && tt9.isTextEditingActive()) {
setVisibility(GONE);
} else {
setVisibility(VISIBLE);
}
setEnabled(
tt9 != null
&& (
!tt9.isTextEditingActive()
|| (!LanguageKind.isKorean(tt9.getLanguage()) && !tt9.isInputModeNumeric())
)
);
super.render();
}
}

View file

@ -16,33 +16,27 @@ public class SoftKeyNumber1 extends SoftKeyNumber {
@Override
protected String getTitle() {
if (tt9 == null) {
return super.getTitle();
}
if (tt9.isInputModeNumeric() && !tt9.isNumericModeStrict()) {
return DEFAULT_LARGE_LABEL;
} else if (LanguageKind.isKorean(tt9.getLanguage())) {
return KOREAN_SMALL_LABEL;
} else {
if (tt9 == null || tt9.isInputModeNumeric()) {
return "1";
}
return LanguageKind.isKorean(tt9.getLanguage()) ? KOREAN_LARGE_LABEL : DEFAULT_LARGE_LABEL;
}
@Override
protected String getSubTitle() {
protected String getHoldText() {
if (tt9 == null || tt9.isNumericModeStrict()) {
return null;
}
if (tt9.isNumericModeStrict()) {
return null;
} else if (tt9.isInputModeNumeric()) {
return "1";
} else if (LanguageKind.isKorean(tt9.getLanguage())) {
return KOREAN_LARGE_LABEL;
} else {
if (tt9.isInputModeNumeric()) {
return DEFAULT_LARGE_LABEL;
}
if (LanguageKind.isKorean(tt9.getLanguage())) {
return KOREAN_SMALL_LABEL;
}
return super.getLocalizedNumber(getNumber(getId()));
}
}

View file

@ -0,0 +1,128 @@
package io.github.sspanak.tt9.ui.main.keys;
import android.content.Context;
import android.util.AttributeSet;
import androidx.annotation.NonNull;
import java.util.ArrayList;
import java.util.Locale;
import io.github.sspanak.tt9.ime.TraditionalT9;
import io.github.sspanak.tt9.ime.modes.InputMode;
import io.github.sspanak.tt9.languages.Language;
import io.github.sspanak.tt9.languages.LanguageKind;
import io.github.sspanak.tt9.preferences.settings.SettingsStore;
import io.github.sspanak.tt9.util.Logger;
import io.github.sspanak.tt9.util.TextTools;
public class SoftKeyNumber2to9 extends SoftKeyNumber {
public SoftKeyNumber2to9(Context context) { super(context); }
public SoftKeyNumber2to9(Context context, AttributeSet attrs) { super(context, attrs); }
public SoftKeyNumber2to9(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); }
@Override
protected String getHoldText() {
if (tt9 == null || tt9.isInputModeNumeric()) {
return null;
}
return getLocalizedNumber(getNumber(getId()));
}
@Override
protected String getTitle() {
if (tt9 != null && !tt9.isInputModeNumeric()) {
return getKeyChars(tt9, getNumber(getId()));
} else {
return getLocalizedNumber(getNumber(getId()));
}
}
private String getKeyChars(@NonNull TraditionalT9 tt9, int number) {
Language language = tt9.getLanguage();
if (language == null) {
Logger.d("SoftKeyNumber.getLabel", "Cannot generate a label when the language is NULL.");
return null;
}
ArrayList<String> chars = language.getKeyCharacters(number);
boolean isGreek = LanguageKind.isGreek(language);
boolean isLatinBased = LanguageKind.isLatinBased(language);
boolean isUppercase = tt9.getTextCase() == InputMode.CASE_UPPER;
final int maxChars = LanguageKind.isIndic(language) ? SettingsStore.SOFT_KEY_TITLE_MAX_CHARS_INDIC : SettingsStore.SOFT_KEY_TITLE_MAX_CHARS;
String displayChars = getDefaultCharList(chars, language.getLocale(), isGreek, isLatinBased, isUppercase);
if (displayChars.length() > maxChars) {
displayChars = abbreviateCharList(displayChars, language.getLocale(), isUppercase);
}
return displayChars;
}
/**
* Joins the key characters into a single string, skipping accented characters
* when neccessary
*/
private String getDefaultCharList(ArrayList<String> chars, Locale locale, boolean isGreek, boolean isLatinBased, boolean isUppercase) {
StringBuilder sb = new StringBuilder();
for (String currentLetter : chars) {
if (shouldSkipAccents(currentLetter.charAt(0), isGreek, isLatinBased)) {
continue;
}
sb.append(
isUppercase ? currentLetter.toUpperCase(locale) : currentLetter
);
}
return sb.toString();
}
/**
* In some languages there are many characters for a single key. Naturally, they can not all fit
* on one key. As suggested by the community, we could display them as "A-Z".
* @see <a href="https://github.com/sspanak/tt9/issues/628">Issue #628</a>
*/
private String abbreviateCharList(String chars, Locale locale, boolean isUppercase) {
String firstLetter = chars.substring(0, 1);
String lastLetter = chars.substring(chars.length() - 1);
boolean containsCombiningChars = TextTools.isCombining(firstLetter) || TextTools.isCombining(lastLetter);
return
(isUppercase ? firstLetter.toUpperCase(locale) : firstLetter)
+ (containsCombiningChars ? " " : "")
+ (isUppercase ? lastLetter.toUpperCase(locale) : lastLetter);
}
/**
* Reduces the number of displayed characters by leaving the most descriptive ones. This prevents
* the visual clutter on the keys.
*/
private boolean shouldSkipAccents(char currentLetter, boolean isGreek, boolean isLatinBased) {
return
// Latin. As suggested by the community, there is no need to display the accented letters. People are
// used to seeing just "ABC", "DEF", etc.
(isLatinBased && currentLetter > 'z')
// Cyrillic. Same as above.
|| currentLetter == 'ѝ' || currentLetter == 'ґ'
// Korean double consonants
|| (currentLetter == 'ㄲ' || currentLetter == 'ㄸ' || currentLetter == 'ㅃ' || currentLetter == 'ㅆ' || currentLetter == 'ㅉ')
// Greek diacritics and ending sigma
|| currentLetter == 'ς'
|| (isGreek && (currentLetter < 'α' || currentLetter > 'ω'))
// Hindi combining
|| (currentLetter >= 0x0900 && currentLetter <= 0x0903) || (currentLetter >= 0x093A && currentLetter <= 0x094F)
|| (currentLetter >= 0x0951 && currentLetter <= 0x0957) || currentLetter == 0x0962 || currentLetter == 0x0963
// Gujarati combining
|| (currentLetter >= 0x0A81 && currentLetter <= 0x0A83) || (currentLetter >= 0xABC && currentLetter <= 0x0ACD)
|| currentLetter == 0x0AE2 || currentLetter == 0x0AE3
;
}
}

View file

@ -33,9 +33,9 @@ public class SoftKeyOk extends SoftKey {
@Override
public void render() {
super.render();
if (tt9 != null) {
setEnabled(!tt9.isVoiceInputActive());
}
super.render();
}
}

View file

@ -27,15 +27,8 @@ public class SoftKeyRF3 extends SoftKey {
@Override
protected float getTitleRelativeSize() {
return super.getTitleRelativeSize() / 0.85f;
}
@Override
protected float getSubTitleRelativeSize() {
float scale = (isTextEditingMissing() && !isVoiceInputMissing()) || isTextEditingActive() ? 0.85f : 0.96f;
return super.getSubTitleRelativeSize() / scale;
protected float getTitleScale() {
return super.getTitleScale() / 0.85f;
}
@ -72,30 +65,44 @@ public class SoftKeyRF3 extends SoftKey {
@Override
protected String getTitle() {
if (isTextEditingActive()) {
return tt9 == null ? "ABC" : tt9.getABCString();
return "";
}
if (!isVoiceInputMissing()) {
return "🎤";
if (isTextEditingMissing() && !isVoiceInputMissing()) {
return "";
}
return getContext().getString(R.string.virtual_key_text_editing).toUpperCase();
return "";
}
@Override
protected String getSubTitle() {
protected int getCentralIcon() {
if (isTextEditingActive()) {
return R.drawable.ic_keyboard;
}
if (isTextEditingMissing() && !isVoiceInputMissing()) {
return R.drawable.ic_fn_voice;
}
return -1;
}
@Override
protected int getHoldIcon() {
if (isTextEditingActive() || isTextEditingMissing() || isVoiceInputMissing()) {
return null;
return -1;
}
return getContext().getString(R.string.virtual_key_text_editing).toUpperCase();
return R.drawable.ic_fn_voice;
}
@Override
public void render() {
super.render();
resetIconCache();
setEnabled(!(isVoiceInputMissing() && isTextEditingMissing()));
super.render();
}
}

View file

@ -56,8 +56,34 @@ public class SoftKeySettings extends SwipeableKey {
if (mainView != null) mainView.onResize(position);
}
@Override
protected int getNoEmojiTitle() {
return R.string.virtual_key_settings;
protected int getCentralIcon() {
return R.drawable.ic_fn_settings;
}
@Override
protected String getTopText() {
return getContext().getString(R.string.key_dpad_up);
}
@Override
protected String getRightText() {
return getContext().getString(R.string.key_dpad_right);
}
@Override
protected String getBottomText() {
return getContext().getString(R.string.key_dpad_down);
}
@Override
protected String getLeftText() {
return getContext().getString(R.string.key_dpad_left);
}
@Override
protected float getCentralIconScale() {
return super.getCentralIconScale() * 0.9f;
}
}

View file

@ -1,9 +1,10 @@
package io.github.sspanak.tt9.ui.main.keys;
import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;
import io.github.sspanak.tt9.R;
public class SoftKeyShift extends SoftKey {
public SoftKeyShift(Context context) {
super(context);
@ -17,8 +18,9 @@ public class SoftKeyShift extends SoftKey {
super(context, attrs, defStyleAttr);
}
@Override protected float getSingleLabelRelativeSize() { return 1.7f; }
@Override protected String getTitle() { return ""; }
@Override protected int getCentralIcon() {
return R.drawable.ic_fn_shift;
}
@Override
protected boolean handleRelease() {
@ -27,8 +29,13 @@ public class SoftKeyShift extends SoftKey {
@Override
public void render() {
setTypeface(Typeface.DEFAULT_BOLD);
setEnabled(
tt9 != null
&& !tt9.isVoiceInputActive()
&& !tt9.isInputModePhone()
&& !tt9.isNumericModeSigned()
&& !tt9.isTextEditingActive()
);
super.render();
setEnabled(tt9 != null && !tt9.isVoiceInputActive() && !tt9.isInputModePhone() && !tt9.isNumericModeSigned());
}
}

View file

@ -1,11 +1,8 @@
package io.github.sspanak.tt9.ui.tray;
import android.content.Context;
import android.view.View;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import io.github.sspanak.tt9.R;
import io.github.sspanak.tt9.ime.modes.InputMode;
import io.github.sspanak.tt9.ime.voice.VoiceInputOps;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 576 B

View file

@ -1,3 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="960" android:viewportWidth="960" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M160,880Q127,880 103.5,856.5Q80,833 80,800L80,400Q80,367 103.5,343.5Q127,320 160,320L800,320Q833,320 856.5,343.5Q880,367 880,400L880,800Q880,833 856.5,856.5Q833,880 800,880L160,880ZM160,800L800,800Q800,800 800,800Q800,800 800,800L800,400Q800,400 800,400Q800,400 800,400L160,400Q160,400 160,400Q160,400 160,400L160,800Q160,800 160,800Q160,800 160,800ZM360,760L600,760Q617,760 628.5,748.5Q640,737 640,720Q640,703 628.5,691.5Q617,680 600,680L360,680Q343,680 331.5,691.5Q320,703 320,720Q320,737 331.5,748.5Q343,760 360,760ZM160,800Q160,800 160,800Q160,800 160,800L160,400Q160,400 160,400Q160,400 160,400L160,400Q160,400 160,400Q160,400 160,400L160,800Q160,800 160,800Q160,800 160,800ZM375,160L400,160Q417,160 428.5,171.5Q440,183 440,200Q440,217 428.5,228.5Q417,240 400,240L280,240Q263,240 251.5,228.5Q240,217 240,200L240,80Q240,63 251.5,51.5Q263,40 280,40Q297,40 308.5,51.5Q320,63 320,80L320,101Q352,72 393,56Q434,40 480,40Q560,40 623,87.5Q686,135 709,210Q713,223 702,231.5Q691,240 675,240Q659,240 645,234Q631,228 625,214Q605,172 566.5,146Q528,120 480,120Q450,120 423,130.5Q396,141 375,160ZM240,520Q257,520 268.5,508.5Q280,497 280,480Q280,463 268.5,451.5Q257,440 240,440Q223,440 211.5,451.5Q200,463 200,480Q200,497 211.5,508.5Q223,520 240,520ZM360,520Q377,520 388.5,508.5Q400,497 400,480Q400,463 388.5,451.5Q377,440 360,440Q343,440 331.5,451.5Q320,463 320,480Q320,497 331.5,508.5Q343,520 360,520ZM480,520Q497,520 508.5,508.5Q520,497 520,480Q520,463 508.5,451.5Q497,440 480,440Q463,440 451.5,451.5Q440,463 440,480Q440,497 451.5,508.5Q463,520 480,520ZM600,520Q617,520 628.5,508.5Q640,497 640,480Q640,463 628.5,451.5Q617,440 600,440Q583,440 571.5,451.5Q560,463 560,480Q560,497 571.5,508.5Q583,520 600,520ZM720,520Q737,520 748.5,508.5Q760,497 760,480Q760,463 748.5,451.5Q737,440 720,440Q703,440 691.5,451.5Q680,463 680,480Q680,497 691.5,508.5Q703,520 720,520ZM240,640Q257,640 268.5,628.5Q280,617 280,600Q280,583 268.5,571.5Q257,560 240,560Q223,560 211.5,571.5Q200,583 200,600Q200,617 211.5,628.5Q223,640 240,640ZM360,640Q377,640 388.5,628.5Q400,617 400,600Q400,583 388.5,571.5Q377,560 360,560Q343,560 331.5,571.5Q320,583 320,600Q320,617 331.5,628.5Q343,640 360,640ZM480,640Q497,640 508.5,628.5Q520,617 520,600Q520,583 508.5,571.5Q497,560 480,560Q463,560 451.5,571.5Q440,583 440,600Q440,617 451.5,628.5Q463,640 480,640ZM600,640Q617,640 628.5,628.5Q640,617 640,600Q640,583 628.5,571.5Q617,560 600,560Q583,560 571.5,571.5Q560,583 560,600Q560,617 571.5,628.5Q583,640 600,640ZM680,600Q680,617 691.5,628.5Q703,640 720,640Q737,640 748.5,628.5Q760,617 760,600Q760,583 748.5,571.5Q737,560 720,560Q703,560 691.5,571.5Q680,583 680,600Z"/>
<path android:fillColor="@android:color/white" android:pathData="M80,880L80,320L880,320L880,880L80,880ZM160,800L800,800L800,400L160,400L160,800ZM320,760L640,760L640,680L320,680L320,760ZM200,640L280,640L280,560L200,560L200,640ZM320,640L400,640L400,560L320,560L320,640ZM440,640L520,640L520,560L440,560L440,640ZM560,640L640,640L640,560L560,560L560,640ZM680,640L760,640L760,560L680,560L680,640ZM200,520L280,520L280,440L200,440L200,520ZM320,520L400,520L400,440L320,440L320,520ZM440,520L520,520L520,440L440,440L440,520ZM560,520L640,520L640,440L560,440L560,520ZM680,520L760,520L760,440L680,440L680,520ZM160,800L160,400L160,400L160,800ZM240,240L240,40L320,40L320,101Q352,72 393,56Q434,40 480,40Q568,40 635,96.5Q702,153 716,240L634,240Q620,187 577.5,153.5Q535,120 480,120Q450,120 423,130.5Q396,141 375,160L440,160L440,240L240,240Z"/>
</vector>

View file

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="960" android:viewportWidth="960" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M204 320q29-50 72.5-87T376 178q-18 33-31.5 68.5T322 320H204Zm200 0q12-44 31-83t45-75q26 36 45 75t31 83H404Zm234 0q-9-38-22.5-73.5T584 178q56 18 99.5 55T756 320H638Zm16 240q3-20 4.5-39.5T660 480t-1.5-40.5T654 400H790q5 20 7.5 39.5T800 480t-2.5 40.5T790 560H654Zm-268 0q-3-20-4.5-39.5T380 480t1.5-40.5T386 400H574q3 20 4.5 39.5T580 480t-1.5 40.5T574 560H386Zm-216 0q-5-20-7.5-39.5T160 480t2.5-40.5T170 400H306q-3 20-4.5 39.5T300 480t1.5 40.5T306 560H170ZM584 782q18-33 31.5-68.5T638 640H756q-29 50-72.5 87T584 782Zm-208 0q-56-18-99.5-55T204 640H322q9 38 22.5 73.5T376 782Zm104 16q-26-36-45-75t-31-83H556q-12 44-31 83t-45 75Zm0 82q83 0 155.5-31.5t127-86 86-127.5T880 480q0-83-31.5-155.5t-86-127-127-86T480 80q-82 0-155 31.5t-127.5 86-86 127T80 480q0 82 31.5 155t86 127.5 127.5 86T480 880Z"/>
</vector>

View file

@ -1,3 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/>
<path android:fillColor="@android:color/white" android:pathData="M12 15.6c2 0 3.6 -1.6 3.6 -3.6S14 8.4 12 8.4S8.4 10 8.4 12s1.6 3.6 3.6 3.6Zm7.2 -2.7l2 1.6c0.2 0.1 0.2 0.4 0.1 0.6l-1.9 3.3c-0.1 0.2 -0.4 0.3 -0.6 0.2l-2.4 -1c-0.5 0.4 -1 0.7 -1.6 0.9l-0.4 2.5c0 0.2 -0.2 0.4 -0.5 0.4H10.1c-0.2 0 -0.4 -0.2 -0.5 -0.4l-0.4 -2.5c-0.6 -0.2 -1.1 -0.6 -1.6 -0.9l-2.4 1c-0.2 0.1 -0.5 0 -0.6 -0.2L2.7 15.1c-0.1 -0.2 -0.1 -0.5 0.1 -0.6l2 -1.6c-0.1 -0.3 -0.1 -0.6 -0.1 -0.9s0 -0.6 0.1 -0.9L2.9 9.5c-0.2 -0.1 -0.2 -0.4 -0.1 -0.6L4.7 5.5c0.1 -0.2 0.4 -0.3 0.6 -0.2l2.4 1c0.5 -0.4 1 -0.7 1.6 -0.9l0.4 -2.5c0 -0.2 0.2 -0.4 0.5 -0.4H14c0.2 0 0.4 0.2 0.5 0.4l0.4 2.5c0.6 0.2 1.1 0.6 1.6 0.9l2.4 -1c0.2 -0.1 0.5 0 0.6 0.2l1.9 3.3c0.1 0.2 0.1 0.5 -0.1 0.6l-2 1.6c0.1 0.3 0.1 0.6 0.1 0.9s0 0.6 -0.1 0.9Z"/>
</vector>

View file

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="960" android:viewportWidth="960" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M320,800L320,520L204,520Q178,520 167.5,497.5Q157,475 173,455L449,118Q461,103 480,103Q499,103 511,118L787,455Q803,475 792.5,497.5Q782,520 756,520L640,520L640,800Q640,817 628.5,828.5Q617,840 600,840L360,840Q343,840 331.5,828.5Q320,817 320,800ZM400,760L560,760L560,440L671,440L480,206L289,440L400,440L400,760ZM480,440L480,440L480,440L480,440L480,440L480,440L480,440Z"/>
</vector>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<TextView style="@style/TTheme.Numpad.Key.Overlay.Text.Hold" android:tag="overlay_hold_text" />
</merge>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
style="@style/TTheme.Numpad.Key.Overlay.Icon"
android:tag="overlay_icon"
android:contentDescription="@null" />
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.HoldIcon.Wrapper">
<ImageView
style="@style/TTheme.Numpad.Key.Overlay.HoldIcon"
android:tag="overlay_hold_icon"
android:contentDescription="@null" />
</RelativeLayout>
</merge>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<TextView style="@style/TTheme.Numpad.Key.Number.Overlay.Text.Hold" android:tag="overlay_hold_text" />
</merge>

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
style="@style/TTheme.Numpad.Key.Overlay.Icon"
android:tag="overlay_icon"
android:contentDescription="@null" />
<TextView style="@style/TTheme.Numpad.Key.Overlay.Text.Top" android:tag="overlay_top_text" />
<TextView style="@style/TTheme.Numpad.Key.Overlay.Text.Right" android:tag="overlay_right_text" />
<TextView style="@style/TTheme.Numpad.Key.Overlay.Text.Bottom" android:tag="overlay_bottom_text" />
<TextView style="@style/TTheme.Numpad.Key.Overlay.Text.Left" android:tag="overlay_left_text" />
</merge>

View file

@ -1,96 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/numpad_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
style="@style/TTheme.Numpad.FullScreenAlignmentContainer"
android:id="@+id/numpad_container">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/numpad_width_constraint_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxWidth="@dimen/numpad_max_width"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
style="@style/TTheme.Numpad.FullScreenContainer"
android:id="@+id/numpad_width_constraint_wrapper">
<LinearLayout
style="@style/TTheme.Numpad"
android:id="@+id/linearLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
tools:ignore="MissingConstraints"> <!-- the constraints are set in the styles -->
<View
android:id="@+id/separator_top"
style="@style/numRowSeparator" />
<View style="@style/TTheme.Keyboard.TopSeparator" />
<include layout="@layout/panel_numpad_status_bar" />
<LinearLayout
android:id="@+id/status_bar_container"
android:layout_width="match_parent"
android:layout_height="@dimen/numpad_candidate_height"
android:layoutDirection="ltr">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyArrow
android:id="@+id/soft_key_left_arrow"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="@dimen/numpad_arrow_key_width"
android:layout_height="match_parent"
android:text="@string/key_dpad_left"
android:textSize="@dimen/main_small_key_icon_size" />
<View
android:id="@+id/separator_candidates_1"
style="@style/numSeparator" />
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<TextView
android:id="@+id/status_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textStyle="italic"
tools:text="@tools:sample/lorem" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/suggestions_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:layoutDirection="locale"
android:orientation="horizontal"
android:scrollbars="none" />
</FrameLayout>
<View
android:id="@+id/separator_candidates_2"
style="@style/numSeparator" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyArrow
android:id="@+id/soft_key_right_arrow"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="@dimen/numpad_arrow_key_width"
android:layout_height="match_parent"
android:text="@string/key_dpad_right"
android:textSize="@dimen/main_small_key_icon_size" />
</LinearLayout>
<View
android:id="@+id/separator_candidates_bottom"
style="@style/numRowSeparator" />
<include
layout="@layout/panel_numpad"
android:id="@+id/main_soft_keys"
android:paddingBottom="@dimen/numpad_padding_bottom"/>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<include layout="@layout/panel_numpad_left" />
<include layout="@layout/panel_numpad_digits" />
<include layout="@layout/panel_numpad_text_editing" />
<include layout="@layout/panel_numpad_right"/>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -2,14 +2,9 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/TTheme.Keyboard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
style="@style/TTheme.MainSmall">
<View
android:id="@+id/separator_top"
style="@style/numRowSeparator" />
<View style="@style/TTheme.Keyboard.TopSeparator" />
<FrameLayout
style="@style/TTheme.MainSmall.StatusBar.Wrapper"
@ -18,16 +13,16 @@
android:focusableInTouchMode="false">
<TextView
android:id="@+id/status_bar"
style="@style/TTheme.MainSmall.StatusBar.Status"
android:id="@+id/status_bar"
android:defaultFocusHighlightEnabled="false"
android:focusable="false"
android:focusableInTouchMode="false"
tools:text="@tools:sample/lorem" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/suggestions_bar"
style="@style/TTheme.MainSmall.StatusBar.SuggestionList"
android:id="@+id/suggestions_bar"
android:defaultFocusHighlightEnabled="false"
android:focusable="false"
android:focusableInTouchMode="false" />

View file

@ -1,170 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="@layout/main_numpad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Row 1 -->
<LinearLayout
tools:ignore="HardcodedText,KeyboardInaccessibleWidget"
android:layout_width="match_parent"
android:layout_height="@dimen/numpad_key_height"
android:layoutDirection="ltr">
<io.github.sspanak.tt9.ui.main.keys.SoftKeySettings
android:id="@+id/soft_key_settings"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="@dimen/numpad_function_key_layout_weight"
android:text="⚙"
android:textSize="@dimen/main_small_key_icon_size" />
<View
android:id="@+id/separator_1_1"
style="@style/numSeparator" />
<include
android:id="@+id/numpad_row_1"
layout="@layout/panel_numpad_row_1" />
<include
layout="@layout/panel_numpad_text_editing_row_1"
android:id="@+id/text_editing_row_1"
android:visibility="gone" />
<View
android:id="@+id/separator_1_2"
style="@style/numSeparator" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyBackspace
android:id="@+id/soft_key_backspace"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="@dimen/numpad_function_key_layout_weight"
android:textSize="@dimen/main_small_key_icon_size" />
</LinearLayout>
<!-- Row 2 -->
<LinearLayout
tools:ignore="HardcodedText"
android:layout_width="match_parent"
android:layout_height="@dimen/numpad_key_height"
android:layoutDirection="ltr">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyAddWord
android:id="@+id/soft_key_add_word"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="@dimen/numpad_function_key_layout_weight"
android:textSize="@dimen/main_small_key_icon_size" />
<View
android:id="@+id/separator_2_1"
style="@style/numSeparator" />
<include
android:id="@+id/numpad_row_2"
layout="@layout/panel_numpad_row_2" />
<include
layout="@layout/panel_numpad_text_editing_row_2"
android:id="@+id/text_editing_row_2"
android:visibility="gone" />
<View
android:id="@+id/separator_2_2"
style="@style/numSeparator" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFilter
android:id="@+id/soft_key_filter_suggestions"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="@dimen/numpad_function_key_layout_weight" />
</LinearLayout>
<!-- Row 3 -->
<LinearLayout
tools:ignore="HardcodedText"
android:layout_width="match_parent"
android:layout_height="@dimen/numpad_key_height"
android:layoutDirection="ltr">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyShift
android:id="@+id/soft_key_lf3"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="@dimen/numpad_function_key_layout_weight" />
<View
android:id="@+id/separator_3_1"
style="@style/numSeparator" />
<include
android:id="@+id/numpad_row_3"
layout="@layout/panel_numpad_row_3" />
<include
layout="@layout/panel_numpad_text_editing_row_3"
android:id="@+id/text_editing_row_3"
android:visibility="gone" />
<View
android:id="@+id/separator_3_2"
style="@style/numSeparator" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyRF3
android:id="@+id/soft_key_rf3"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="@dimen/numpad_function_key_layout_weight" />
</LinearLayout>
<!-- Row 4 -->
<LinearLayout
tools:ignore="HardcodedText"
android:layout_width="match_parent"
android:layout_height="@dimen/numpad_key_height"
android:layoutDirection="ltr">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyLF4
android:id="@+id/soft_key_lf4"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="@dimen/numpad_function_key_layout_weight" />
<View
android:id="@+id/separator_4_1"
style="@style/numSeparator" />
<include
android:id="@+id/numpad_row_4"
layout="@layout/panel_numpad_row_4" />
<View
android:id="@+id/separator_4_2"
style="@style/numSeparator" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyOk
android:id="@+id/soft_key_ok"
style="@android:style/Widget.Holo.Button.Borderless"
tools:ignore="ButtonOrder"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="@dimen/numpad_function_key_layout_weight"
android:text="OK" />
</LinearLayout>
</LinearLayout>

View file

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 1-4-7 -->
<LinearLayout style="@style/TTheme.Numpad.Column" android:id="@+id/numpad_column_1">
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber1
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_1" />
<include layout="@layout/key_overlay_number_hold_text" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber2to9
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_4" />
<include layout="@layout/key_overlay_number_hold_text" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber2to9
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_7" />
<include layout="@layout/key_overlay_number_hold_text" />
</RelativeLayout>
<io.github.sspanak.tt9.ui.main.keys.SoftKeyPunctuation
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_punctuation_1" />
</LinearLayout>
<!-- 2-5-8 -->
<LinearLayout style="@style/TTheme.Numpad.Column" android:id="@+id/numpad_column_2">
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber2to9
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_2" />
<include layout="@layout/key_overlay_number_hold_text" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber2to9
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_5" />
<include layout="@layout/key_overlay_number_hold_text" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber2to9
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_8" />
<include layout="@layout/key_overlay_number_hold_text" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber0
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_0" />
<include layout="@layout/key_overlay_number_hold_text" />
</RelativeLayout>
</LinearLayout>
<!-- 3-6-9 -->
<LinearLayout style="@style/TTheme.Numpad.Column" android:id="@+id/numpad_column_3">
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber2to9
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_3" />
<include layout="@layout/key_overlay_number_hold_text" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber2to9
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_6" />
<include layout="@layout/key_overlay_number_hold_text" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber2to9
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_9" />
<include layout="@layout/key_overlay_number_hold_text" />
</RelativeLayout>
<io.github.sspanak.tt9.ui.main.keys.SoftKeyPunctuation
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_punctuation_2" />
</LinearLayout>
</merge>

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/TTheme.Numpad.Column.Fn">
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeySettings
style="@style/TTheme.Numpad.Key"
android:id="@+id/soft_key_settings" />
<include layout="@layout/key_overlay_settings" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyAddWord
style="@style/TTheme.Numpad.Key"
android:id="@+id/soft_key_add_word" />
<include layout="@layout/key_overlay_icons" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyShift
style="@style/TTheme.Numpad.Key"
android:id="@+id/soft_key_shift" />
<include layout="@layout/key_overlay_icons" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyLF4
style="@style/TTheme.Numpad.Key"
android:id="@+id/soft_key_lf4" />
<include layout="@layout/key_overlay_icons" />
</RelativeLayout>
</LinearLayout>

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/TTheme.Numpad.Column.Fn">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyBackspace
style="@style/TTheme.Numpad.Key"
android:id="@+id/soft_key_numpad_backspace" />
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFilter
style="@style/TTheme.Numpad.Key"
android:id="@+id/soft_key_filter" />
<include layout="@layout/key_overlay_hold_text" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyRF3
style="@style/TTheme.Numpad.Key"
android:id="@+id/soft_key_rf3" />
<include layout="@layout/key_overlay_icons" />
</RelativeLayout>
<io.github.sspanak.tt9.ui.main.keys.SoftKeyOk
style="@style/TTheme.Numpad.Key.OK"
android:id="@+id/soft_key_numpad_ok"
android:text="OK"
tools:ignore="HardcodedText" />
</LinearLayout>

View file

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber1
android:id="@+id/soft_key_1"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber
android:id="@+id/soft_key_2"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber
android:id="@+id/soft_key_3"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
</merge>

View file

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber
android:id="@+id/soft_key_4"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber
android:id="@+id/soft_key_5"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber
android:id="@+id/soft_key_6"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
</merge>

View file

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber
android:id="@+id/soft_key_7"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber
android:id="@+id/soft_key_8"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber
android:id="@+id/soft_key_9"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
</merge>

View file

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyPunctuation
android:id="@+id/soft_key_punctuation_1"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber0
android:id="@+id/soft_key_0"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyPunctuation
android:id="@+id/soft_key_punctuation_2"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
</merge>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/status_bar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyArrow
style="@style/TTheme.Numpad.Key.Arrow"
android:id="@+id/soft_key_left_arrow"
android:text="@string/key_dpad_left" />
<FrameLayout style="@style/TTheme.Numpad.StatusBar.Wrapper">
<TextView
style="@style/TTheme.MainSmall.StatusBar.Status"
android:id="@+id/status_bar" />
<androidx.recyclerview.widget.RecyclerView
style="@style/TTheme.MainSmall.StatusBar.SuggestionList"
android:id="@+id/suggestions_bar" />
</FrameLayout>
<io.github.sspanak.tt9.ui.main.keys.SoftKeyArrow
style="@style/TTheme.Numpad.Key.Arrow"
android:id="@+id/soft_key_right_arrow"
android:text="@string/key_dpad_right" />
</LinearLayout>

View file

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 1-4-7 -->
<LinearLayout
style="@style/TTheme.Numpad.Column"
android:id="@+id/numpad_column_101"
android:visibility="gone">
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFText
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_101" />
<include layout="@layout/key_overlay_hold_text" />
<include layout="@layout/key_overlay_icons" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFText
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_104" />
<include layout="@layout/key_overlay_hold_text" />
<include layout="@layout/key_overlay_icons" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFText
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_107" />
<include layout="@layout/key_overlay_hold_text" />
<include layout="@layout/key_overlay_icons" />
</RelativeLayout>
<View style="@style/TTheme.Numpad.Key.Placeholder" />
</LinearLayout>
<!-- 2-5-8 -->
<LinearLayout style="@style/TTheme.Numpad.Column"
android:id="@+id/numpad_column_102"
android:visibility="gone">
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFText
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_102" />
<include layout="@layout/key_overlay_hold_text" />
<include layout="@layout/key_overlay_icons" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFText
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_105" />
<include layout="@layout/key_overlay_hold_text" />
<include layout="@layout/key_overlay_icons" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFText
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_108" />
<include layout="@layout/key_overlay_hold_text" />
<include layout="@layout/key_overlay_icons" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyNumber0
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_100" />
<include layout="@layout/key_overlay_hold_text" />
</RelativeLayout>
</LinearLayout>
<!-- 3-6-9 -->
<LinearLayout
style="@style/TTheme.Numpad.Column"
android:id="@+id/numpad_column_103"
android:visibility="gone">
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFText
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_103" />
<include layout="@layout/key_overlay_hold_text" />
<include layout="@layout/key_overlay_icons" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFText
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_106" />
<include layout="@layout/key_overlay_hold_text" />
<include layout="@layout/key_overlay_icons" />
</RelativeLayout>
<RelativeLayout style="@style/TTheme.Numpad.Key.Overlay.Wrapper">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFText
style="@style/TTheme.Numpad.Key.Number"
android:id="@+id/soft_key_109" />
<include layout="@layout/key_overlay_hold_text" />
<include layout="@layout/key_overlay_icons" />
</RelativeLayout>
<View style="@style/TTheme.Numpad.Key.Placeholder" />
</LinearLayout>
</merge>

View file

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_101"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_dpad_left"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_102"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_select_none"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_103"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_dpad_right"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
</merge>

View file

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_104"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_word_back"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_105"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_select_all"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_106"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_word_forward"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
</merge>

View file

@ -1,36 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_107"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_cut"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_108"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_copy"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_109"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_paste"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
</merge>

View file

@ -24,6 +24,5 @@
android:id="@+id/soft_key_backspace"
style="@style/TTheme.MainSmall.Key"
android:layout_weight="3"
android:focusable="false"
android:text="⌫" />
android:focusable="false" />
</LinearLayout>

View file

@ -7,48 +7,48 @@
tools:showIn="@layout/main_small">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_101"
style="@style/TTheme.CommandPalette.Key"
android:id="@+id/soft_key_101"
android:drawableBottom="@drawable/ic_dpad_left" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_102"
style="@style/TTheme.CommandPalette.Key"
android:id="@+id/soft_key_102"
android:drawableBottom="@drawable/ic_txt_select_none" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_103"
style="@style/TTheme.CommandPalette.Key"
android:id="@+id/soft_key_103"
android:drawableBottom="@drawable/ic_dpad_right" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_104"
style="@style/TTheme.CommandPalette.Key"
android:id="@+id/soft_key_104"
android:drawableBottom="@drawable/ic_txt_word_back" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_105"
style="@style/TTheme.CommandPalette.Key"
android:id="@+id/soft_key_105"
android:drawableBottom="@drawable/ic_txt_select_all" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_106"
style="@style/TTheme.CommandPalette.Key"
android:id="@+id/soft_key_106"
android:drawableBottom="@drawable/ic_txt_word_forward" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_107"
style="@style/TTheme.CommandPalette.Key"
android:id="@+id/soft_key_107"
android:drawableBottom="@drawable/ic_txt_cut" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_108"
style="@style/TTheme.CommandPalette.Key"
android:id="@+id/soft_key_108"
android:drawableBottom="@drawable/ic_txt_copy" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_109"
style="@style/TTheme.CommandPalette.Key"
android:id="@+id/soft_key_109"
android:drawableBottom="@drawable/ic_txt_paste" />
</LinearLayout>

View file

@ -5,11 +5,6 @@
android:orientation="horizontal">
<TextView
android:id="@+id/suggestion_list_item"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:minWidth="@dimen/numpad_candidate_min_width"
android:paddingHorizontal="@dimen/suggestion_padding_horizontal"
android:textSize="@dimen/numpad_candidate_font_size" />
style="@style/TTheme.Numpad.StatusBar.SuggestionList.Item"
android:id="@+id/suggestion_list_item" />
</LinearLayout>

View file

@ -5,10 +5,10 @@
<color name="key_num_background">#484c4f</color>
<color name="key_num_color">#fff</color>
<color name="key_num_alternative_color">#b6b7b9</color> <!-- 'hold' functions -->
<color name="key_num_alternative_color">#c3c5c6</color> <!-- 'hold' functions -->
<color name="key_fn_background">#373c41</color>
<color name="key_fn_alternative_color">#898c8f</color> <!-- 'hold' functions -->
<color name="key_fn_alternative_color">#c2c3c4</color> <!-- 'hold' functions -->
<color name="key_ok_background">#5e97f6</color>
<color name="key_ok_color">#fff</color>

View file

@ -8,34 +8,15 @@
<color name="key_num_background">#fff</color>
<color name="key_num_color">#333</color>
<color name="key_num_alternative_color">#666</color> <!-- 'hold' functions -->
<color name="key_num_alternative_color">#4d4d4f</color> <!-- 'hold' functions -->
<color name="key_fn_background">#ccced5</color>
<color name="key_fn_alternative_color">#888</color> <!-- 'hold' functions -->
<color name="key_fn_alternative_color">#4e4e50</color> <!-- 'hold' functions -->
<color name="key_ok_background">#1a73e8</color>
<color name="key_ok_color">#fff</color>
<color name="suggestion_selected_background">#8ab5f6</color> <!-- 8ed0fe / 7ecbff / #FFB27E / 73c7ff / 7ecfe2 / 8ac8f1 -->
<color name="suggestion_selected_background">#8cb7f9</color> <!-- 8ed0fe / 7ecbff / #FFB27E / 73c7ff / 7ecfe2 / 8ac8f1 -->
<color name="suggestion_selected_color">#000</color>
<color name="suggestion_separator">#888888</color>
<!-- legacy -->
<!-- Light theme -->
<color name="candidate_background">#D3D3D3</color>
<color name="candidate_color">#202020</color>
<color name="candidate_selected">#B8B8B8</color>
<color name="candidate_separator">#888888</color>
<color name="numpad_background">#E7E7E7</color>
<color name="numpad_separator">#CCC</color>
<!-- Dark theme -->
<color name="dark_candidate_background">#2C2C2C</color>
<color name="dark_candidate_color">#CCCCCC</color>
<color name="dark_candidate_selected">#555555</color>
<color name="dark_numpad_background">#353835</color>
<color name="dark_numpad_separator">#555</color>
</resources>

View file

@ -2,12 +2,11 @@
<resources>
<dimen name="status_bar_height">26sp</dimen>
<dimen name="status_bar_font_size">16sp</dimen>
<dimen name="suggestion_font_size">18sp</dimen> <!-- for some reason the RecyclerView displays the text smaller than the TextView, so we to make the suggestions slightly bigger than the regular Status Bar text. -->
<dimen name="suggestion_padding_horizontal">6sp</dimen>
<dimen name="main_small_suggestion_font_size">18sp</dimen> <!-- for some reason the RecyclerView displays the text smaller than the TextView, so we to make the suggestions slightly bigger than the regular Status Bar text. -->
<dimen name="main_small_suggestion_padding_horizontal">6sp</dimen>
<dimen name="main_small_key_icon_size">32sp</dimen>
<dimen name="main_small_key_height">44dp</dimen>
<dimen name="main_small_key_wrapper_height">46dp</dimen>
<dimen name="main_small_key_wrapper_height">46dp</dimen> <!-- key height + margin -->
<dimen name="main_small_key_text_editing_height">65dp</dimen>
@ -27,18 +26,19 @@
<!-- Numpad -->
<dimen name="numpad_max_width">10000dp</dimen>
<dimen name="numpad_max_width">9999dp</dimen>
<dimen name="numpad_padding_bottom">6dp</dimen>
<dimen name="numpad_row_separator_margin">0dp</dimen>
<dimen name="numpad_key_height">56dp</dimen>
<dimen name="numpad_arrow_key_width">38dp</dimen>
<dimen name="numpad_function_key_layout_weight">0.675</dimen>
<dimen name="numpad_candidate_font_size">17sp</dimen>
<dimen name="numpad_candidate_height">40dp</dimen>
<dimen name="numpad_candidate_min_width">36dp</dimen>
<dimen name="numpad_key_overlay_z">666dp</dimen>
<dimen name="numpad_key_overlay_small_icon_size">13sp</dimen>
<dimen name="numpad_key_overlay_text_size">11sp</dimen>
<dimen name="numpad_key_overlay_side_text_margin">2dp</dimen>
<dimen name="numpad_text_editing_font_size">17sp</dimen>
<dimen name="soft_key_drawable_bottom_padding">6dp</dimen>
<dimen name="numpad_suggestion_font_size">17sp</dimen>
<dimen name="numpad_suggestion_height">40dp</dimen>
<dimen name="numpad_suggestion_min_width">36dp</dimen>
</resources>

View file

@ -219,14 +219,11 @@
<string name="virtual_numpad_alignment_left">Left</string>
<string name="virtual_numpad_alignment_right">Right</string>
<string name="virtual_key_change_keyboard" translatable="false">Kbd</string>
<string name="virtual_key_command_palette" translatable="false">Cmd</string>
<string name="virtual_key_del" translatable="false">Del</string>
<string name="virtual_key_input_mode" translatable="false">Mode</string>
<string name="virtual_key_settings" translatable="false">Cfg</string>
<string name="virtual_key_shift" translatable="false">Shift</string>
<string name="virtual_key_space_korean">Space (Korean)</string>
<string name="virtual_key_text_editing" translatable="false">Copy</string>
<string name="voice_input_listening">Speak</string>
<string name="voice_input_stopping">Turning off the microphone…</string>

View file

@ -13,6 +13,25 @@
<item name="android:background">@color/keyboard_background</item>
</style>
<style name="TTheme.MainSmall" parent="TTheme.Keyboard">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:orientation">vertical</item>
</style>
<style name="TTheme.Keyboard.TopSeparator">
<item name="android:layout_margin">0dp</item>
<item name="android:layout_height">1dp</item>
<item name="android:layout_width">match_parent</item>
<item name="android:background">@color/key_fn_background</item>
</style>
<!--*******************************************
Status Bar
*******************************************-->
<!-- status bar -->
<style name="TTheme.MainSmall.StatusBar.Wrapper" parent="">
@ -42,20 +61,16 @@
<item name="android:gravity">center</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">match_parent</item>
<item name="android:paddingLeft">@dimen/suggestion_padding_horizontal</item>
<item name="android:paddingRight">@dimen/suggestion_padding_horizontal</item>
<item name="android:paddingLeft">@dimen/main_small_suggestion_padding_horizontal</item>
<item name="android:paddingRight">@dimen/main_small_suggestion_padding_horizontal</item>
<item name="android:textSize">@dimen/suggestion_font_size</item>
<item name="android:textSize">@dimen/main_small_suggestion_font_size</item>
</style>
<!-- general purpose key style -->
<style name="TTheme.Key" parent="Widget.MaterialComponents.Button">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_weight">1</item>
</style>
<!--*******************************************
Small Keys
*******************************************-->
<!-- Main Small view (backspace and OK) -->
<style name="TTheme.MainSmall.Wrapper" parent="">
@ -66,8 +81,10 @@
<item name="android:orientation">horizontal</item>
</style>
<style name="TTheme.MainSmall.Key" parent="TTheme.Key">
<style name="TTheme.MainSmall.Key" parent="Widget.MaterialComponents.Button">
<item name="android:layout_height">match_parent</item>
<item name="android:layout_width">0dp</item>
<item name="android:layout_weight">1</item>
<item name="android:layout_marginLeft">6dp</item>
<item name="android:layout_marginRight">6dp</item>
<item name="android:layout_marginTop">1dp</item>
@ -77,7 +94,7 @@
<item name="android:paddingBottom">0dp</item>
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Medium</item>
<item name="android:textColor">@color/keyboard_text_color</item>
<item name="android:textColor">@color/key_num_color</item>
<item name="backgroundTint">@color/key_num_background</item>
</style>
@ -107,31 +124,179 @@
<item name="android:textAppearance">@style/TextAppearance.AppCompat</item>
<item name="android:textSize">@dimen/status_bar_font_size</item>
<item name="drawableTint">@color/keyboard_text_color</item>
<item name="android:textColor">@color/key_num_color</item>
<item name="drawableTint">@color/key_num_color</item>
</style>
<!--*******************************************
Numpad
*******************************************-->
<!-- LEGACY -->
<style name="hSeparator">
<item name="android:layout_height">match_parent</item>
<item name="android:layout_width">3dp</item>
<item name="android:layout_marginBottom">1dp</item>
<item name="android:layout_marginTop">1dp</item>
</style>
<style name="numSeparator">
<item name="android:layout_height">match_parent</item>
<item name="android:layout_width">1dp</item>
</style>
<style name="numRowSeparator">
<item name="android:layout_marginBottom">@dimen/numpad_row_separator_margin</item>
<item name="android:layout_marginLeft">@dimen/numpad_row_separator_margin</item>
<item name="android:layout_marginRight">@dimen/numpad_row_separator_margin</item>
<item name="android:layout_height">1dp</item>
<!-- Full screen containers -->
<style name="TTheme.Numpad.FullScreenAlignmentContainer" parent="">
<item name="android:layout_width">match_parent</item>
<item name="android:background">@color/suggestion_separator</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:gravity">center_horizontal</item>
</style>
<style name="TTheme.Numpad.FullScreenContainer" parent="">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:maxWidth">@dimen/numpad_max_width</item>
<item name="layout_constraintStart_toStartOf">parent</item>
<item name="layout_constraintTop_toTopOf">parent</item>
</style>
<!-- The keyboard itself -->
<style name="TTheme.Numpad" parent="TTheme.Keyboard">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:orientation">vertical</item>
<item name="layout_constraintEnd_toEndOf">parent</item>
<item name="layout_constraintStart_toStartOf">parent</item>
<item name="layout_constraintTop_toTopOf">parent</item>
<item name="android:paddingBottom">@dimen/numpad_padding_bottom</item>
</style>
<!-- Status Bar -->
<style name="TTheme.Numpad.StatusBar.Wrapper" parent="">
<item name="android:layout_height">@dimen/numpad_suggestion_height</item>
<item name="android:layout_width">0dp</item>
<item name="android:layout_weight">1</item>
</style>
<style name="TTheme.Numpad.StatusBar.SuggestionList.Item" parent="">
<item name="android:gravity">center</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">match_parent</item>
<item name="android:minWidth">@dimen/numpad_suggestion_min_width</item>
<item name="android:paddingLeft">@dimen/main_small_suggestion_padding_horizontal</item>
<item name="android:paddingRight">@dimen/main_small_suggestion_padding_horizontal</item>
<item name="android:textSize">@dimen/numpad_suggestion_font_size</item>
</style>
<!-- Key Columns -->
<style name="TTheme.Numpad.Column" parent="">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_weight">1</item>
<item name="android:orientation">vertical</item>
</style>
<style name="TTheme.Numpad.Column.Fn" parent="TTheme.Numpad.Column">
<item name="android:layout_weight">@dimen/numpad_function_key_layout_weight</item>
</style>
<!-- Key Overlay (allows for a central icon and corner labels or icons) -->
<style name="TTheme.Numpad.Key.Overlay.Wrapper" parent="">
<item name="android:layout_height">@dimen/numpad_key_height</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_margin">0dp</item>
<item name="android:padding">0dp</item>
</style>
<style name="TTheme.Numpad.Key.Overlay.Icon" parent="">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_centerInParent">true</item>
<item name="android:paddingTop">2dp</item>
<item name="android:translationZ">@dimen/numpad_key_overlay_z</item>
<item name="android:tint">@color/keyboard_text_color</item>
</style>
<style name="TTheme.Numpad.Key.Overlay.Element" parent="">
<item name="android:layout_height">match_parent</item>
<item name="android:layout_width">match_parent</item>
<item name="android:translationZ">@dimen/numpad_key_overlay_z</item>
</style>
<style name="TTheme.Numpad.Key.Overlay.HoldIcon.Wrapper" parent="TTheme.Numpad.Key.Overlay.Element">
<item name="android:gravity">top|right</item>
<item name="android:paddingRight">3dp</item>
<item name="android:paddingTop">7dp</item>
</style>
<style name="TTheme.Numpad.Key.Overlay.HoldIcon" parent="TTheme.Numpad.Key.Overlay.Element">
<item name="android:layout_height">@dimen/numpad_key_overlay_small_icon_size</item>
<item name="android:layout_width">@dimen/numpad_key_overlay_small_icon_size</item>
<item name="android:tint">@color/key_fn_alternative_color</item>
</style>
<style name="TTheme.Numpad.Key.Overlay.Text" parent="TTheme.Numpad.Key.Overlay.Element">
<item name="android:textSize">@dimen/numpad_key_overlay_text_size</item>
<item name="android:textColor">@color/key_fn_alternative_color</item>
</style>
<style name="TTheme.Numpad.Key.Overlay.Text.Hold" parent="TTheme.Numpad.Key.Overlay.Text">
<item name="android:gravity">top|right</item>
<item name="android:layout_margin">5dp</item>
</style>
<style name="TTheme.Numpad.Key.Number.Overlay.Text.Hold" parent="TTheme.Numpad.Key.Overlay.Text.Hold">
<item name="android:textColor">@color/key_num_alternative_color</item>
</style>
<style name="TTheme.Numpad.Key.Overlay.Text.Top" parent="TTheme.Numpad.Key.Overlay.Text">
<item name="android:gravity">top|center</item>
<item name="android:layout_marginTop">@dimen/numpad_key_overlay_side_text_margin</item>
</style>
<style name="TTheme.Numpad.Key.Overlay.Text.Right" parent="TTheme.Numpad.Key.Overlay.Text">
<item name="android:gravity">center|right</item>
<item name="android:layout_marginRight">@dimen/numpad_key_overlay_side_text_margin</item>
</style>
<style name="TTheme.Numpad.Key.Overlay.Text.Bottom" parent="TTheme.Numpad.Key.Overlay.Text">
<item name="android:gravity">bottom|center</item>
<item name="android:layout_marginBottom">@dimen/numpad_key_overlay_side_text_margin</item>
</style>
<style name="TTheme.Numpad.Key.Overlay.Text.Left" parent="TTheme.Numpad.Key.Overlay.Text">
<item name="android:gravity">center|left</item>
<item name="android:layout_marginLeft">@dimen/numpad_key_overlay_side_text_margin</item>
</style>
<!-- General Purpose Key -->
<style name="TTheme.Numpad.Key" parent="Widget.MaterialComponents.Button">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">@dimen/numpad_key_height</item>
<item name="android:layout_marginLeft">3dp</item>
<item name="android:layout_marginRight">3dp</item>
<item name="android:padding">0dp</item>
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Medium</item>
<item name="android:textColor">@color/keyboard_text_color</item>
<item name="backgroundTint">@color/key_fn_background</item>
</style>
<!-- Suggestion arrow keys -->
<style name="TTheme.Numpad.Key.Arrow" parent="TTheme.Numpad.Key">
<item name="android:layout_height">match_parent</item>
<item name="android:layout_width">@dimen/numpad_arrow_key_width</item>
<item name="android:padding">0dp</item>
</style>
<!-- Keypad keys -->
<style name="TTheme.Numpad.Key.Number" parent="TTheme.Numpad.Key">
<item name="android:textColor">@color/key_num_color</item>
<item name="backgroundTint">@color/key_num_background</item>
</style>
<style name="TTheme.Numpad.Key.OK" parent="TTheme.Numpad.Key">
<item name="android:textColor">@color/key_ok_color</item>
<item name="backgroundTint">@color/key_ok_background</item>
</style>
<style name="TTheme.Numpad.Key.Placeholder">
<item name="android:layout_height">0dp</item>
<item name="android:layout_width">0dp</item>
<item name="android:layout_weight">1</item>
</style>
</resources>