Best code examples for Android SubscriptSpan class (android.text.style.SubscriptSpan)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android SubscriptSpan class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android SubscriptSpan examples from Open Source projects
This code example shows how to use the following methods:
public class SubScriptHandler extends TagNodeHandler { 
 
	public void handleTagNode(TagNode node, SpannableStringBuilder builder, 
			int start, int end, SpanStack spanStack) { 
 
		spanStack.pushSpan(new SubscriptSpan(), start, end); 
	} 
} 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
        s.setSpan(new SuperscriptSpan(), 6, s.length() - 6,
                  Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
        assertEquals(Html.toHtml(s), "<p>Hello <sup>superscript</sup> world</p>\n");
 
        s = new SpannableString("Hello subscript world");
        s.setSpan(new SubscriptSpan(), 6, s.length() - 6,
                  Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
        assertEquals(Html.toHtml(s), "<p>Hello <sub>subscript</sub> world</p>\n");
 
        s = new SpannableString("Hello underline world");
        s.setSpan(new UnderlineSpan(), 6, s.length() - 6,
                  Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
        assertEquals(Html.toHtml(s), "<p>Hello <u>underline</u> world</p>\n");
 
        s = new SpannableString("Hello struck world");
        s.setSpan(new StrikethroughSpan(), 6, s.length() - 6,
                  Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
        assertEquals(Html.toHtml(s), "<p>Hello <strike>struck</strike> world</p>\n");
 
        s = new SpannableString("Hello linky world");
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods:
 
	public void attachToView(ViewGroup targetView) {
		mLabel = (TextView) targetView.getChildAt(0);
		SpannableStringBuilder ssb = new SpannableStringBuilder("Servo");
		ssb.append(String.valueOf(mServoNumber));
		ssb.setSpan(new SubscriptSpan(), 5, 6, 0);
		ssb.setSpan(new RelativeSizeSpan(0.7f), 5, 6, 0);
		mLabel.setText(ssb);
		mSlider = (Slider) targetView.getChildAt(1);
		mSlider.setPositionListener(this);
	} 
 
	public void onPositionChange(double value) {
		byte v = (byte) (value * 255);
		mActivity.sendCommand(DemoKitActivity.LED_SERVO_COMMAND,
				mCommandTarget, v);
	} 
 
} 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods:
 
	public void attachToView(ViewGroup targetView) {
		mLabel = (TextView) targetView.getChildAt(0);
		SpannableStringBuilder ssb = new SpannableStringBuilder("Servo");
		ssb.append(String.valueOf(mServoNumber));
		ssb.setSpan(new SubscriptSpan(), 5, 6, 0);
		ssb.setSpan(new RelativeSizeSpan(0.7f), 5, 6, 0);
		mLabel.setText(ssb);
		mSlider = (Slider) targetView.getChildAt(1);
		mSlider.setPositionListener(this);
	} 
 
	public void onPositionChange(double value) {
		byte v = (byte) (value * 255);
		mActivity.sendCommand(DemoKitActivity.LED_SERVO_COMMAND,
				mCommandTarget, v);
	} 
 
} 
Full Snippet Info
5
CodeRank
See Code Examples for Android SubscriptSpan Methods: