Is there any way to insert a text with different style in a TextView?

76 views Asked by At

Is there any way to do what is shown in the design? I mean, have some text at the beginning of the TextView with a different style and the rest of text aligned to the left.

enter image description here

I have tried with this, but no luck.

SpannableString text = new SpannableString("02:32 PM Resolving Workflow Issues with Partners");

text.setSpan(new TextAppearanceSpan(getApplicationContext(), R.style.grey_background_white_text_color_style),
             0,
             8,
             Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

textview.setText(text, TextView.BufferType.SPANNABLE);
0

There are 0 answers