changed the icons of the Input Mode virtual key for better readability
This commit is contained in:
parent
2e9abac16e
commit
671a2c2d15
1 changed files with 20 additions and 11 deletions
|
|
@ -1,27 +1,29 @@
|
||||||
package io.github.sspanak.tt9.ui.main.keys;
|
package io.github.sspanak.tt9.ui.main.keys;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Paint;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
|
||||||
import io.github.sspanak.tt9.R;
|
import io.github.sspanak.tt9.R;
|
||||||
|
import io.github.sspanak.tt9.preferences.settings.SettingsStore;
|
||||||
import io.github.sspanak.tt9.ui.Vibration;
|
import io.github.sspanak.tt9.ui.Vibration;
|
||||||
|
|
||||||
public class SoftKeyLF4 extends SwipeableKey {
|
public class SoftKeyLF4 extends SwipeableKey {
|
||||||
private final static float GLOBE_SIZE = 0.35f;
|
|
||||||
|
|
||||||
public SoftKeyLF4(Context context) {
|
public SoftKeyLF4(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
complexLabelTitleSize = GLOBE_SIZE;
|
setFontSize();
|
||||||
}
|
}
|
||||||
public SoftKeyLF4(Context context, AttributeSet attrs) {
|
public SoftKeyLF4(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
complexLabelTitleSize = GLOBE_SIZE;
|
setFontSize();
|
||||||
}
|
}
|
||||||
public SoftKeyLF4(Context context, AttributeSet attrs, int defStyleAttr) {
|
public SoftKeyLF4(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||||
super(context, attrs, defStyleAttr);
|
super(context, attrs, defStyleAttr);
|
||||||
complexLabelTitleSize = GLOBE_SIZE;
|
setFontSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setFontSize() {
|
||||||
|
complexLabelTitleSize = SettingsStore.SOFT_KEY_COMPLEX_LABEL_TITLE_RELATIVE_SIZE / 0.85f;
|
||||||
|
complexLabelSubTitleSize = SettingsStore.SOFT_KEY_COMPLEX_LABEL_SUB_TITLE_RELATIVE_SIZE / 0.85f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -58,16 +60,23 @@ public class SoftKeyLF4 extends SwipeableKey {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getSubTitle() {
|
protected String getSubTitle() {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && new Paint().hasGlyph("⌨")) {
|
if (tt9 == null || tt9.getLanguage() == null) {
|
||||||
return "⌨";
|
return getContext().getString(R.string.virtual_key_input_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
return getContext().getString(R.string.virtual_key_input_mode).toUpperCase();
|
if (tt9.isInputModeNumeric()) {
|
||||||
|
return "123";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tt9.isInputModeABC()) {
|
||||||
|
return tt9.getLanguage().getAbcString().toUpperCase(tt9.getLanguage().getLocale());
|
||||||
|
}
|
||||||
|
|
||||||
|
return "T9";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render() {
|
public void render() {
|
||||||
setTextSize(28);
|
|
||||||
super.render();
|
super.render();
|
||||||
setEnabled(tt9 != null && !tt9.isVoiceInputActive());
|
setEnabled(tt9 != null && !tt9.isVoiceInputActive());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue