private void initTypefaces() { if (titleTypeface != null) { noInternet.setTypeface(titleTypeface); } if (messageTypeface != null) { noInternetBody.setTypeface(messageTypeface); } }
/** * To change font of ccp views along with style. */ @SuppressWarnings("unused") public void setTypeFace(Typeface typeFace, int style) { try { mTvSelectedCountry.setTypeface(typeFace, style); } catch (Exception e) { e.printStackTrace(); } }
/** * Set TypeFace for all the text in CCP * * @param typeFace TypeFace generated from assets. */ @SuppressWarnings("unused") public void setTypeFace(Typeface typeFace) { mTypeFace = typeFace; try { mTvSelectedCountry.setTypeface(typeFace); } catch (Exception e) { e.printStackTrace(); } }
/** * set TypeFace for all the text in CCP * * @param fontAssetPath font path in asset folder. */ public void setTypeFace(String fontAssetPath) { try { Typeface typeFace = Typeface.createFromAsset(getContext().getAssets(), fontAssetPath); mTypeFace = typeFace; mTvSelectedCountry.setTypeface(typeFace); } catch (Exception e) { Log.d(TAG, "Invalid fontPath. " + e.toString()); } }
@Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.permission_rationale, container, false); AppCompatTextView rationaleView = (AppCompatTextView) rootView.findViewById(R.id.permission_text); rationaleView.setText(getArguments().getString(TEXT_KEY)); rationaleView.setTextSize(TypedValue.COMPLEX_UNIT_PX, getArguments().getFloat(TEXT_SIZE)); rationaleView.setTextColor(getArguments().getInt(TEXT_COLOR)); rationaleView.setTypeface(Typeface.createFromAsset(getResources().getAssets(), "fonts/" + getArguments().getString(TEXT_FONT))); return rootView; } }
tvCode.setTypeface(typeface); tvName.setTypeface(typeface);
private void setupData() { if (mCountryCodePicker.getTypeFace() != null) { Typeface typeface = mCountryCodePicker.getTypeFace(); mTvTitle.setTypeface(typeface); mEdtSearch.setTypeface(typeface); mTvNoResult.setTypeface(typeface);