0

I have a edittext and some buttons like bold italics underline bullets. Now when i select some text and press any button then using spannable string i am applying that particular span to that portion of the edittext like bold italics underline etc.

I am trying to put Bulletspan in edittext. Here is the code i use to put bullet span:-

s.setSpan(new BulletSpan(), text.getSelectionStart(), text.getSelectionEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

where text is my reference to the Edittext.

Now the issue is that I want that my bulleted text should come at some leading margin space or indentation from start like it comes in any text editor like MS Word.

Rahul Gupta
  • 5,275
  • 8
  • 35
  • 66

1 Answers1

0

Just tell BulletSpan how much leading space you want. This example would give you 16dp leading space on the first and subsequent lines (like in the text editors you mentioned).

new BulletSpan(16);
Daniel
  • 4,525
  • 3
  • 38
  • 52