spannable text size android

Solutions on MaxInterview for spannable text size android by the best coders in the world

showing results for - "spannable text size android"
Adele
02 Mar 2019
1private SpannableStringBuilder SpannableStringBuilder(final String text, final char afterChar, final float reduceBy) {
2        RelativeSizeSpan smallSizeText = new RelativeSizeSpan(reduceBy);
3        SpannableStringBuilder ssBuilder = new SpannableStringBuilder(text);
4        ssBuilder.setSpan(
5                smallSizeText,
6                text.indexOf(afterChar),
7                text.length(),
8                Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
9        );
10
11        return ssBuilder;
12    }
13------------------------
14TextView textView =view.findViewById(R.id.textview);
15String s= "123456.24";
16textView.setText(SpannableStringBuilder(s, '.', 0.7f));