Posts

Showing posts with the label BulletSpan in Sketchware

BulletSpan and DrawableMarginSpan example in Sketchware

Image
BulletSpan example A BulletSpan styles paragraphs as bullet points. BulletSpans are attached from the first character to the last character of a single paragraph. BulletSpans allow configuring the following elements: gap width - the distance, in pixels, between the bullet point and the paragraph. Default value is 2px. color - the bullet point color. By default, the bullet point color is 0 - no color, so it uses the TextView's text color. bullet radius - the radius, in pixels, of the bullet point. Default value is 4px. Constructor: BulletSpan(int gapWidth, int color, int bulletRadius) Creates a BulletSpan based on a gap width and a color integer. This example shows how to add Bullets to paragraphs in a TextView using BulletSpan in Sketchware. 1. In  main.xml  add a TextView  textview1 . 2. In  MainActivity.java , create a new String  mystring . 3. In  onCreate  of  MainActivity.java : a. Set the text of  mystring ...