Java Code Examples for android.widget.TextView.setPaintFlags()

The following are Jave code examples for showing how to use setPaintFlags() of the android.widget.TextView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: SimpleMutiTypeAdapter   File: BaseViewHolder.java   View Source Code Vote up 5 votes
/**
 * Apply the typeface to the given viewId, and enable subpixel rendering.
 */
public BaseViewHolder setTypeface(@IdRes int viewId, Typeface typeface) {
    TextView view = getView(viewId);
    view.setTypeface(typeface);
    view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
    return this;
}
 
Example 2
Project: AndroidBasicLibs   File: HelperViewHolder.java   View Source Code Vote up 5 votes
@Override
public HelperViewHolder setTypeface(Typeface typeface, int... viewIds) {
    for (int viewId : viewIds) {
        TextView view = getView(viewId);
        view.setTypeface(typeface);
        view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
    }
    return this;
}
 
Example 3
Project: MyFire   File: ViewHolderHelper.java   View Source Code Vote up 5 votes
public ViewHolderHelper setTypeface(Typeface typeface, int... viewIds) {
    for (int viewId : viewIds) {
        TextView view = getView(viewId);
        view.setTypeface(typeface);
        view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
    }
    return this;
}
 
Example 4
Project: BookReader-master   File: EasyLVHolder.java   View Source Code Vote up 5 votes
@Override
public EasyLVHolder setTypeface(int viewId, Typeface typeface) {
    TextView view = getView(viewId);
    view.setTypeface(typeface);
    view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
    return this;
}
 
Example 5
Project: AppCommonFrame   File: ViewHolder.java   View Source Code Vote up 5 votes
public ViewHolder setTypeface(Typeface typeface, int... viewIds) {
    for (int viewId : viewIds) {
        TextView view = getView(viewId);
        view.setTypeface(typeface);
        view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
    }
    return this;
}
 
Example 6
Project: GitHub   File: EasyRVHolder.java   View Source Code Vote up 5 votes
@Override
public EasyRVHolder setTypeface(int viewId, Typeface typeface) {
    TextView view = getView(viewId);
    view.setTypeface(typeface);
    view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
    return this;
}
 
Example 7
Project: Todo_App   File: TodoFragment.java   View Source Code Vote up 5 votes
@Override
public void onClickCheckBox(int p,CheckBox checkBox,TextView title)
{
    HashMap<String,String> map = mArrayList.get(p);

    if(checkBox.isChecked())
    {
        title.setPaintFlags(title.getPaintFlags()|Paint.STRIKE_THRU_TEXT_FLAG);
        MediaPlayer player = MediaPlayer.create(getContext(),R.raw.ding);
        player.setAudioStreamType(AudioManager.STREAM_MUSIC);

        if(player.isPlaying())
            player.stop();
        else
            player.start();


        mTodo.updateData(keyName,1,map.get("id"));
        mArrayList = mTodo.getData(keyName);

    }
    else
    {
        title.setPaintFlags(title.getPaintFlags()&(~Paint.STRIKE_THRU_TEXT_FLAG));
        mTodo.updateData(keyName,0,map.get("id"));
        mArrayList = mTodo.getData(keyName);

    }
}
 
Example 8
Project: garras   File: BaseViewHolder.java   View Source Code Vote up 5 votes
/**
 * Apply the typeface to the given viewId, and enable subpixel rendering.
 */
public BaseViewHolder setTypeface(@IdRes int viewId, Typeface typeface) {
    TextView view = getView(viewId);
    view.setTypeface(typeface);
    view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
    return this;
}
 
Example 9
Project: MyLife   File: TextViewUtils.java   View Source Code Vote up 5 votes
public static void setBold(TextView textView, boolean work) {
    int flags = textView.getPaintFlags();
    if (work) {
        textView.setPaintFlags(flags | Paint.FAKE_BOLD_TEXT_FLAG);
    } else {
        textView.setPaintFlags(flags | ~Paint.FAKE_BOLD_TEXT_FLAG);
    }
}
 
Example 10
Project: SmartChart   File: ViewHolder.java   View Source Code Vote up 5 votes
public ViewHolder setTypeface(Typeface typeface, int... viewIds) {
    for (int viewId : viewIds) {
        TextView view = getView(viewId);
        view.setTypeface(typeface);
        view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
    }
    return this;
}
 
Example 11
Project: YCBaseAdapter   File: BaseViewHolder.java   View Source Code Vote up 5 votes
public BaseViewHolder setTypeface(Typeface typeface, int... viewIds) {
    for (int viewId : viewIds) {
        TextView view = getView(viewId);
        view.setTypeface(typeface);
        view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
    }
    return this;
}
 
Example 12
Project: godlibrary   File: BaseViewHolder.java   View Source Code Vote up 5 votes
/**
 * Apply the typeface to the given viewId, and enable subpixel rendering.
 */
public BaseViewHolder setTypeface(int viewId, Typeface typeface) {
    TextView view = getView(viewId);
    view.setTypeface(typeface);
    view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
    return this;
}
 
Example 13
Project: go-jay   File: TariffView.java   View Source Code Vote up 5 votes
private void initView() {
	v=LayoutInflater.from(getContext()).inflate(R.layout.tariff_view, null);
	jarak=(TextView) v.findViewById(R.id.tariffviewJarak);
	oldprice=(TextView) v.findViewById(R.id.tariffviewOldPrice);
	normprice=(TextView) v.findViewById(R.id.tariffviewNormalPrice);
	lowprice=(TextView) v.findViewById(R.id.tariffviewLowPrice);
	reload=(TextView) v.findViewById(R.id.tariffviewReload);
	rb1=(RadioButton) v.findViewById(R.id.sbRadioButton1);
	rb2=(RadioButton) v.findViewById(R.id.sbRadioButton2);
	jarakBar=v.findViewById(R.id.tariffviewLinearLayout1);
	myLoc=v.findViewById(R.id.tariffviewMyLoc);
	rootv=v.findViewById(R.id.tariffviewLinearLayout2);
	oldprice.setPaintFlags(oldprice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
	myLoc.setOnClickListener(new View.OnClickListener(){
			@Override
			public void onClick(View p1) {
				if(callmyloc!=null) callmyloc.onMyLocationButtonClick();
			}
		});
	post(new Runnable(){
			@Override
			public void run() {
				myHeight=getHeight();
			}
		});
	rb1.setOnCheckedChangeListener(this);
	rb2.setOnCheckedChangeListener(this);
	rb2.setChecked(true);
	addView(v);
}
 
Example 14
Project: ShaddockVideoPlayer   File: BaseViewHolder.java   View Source Code Vote up 5 votes
/**
 * Apply the typeface to all the given viewIds, and enable subpixel rendering.
 */
public BaseViewHolder setTypeface(Typeface typeface, int... viewIds) {
    for (int viewId : viewIds) {
        TextView view = getView(viewId);
        view.setTypeface(typeface);
        view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
    }
    return this;
}
 
Example 15
Project: GitHub   File: BaseViewHolder.java   View Source Code Vote up 5 votes
/**
 * Apply the typeface to the given viewId, and enable subpixel rendering.
 */
public BaseViewHolder setTypeface(@IdRes int viewId, Typeface typeface) {
    TextView view = getView(viewId);
    view.setTypeface(typeface);
    view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
    return this;
}
 
Example 16
Project: RLibrary   File: ViewHolder.java   View Source Code Vote up 5 votes
public ViewHolder setTypeface(Typeface typeface, int... viewIds) {
    for (int viewId : viewIds) {
        TextView view = getView(viewId);
        view.setTypeface(typeface);
        view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
    }
    return this;
}
 
Example 17
Project: MyLife   File: TextViewUtils.java   View Source Code Vote up 4 votes
public static void drawUnderLine(TextView textView) {
    textView.setPaintFlags(textView.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
}
 
Example 18
Project: MyLife   File: TextViewUtils.java   View Source Code Vote up 4 votes
public static void undrawUnderLine(TextView textView) {
    textView.setPaintFlags(textView.getPaintFlags() | ~Paint.UNDERLINE_TEXT_FLAG);
}
 
Example 19
Project: GitHub   File: MaterialDialog.java   View Source Code Vote up 4 votes
public final void setTypeface(TextView target, Typeface t) {
    if (t == null) return;
    int flags = target.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG;
    target.setPaintFlags(flags);
    target.setTypeface(t);
}
 
Example 20
Project: TextReader   File: BaseViewHolder.java   View Source Code Vote up 4 votes
public BaseViewHolder setTypeface(int viewId, Typeface typeface) {
    TextView view = getView(viewId);
    view.setTypeface(typeface);
    view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
    return this;
}