Android TextAppearanceSpan - 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 TextAppearanceSpan class.

This code example shows how to use the following methods:getTextSize
		Context context = this.getContext();
		LinearLayout layout = new LinearLayout(context);
		layout.setOrientation(LinearLayout.HORIZONTAL);
		this.titleView = new TextView(context);
 
		TextAppearanceSpan span = new TextAppearanceSpan(context,
				android.R.style.TextAppearance_DialogWindowTitle);
		float size = span.getTextSize();
		this.closeButton = new ImageButton(this.getContext());
		Drawable clearIcon;
		if (this.dialogTheme != null) {
			clearIcon = this.dialogTheme.getIconProvider()
					.getCloseIcon(context);
		} else { 
			clearIcon = new BasicIconProvider().getCloseIcon(context);
		} 
		if (clearIcon instanceof BitmapDrawable) {
			int height = ((BitmapDrawable) clearIcon).getBitmap().getHeight();
			int density = ((BitmapDrawable) clearIcon).getBitmap().getDensity();
			((BitmapDrawable) clearIcon).setTargetDensity((int) Math
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
    public String toString() { 
        return name; 
    } 
 
    public Object createStyle(Context context) { 
        return new TextAppearanceSpan(context, styleResourceId); 
    } 
 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
    public String toString() { 
        return name; 
    } 
 
    public Object createStyle(Context context) { 
        return new TextAppearanceSpan(context, styleResourceId); 
    } 
 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
                    String name = f.mColor.substring(1);
                    int colorRes = res.getIdentifier(name, "color", "android");
                    if (colorRes != 0) {
                        ColorStateList colors = res.getColorStateList(colorRes);
                        text.setSpan(new TextAppearanceSpan(null, 0, 0, colors,
                                null), where, len,
                                Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                    } 
                } else { 
                    int c = getHtmlColor(f.mColor);
                    if (c != -1) {
                        text.setSpan(new ForegroundColorSpan(c | 0xFF000000),
                                where, len, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                    } 
                } 
            } 
 
            if (f.mFace != null) {
                text.setSpan(new TypefaceSpan(f.mFace), where, len,
                        Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:

Related Android TextAppearanceSpan Questions & Answers:

See Code Examples for Android TextAppearanceSpan Methods: