-
-
Notifications
You must be signed in to change notification settings - Fork 506
Custom TypeFace (FontFamily)
Harsh Bhakta edited this page Nov 13, 2017
·
2 revisions
FontFamily or TypeFace of CCP view and dialog can be changed in order to match rest of the view of your screen.
-
Font can be set only programmatically.
-
- Step 1: create a folder named 'assets' under 'app/src/main/' folder. If you already have 'app/src/main/assets' then jump to next step.
- Step 2: put your font's .ttf file in assets folder. For example if file name is 'myfonts.ttf', it should be 'app/src/main/assets/myfonts.ttf'. Make sure that the extension '.ttf' have contain small letters only. '.TTF' might not work.
- Step 3: Prepare typeFace using
Typeface typeFace=Typeface.createFromAsset(getContext().getAssets(),"myfonts.ttf");
- Step 4: finally apply the type face on ccp
ccp.setTypeFace(typeFace);
ORccp.setTypeFace(typeFace,customStyle);
Following above steps with apply "myfonts" to CCP view's text and dialog as well.
For flexibility, CCP maintains two typefaces. One for CCP view and one for dialog. For ease, it updates both when ccp.setTypeFace();
is called.
- If you want to use typeface only for dialog's text, use
ccp.setDialogTypeFace()
. - If want to use typeface for CCP view but want to keep dialog's typeface as default. SO should call
ccp.setTypeFace(typeFace,customStyle);
and thenccp.setDialogTypeFace(null);
- How to Integrate into your project
- Full Number Support
- Use as a Country Selector
- Auto detect country
- Auto detect language
- Remember last selection
- Country Preference
- Custom Mater List
- Exclude Countries
- Example phonenumber as hint
- Multi Language Support
- Default Country
- Country Selection Listener
- Dialog events listener
- CCP Theme Customization
- CCP Dialog Theme Customization
- Custom TypeFace
- Read Selected Country
- XML Properties
- Update Guide to v2
- Guide to Add New Language Support
- Guide to add New Country
- Change contry names for local project
- Handle CCP ClickListener Manually
- Custom Dialog Title/Hint/Empty Result ACK
- Flag Emoji Support (BETA)
- Change Log