I have a button which increases the size of selected text when clicked. I want it to increase to a certain size, e.g. 36sp, then after that, it stops. I am using a RelativeSizeSpan
for this. text.getTextSize()
seems to be returning a constant value, which looks like the default/overall size. How can I get the size of the selected Text?
private void makeChanges(float size) {
Log.d("EditText", "makeChanges Text Size: " + text.getTextSize());
str.setSpan(new RelativeSizeSpan(size),
selectionStart, selectionEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
text.setText(str);
}