Android StrikethroughSpan - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android StrikethroughSpan class.

This code example shows how to use the following methods:
        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");
        s.setSpan(new URLSpan("http://www.google.com"), 6, s.length() - 6,
                  Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
        assertEquals(Html.toHtml(s),
                     "<p>Hello <a href=\"http://www.google.com\">linky</a> world</p>\n"); 
    } 
 
    @SmallTest 
    public void testImg() throws Exception { 
        Spanned s;
 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
				// First convert text to 'spannable' 
				mName.setText(mName.getText(), TextView.BufferType.SPANNABLE); 
				Spannable str = (Spannable) mName.getText(); 
 
				// Strikethrough 
				str.setSpan(new StrikethroughSpan(), 0, str.length(), 
						Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); 
				deleteRow(); 
			} else { 
				mName.setText(mNameString); 
				if (mTypeDrawable > 0) { 
					mType.setImageResource(mTypeDrawable); 
					mType.setOnClickListener(new OnClickListener() { 
 
						public void onClick(View view) { 
							new AlertDialog.Builder(ContentListRow.this 
									.getContext()).setTitle("info").setIcon( 
									mTypeDrawable).setMessage( 
									getResources().getString(mTypeString)) 
									.show(); 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
     * @param starIndex 
     * @param endIndex 
     */ 
    public void getStrikethroughSpan(SpannableString spannableString,
                                     int starIndex, int endIndex) {
        spannableString.setSpan(new StrikethroughSpan(), starIndex, endIndex,
                Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
    } 
 
    /** 
     * 设置下标 
     * 
     * @param spannableString 
     * @param starIndex 
     * @param endIndex 
     */ 
    public void getSubscriptSpan(SpannableString spannableString,
                                 int starIndex, int endIndex) {
        spannableString.setSpan(new SubscriptSpan(), starIndex, endIndex,
                Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	 * @param starIndex 
	 * @param endIndex 
	 */ 
	public void getStrikethroughSpan(SpannableString spannableString,
			int starIndex, int endIndex) {
		spannableString.setSpan(new StrikethroughSpan(), starIndex, endIndex,
				Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
	} 
 
	/** 
	 * 设置下标 
	 *  
	 * @param spannableString 
	 * @param starIndex 
	 * @param endIndex 
	 */ 
	public void getSubscriptSpan(SpannableString spannableString,
			int starIndex, int endIndex) {
		spannableString.setSpan(new SubscriptSpan(), starIndex, endIndex,
				Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        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");
        s.setSpan(new URLSpan("http://www.google.com"), 6, s.length() - 6,
                  Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
        assertEquals(Html.toHtml(s),
                     "<p>Hello <a href=\"http://www.google.com\">linky</a> world</p>\n"); 
    } 
 
    @SmallTest 
    public void testImg() throws Exception { 
        Spanned s;
 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
                return R.drawable.priority_none; 
        } 
    } 
 
    private static final SimpleDateFormat sDueDateFormat = new SimpleDateFormat("MM/dd/yyyy");
    private static final StrikethroughSpan sStrikethroughSpan = new StrikethroughSpan();
 
    private boolean mShowSubtaskCount;
    private Handler mHandler;
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
This code example shows how to use the following methods:
        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");
        s.setSpan(new URLSpan("http://www.google.com"), 6, s.length() - 6,
                  Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
        assertEquals(Html.toHtml(s),
                     "<p>Hello <a href=\"http://www.google.com\">linky</a> world</p>\n"); 
    } 
 
    @SmallTest 
    public void testImg() throws Exception { 
        Spanned s;
 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
    public static StyleSpan italic() {
        return new StyleSpan(Typeface.ITALIC);
    } 
 
    public static StrikethroughSpan strike() {
        return new StrikethroughSpan();
    } 
 
    private SpannableStringBuilder sb;
 
    public SpanBuilder() { 
        sb = new SpannableStringBuilder();
    } 
 
    public void append(String text, Object... spanList) {
        if (text == null || text.length() == 0) {
            return; 
        } 
 
        int start = sb.length();
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
    }   
     
    /** 文字添加删除线  */ 
    public static CharSequence strike(CharSequence text,int start,int end){  
        SpannableStringBuilder spannable=new SpannableStringBuilder(text.toString());  
        CharacterStyle span=new StrikethroughSpan();  
        spannable.setSpan(span, start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);  
        return spannable;
    }   
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Android StrikethroughSpan Questions & Answers:

See Code Examples for Android StrikethroughSpan Methods: