TextView setTextAppearance - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for TextView setTextAppearance method.

This code example shows how to use the following methods:setVisibility, setEllipsize, setSingleLine, setText, setTextAppearance
This code example shows how to use the following methods:setVisibility, setEllipsize, setGravity, setSingleLine, setText
     * Returns the text view for the app name, creating it if necessary. 
     */ 
    public void setNameText(CharSequence text) {
        if (!TextUtils.isEmpty(text)) {
            if (mNameTextView == null) {
                mNameTextView = new TextView(mContext);
                mNameTextView.setSingleLine(true);
                mNameTextView.setEllipsize(TruncateAt.END);
                mNameTextView.setTextAppearance(mContext, android.R.style.TextAppearance_Large);
                mNameTextView.setGravity(Gravity.CENTER_VERTICAL);
                addView(mNameTextView);
            } 
            mNameTextView.setText(text);
            mNameTextView.setVisibility(View.VISIBLE);
        } else { 
            if (mNameTextView != null) {
                mNameTextView.setVisibility(View.GONE);
            } 
        } 
    } 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getTypeface, setEllipsize, setSingleLine, setTextAppearance, setTypeface
    /** 
     * Returns the text view for the data label, creating it if necessary. 
     */ 
    public TextView getLabelView() {
        if (mLabelView == null) {
            mLabelView = new TextView(mContext);
            mLabelView.setSingleLine(true);
            mLabelView.setEllipsize(TruncateAt.MARQUEE);
            mLabelView.setTextAppearance(mContext, android.R.style.TextAppearance_Small);
            mLabelView.setTypeface(mLabelView.getTypeface(), Typeface.BOLD);
            addView(mLabelView);
        } 
        return mLabelView;
    } 
 
    /** 
     * Adds or updates a text view for the data element. 
     */ 
    public void setData(char[] text, int size) {
        if (text == null || size == 0) {
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setLayoutParams, setEllipsize, setGravity, setPadding, setSingleLine
            crumbView = view;
            data = tag;
        } 
 
        private TextView makeCrumbView(String name) {
            TextView tv = new TextView(mContext);
            tv.setTextAppearance(mContext, android.R.style.TextAppearance_Medium);
            tv.setPadding(mCrumbPadding, 0, mCrumbPadding, 0);
            tv.setGravity(Gravity.CENTER_VERTICAL);
            tv.setText(name);
            tv.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
                    LayoutParams.MATCH_PARENT));
            tv.setSingleLine();
            tv.setEllipsize(TextUtils.TruncateAt.END);
            return tv;
        } 
 
    } 
 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setGravity, setMaxLines, setPadding, setTextAppearance, setTypeface
This code example shows how to use the following methods:setTextAppearance
        } 
    } 
 
    private void setTextStyle(TextView view, int style) {
        if (style != 0) {
            view.setTextAppearance(getContext(), style);
        } 
    } 
 
    public void setTitle(CharSequence text) {
        mTitle.setText(text);
    } 
 
    public void setTitleColor(int color) {
        mTitle.setTextColor(color);
    } 
 
    public void setLeftIcon(Drawable drawable, int alpha) {
        setIcon(mLeftIcon, drawable, alpha);
    } 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setTextAppearance
        } 
    } 
 
    private void setTextStyle(TextView view, int style) {
        if (style != 0) {
            view.setTextAppearance(getContext(), style);
        } 
    } 
 
    public void setTitle(CharSequence text) {
        mTitle.setText(text);
    } 
 
    public void setTitleColor(int color) {
        mTitle.setTextColor(color);
    } 
 
    public void setLeftIcon(Drawable drawable, int alpha) {
        setIcon(mLeftIcon, drawable, alpha);
    } 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setTextAppearance
    	} 
	} 
	 
	public void setFontFace(int res)
	{ 
		ed.setTextAppearance(context, res);
	} 
	public void setFontSize(float size)
	{ 
		ed.setTextSize(size);
	} 
} 
 
 
4
CodeRank
Experience pair programming with AI  Get Codota for Java

Related TextView setTextAppearance Questions & Answers:

setTextAppearance Method Overview
Sets the text color, size, style, hint color, and highlight color from the specified TextAppearance resource.
See Code Examples for other Android TextView Methods: