in my dimens.xml I've:
<dimen name="text_small">16sp</dimen>
<dimen name="text_normal">18sp</dimen>
<dimen name="text_medium">20sp</dimen>
<dimen name="text_big">22sp</dimen>
now I would like to let the user select the font size in a settings fragment. Let's say for example:
- Small -2sp
- Normal +0sp
- Medium +2sp
- Big +4sp
So for example if the user select "Big" I would like that font size will be:
<dimen name="text_small">20sp</dimen>
<dimen name="text_normal">22sp</dimen>
<dimen name="text_medium">24sp</dimen>
<dimen name="text_big">26sp</dimen>
Is there a way to do something like:
Application Start:
if (sizeUser.equals("Big")) {
text_small=24sp
.....
}
and so on?
You don't need to use
dimens.xml
. Instead, usesetTextSize