fixed the font size of the virtual numpad keys for the 3rd time
This commit is contained in:
parent
e721a334ac
commit
ed651e7ec1
5 changed files with 12 additions and 14 deletions
|
|
@ -232,7 +232,15 @@ public class SoftKey extends androidx.appcompat.widget.AppCompatButton implement
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Multiplier for the title font size.
|
* Multiplier for the font size when there is only one label.
|
||||||
|
*/
|
||||||
|
protected float getSingleLabelRelativeSize() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Multiplier for the title font size when there are two labels.
|
||||||
*/
|
*/
|
||||||
protected float getTitleRelativeSize() {
|
protected float getTitleRelativeSize() {
|
||||||
return SettingsStore.SOFT_KEY_COMPLEX_LABEL_TITLE_RELATIVE_SIZE;
|
return SettingsStore.SOFT_KEY_COMPLEX_LABEL_TITLE_RELATIVE_SIZE;
|
||||||
|
|
@ -240,7 +248,7 @@ public class SoftKey extends androidx.appcompat.widget.AppCompatButton implement
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Multiplier for the subtitle font size.
|
* Multiplier for the subtitle font size when there are two labels.
|
||||||
*/
|
*/
|
||||||
protected float getSubTitleRelativeSize() {
|
protected float getSubTitleRelativeSize() {
|
||||||
return SettingsStore.SOFT_KEY_COMPLEX_LABEL_SUB_TITLE_RELATIVE_SIZE;
|
return SettingsStore.SOFT_KEY_COMPLEX_LABEL_SUB_TITLE_RELATIVE_SIZE;
|
||||||
|
|
@ -273,7 +281,7 @@ public class SoftKey extends androidx.appcompat.widget.AppCompatButton implement
|
||||||
|
|
||||||
// title styles
|
// title styles
|
||||||
int titleLength = title.length();
|
int titleLength = title.length();
|
||||||
float titleRelativeSize = subtitle == null ? getSubTitleRelativeSize() : getTitleRelativeSize();
|
float titleRelativeSize = subtitle == null ? getSingleLabelRelativeSize() : getTitleRelativeSize();
|
||||||
|
|
||||||
sb.setSpan(new RelativeSizeSpan(titleRelativeSize), 0, titleLength, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
sb.setSpan(new RelativeSizeSpan(titleRelativeSize), 0, titleLength, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
||||||
if (subtitle != null && !new Text(title).startsWithGraphic()) {
|
if (subtitle != null && !new Text(title).startsWithGraphic()) {
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,6 @@ public class SoftKeyAddWord extends SoftKey {
|
||||||
public SoftKeyAddWord(Context context, AttributeSet attrs) { super(context, attrs); }
|
public SoftKeyAddWord(Context context, AttributeSet attrs) { super(context, attrs); }
|
||||||
public SoftKeyAddWord(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); }
|
public SoftKeyAddWord(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); }
|
||||||
|
|
||||||
@Override protected float getTitleRelativeSize() { return 1; }
|
|
||||||
@Override protected float getSubTitleRelativeSize() { return 1; }
|
|
||||||
@Override protected String getTitle() { return "+"; }
|
@Override protected String getTitle() { return "+"; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,6 @@ public class SoftKeyBackspace extends SwipeableKey {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override protected float getTitleRelativeSize() { return 1; }
|
|
||||||
@Override protected float getSubTitleRelativeSize() { return 1; }
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When fast-delete is on, decrease the hold duration threshold for smoother operation.
|
* When fast-delete is on, decrease the hold duration threshold for smoother operation.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,6 @@ public class SoftKeySettings extends SwipeableKey {
|
||||||
this.mainView = mainView;
|
this.mainView = mainView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected float getTitleRelativeSize() { return 1;}
|
|
||||||
@Override protected float getSubTitleRelativeSize() { return 1; }
|
|
||||||
|
|
||||||
// this key does not support holding at the moment, so just prevent it
|
// this key does not support holding at the moment, so just prevent it
|
||||||
@Override protected float getHoldDurationThreshold() { return 1000; }
|
@Override protected float getHoldDurationThreshold() { return 1000; }
|
||||||
@Override protected float getSwipeXThreshold(Context context) { return context.getResources().getDimensionPixelSize(R.dimen.numpad_key_height) * 0.75f; }
|
@Override protected float getSwipeXThreshold(Context context) { return context.getResources().getDimensionPixelSize(R.dimen.numpad_key_height) * 0.75f; }
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@ public class SoftKeyShift extends SoftKey {
|
||||||
super(context, attrs, defStyleAttr);
|
super(context, attrs, defStyleAttr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected float getTitleRelativeSize() { return 1.7f; }
|
@Override protected float getSingleLabelRelativeSize() { return 1.7f; }
|
||||||
@Override protected float getSubTitleRelativeSize() { return getTitleRelativeSize(); }
|
|
||||||
@Override protected String getTitle() { return "⇧"; }
|
@Override protected String getTitle() { return "⇧"; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue