/** * Sets the typeface and style in which the text should be displayed, * and turns on the fake bold and italic bits in the Paint if the * Typeface that you provided does not have all the bits in the * style that you specified. * * @attr ref android.R.styleable#TextView_typeface * @attr ref android.R.styleable#TextView_textStyle */ public void setTypeface (Typeface tf, int style){ mInputView.setTypeface(tf, style); }
/** * Sets the typeface and style in which the text should be displayed. * Note that not all Typeface families actually have bold and italic * variants, so you may need to use * {@link #setTypeface(Typeface, int)} to get the appearance * that you actually want. * * @see #getTypeface() * * @attr ref android.R.styleable#TextView_fontFamily * @attr ref android.R.styleable#TextView_typeface * @attr ref android.R.styleable#TextView_textStyle */ public void setTypeface (Typeface tf){ mInputView.setTypeface(tf); }
@Override public void setTypeface(Typeface tf) { super.setTypeface(tf); if (mTitlePaint != null) mTitlePaint.setTypeface(tf); }
EditText password = (EditText) findViewById(R.id.register_password_text); password.setTypeface(Typeface.DEFAULT); password.setTransformationMethod(new PasswordTransformationMethod());
editText.setTypeface(typeface, 0); editText.setGravity(gravity); editText.setImeOptions(imeOptions);
editText.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize); editText.setLineSpacing(extraSpacing, spacingMultiplier); editText.setTypeface(typeface, textStyle); editText.setGravity(gravity);
@Override public void onValueChange(NumberPicker picker, int oldVal, int newVal) { switch (view.getId()) { case R.id.color_group: mCurFocusText.setTextColor(Color.parseColor(TEXT_COLOR_TIPS_ARRAY[newVal])); break; case R.id.size_group: mCurFocusText.setTextSize(TypedValue.COMPLEX_UNIT_PX, Integer.parseInt(TEXT_SIZE_TIPS_ARRAY[newVal])); break; default: mCurFocusText.setTypeface(mTypefaces[newVal]); break; } } });
private void cloneEditText(EditText dstText, EditText srcText) { dstText.setText(srcText.getText()); dstText.setTextColor(srcText.getTextColors()); dstText.setTypeface(srcText.getTypeface()); dstText.setTextSize(TypedValue.COMPLEX_UNIT_PX, srcText.getTextSize()); } }
public void setTypeface(Typeface typeface) { mTypeface = typeface; if (mTypeface != null) { mSelectedText.setTypeface(mTypeface); mSelectorWheelPaint.setTypeface(mTypeface); } else { mSelectedText.setTypeface(Typeface.MONOSPACE); mSelectorWheelPaint.setTypeface(Typeface.MONOSPACE); } }
private void normalClicked(MenuItem item) { type = NORMAL; item.setChecked(true); textView.setTypeface(Typeface.DEFAULT, Typeface.NORMAL); }
private void monoClicked(MenuItem item) { type = MONO; item.setChecked(true); textView.setTypeface(Typeface.MONOSPACE, Typeface.NORMAL); }
public void setFontPath(String mFontPath) { this.mFontPath = mFontPath; if (!isInEditMode()) { // Loading Font Face mCreditCardTypeFace = Typeface.createFromAsset(mContext.getAssets(), mFontPath); mCardNumberView.setTypeface(mCreditCardTypeFace); mCardNameView.setTypeface(mCreditCardTypeFace); mExpiryDateView.setTypeface(mCreditCardTypeFace); mCvvView.setTypeface(mCreditCardTypeFace); } redrawViews(); }
//do: hidePassword(editText, someText.getTypeFace(), false) public static void hidePassword(EditText editText, Typeface typeface, boolean hidePassword){ if (hidePassword) { editText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); editText.setTypeface(typeface); } else { editText.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); editText.setTypeface(typeface); } editText.setSelection(editText.getText().toString().length()); }
public VerifyView setViewTextTypeFace(AssetManager manager, String path){ Typeface typeface = Typeface.createFromAsset(manager, path); for (int i = 0; i < this.rootView.getChildCount(); i++){ EditText editText = this.rootView.getChildAt(i).findViewWithTag(i); editText.setTypeface(typeface); } return this; }
private void setInputAsPasswordDots() { setRevealIconColor(R.color.kinrecovery_gray); passwordField.setInputType(passInputType); passwordField.setTransformationMethod(LargePasswordDotsTransformationMethod.getInstance()); passwordField.setTypeface(Typeface.SANS_SERIF); passwordField.setSelection(passwordField.getText().length()); isRevealPressed = false; }
private void setInputAsVisibleChars() { setRevealIconColor(R.color.kinrecovery_bluePrimary); passwordField.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_FILTER); passwordField.setTransformationMethod(null); passwordField.setTypeface(Typeface.SANS_SERIF); isRevealPressed = true; }
@Override public void setTypeface(final Typeface tf) { if (paint == null) paint = new TextPaint(getPaint()); paint.setTypeface(tf); super.setTypeface(tf); }
@Override public void initView() { mContext = getActivity(); mTitleEt.setTypeface(AppContext.getRobotoSlabLight()); mUpdateTimeTv.setTypeface(AppContext.getRobotoSlabLight()); mAlarmDateTv.setTypeface(AppContext.getRobotoSlabLight()); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ((EditText) findViewById(R.id.et_password)).setTypeface(Typeface.createFromAsset(getApplicationContext().getAssets(), "yekan.ttf")); ((RadioButton) findViewById(R.id.rb_male)).setTypeface(Typeface.createFromAsset(getApplicationContext().getAssets(), "yekan.ttf")); ((RadioButton) findViewById(R.id.rb_female)).setTypeface(Typeface.createFromAsset(getApplicationContext().getAssets(), "yekan.ttf")); } }
private void restoreTypography(CheckListView v, EditText returnView) { if (v.getEditText() != null) { returnView.setTypeface(v.getEditText().getTypeface()); returnView.setTextSize(0, v.getEditText().getTextSize()); returnView.setTextColor(v.getEditText().getTextColors()); returnView.setLinkTextColor(v.getEditText().getLinkTextColors()); } }