1
0
Fork 0

fixed the font size of the virtual numpad keys for the 3rd time

This commit is contained in:
sspanak 2024-11-30 14:54:10 +02:00 committed by Dimo Karaivanov
parent e721a334ac
commit ed651e7ec1
5 changed files with 12 additions and 14 deletions

View file

@ -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() {
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() {
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
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);
if (subtitle != null && !new Text(title).startsWithGraphic()) {

View file

@ -8,8 +8,6 @@ public class SoftKeyAddWord extends SoftKey {
public SoftKeyAddWord(Context context, AttributeSet attrs) { super(context, attrs); }
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

View file

@ -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.
*/

View file

@ -23,9 +23,6 @@ public class SoftKeySettings extends SwipeableKey {
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
@Override protected float getHoldDurationThreshold() { return 1000; }
@Override protected float getSwipeXThreshold(Context context) { return context.getResources().getDimensionPixelSize(R.dimen.numpad_key_height) * 0.75f; }

View file

@ -17,8 +17,7 @@ public class SoftKeyShift extends SoftKey {
super(context, attrs, defStyleAttr);
}
@Override protected float getTitleRelativeSize() { return 1.7f; }
@Override protected float getSubTitleRelativeSize() { return getTitleRelativeSize(); }
@Override protected float getSingleLabelRelativeSize() { return 1.7f; }
@Override protected String getTitle() { return ""; }
@Override