-
-
Notifications
You must be signed in to change notification settings - Fork 507
XML Properties
Here are all the XML properties available for CCP. Scroll down for detailed explanation of each...
<com.hbb20.CountryCodePicker
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:ccp_defaultNameCode=“US"
app:ccp_defaultLanguage="FRENCH"
app:ccp_contentColor="@color/custom_color"
app:ccp_textSize="20sp"
app:ccp_arrowSize="20dp"
app:ccp_customMasterCountries="AD,BT,CL,HT,US,GB,OM,NZ"
app:ccp_countryPreference="US,NZ"
app:ccp_flagBorderColor="@color/custom_color"
app:ccp_textGravity="RIGHT"
app:ccp_showNameCode="false"
app:ccp_showFlag="false"
app:ccp_showFullName="true"
app:ccp_clickable="true"
app:ccp_showPhoneCode="false"
app:ccp_autoDetectCountry="false"
app:ccp_autoDetectLanguage="true"
app:ccp_autoFormatNumber=“false"
app:ccpDialog_keyboardAutoPopup="false"
app:ccpDialog_allowSearch="false"
app:ccpDialog_showPhoneCode=“false"
app:ccpDialog_showFastScroller="false"
app:ccpDialog_fastScroller_bubbleColor="@color/custom_color"
app:ccpDialog_fastScroller_handleColor="@color/custom_color"
app:ccpDialog_fastScroller_bubbleTextAppearance="@style/custom_textAppearance"
app:ccpDialog_backgroundColor="@color/custom_color"
app:ccpDialog_searchEditTextTint="@color/custom_color"
app:ccpDialog_textColor="@color/custom_color"/>
This is the country which will be set automatically when layout prepared.
If auto_detect_country
is enabled, this country will be set in CCP fails to detect country or something goes wrong.
Your specified default language is loaded when layout is prepared. If auto_detect_launguage is enabled, this will be used as fall back language when CCP fails to detect language or detected language is not supported.
This will change the color of text and down arrow of CCP view.
Changes the size of CCP text. It also changes arrowSize accordingly unless explicitly stated using app:ccp_arrowSize.
Specifies the size of downward arrow.
Sets specified countries as master countries and will list only those countries to select from. If not specified, all the countries from library will be listed. [Read more]
Specified countries will be set as preferred countries and will be listed at the top of countries list. [Read more]
If you feel like flags are not properly visible because of matching background color, you can give border color to the flag for better appearance.
When width is “match_parent”, this will decide the gravity of text in CCP view.
Decide whether to show name code on CCP. Default : TRUE
Toggles visibility of flag on CCP.
To show or hide full name of country on CCP. Default : FALSE
Enable / disable click of ccp.
To show or hide phoneCode from CCP. While using CCP as Country selector rather than Phone Code Picker, you want to remove phone code from CCP view. This will affect phone code of CCP_DIALOG unless specified using app:ccpDialog_showPhoneCode.
If enabled, it will detect country from device and set in CCP as soon as view is rendered. When CCP fails to detect country from device or something goes wrong, it will set your default country (or India, if not specified) as selected country. If disabled, it will load your specified default country (or India, if not specified) in the CCP when view is prepared.
If enabled, it will detect device language and load CCP for that language. If CCP fails to detect the language or language is not yet supported, it will switch back to the app:ccp_defaultLanguage.
Auto formatter will format the number as user types number in registered editText.
Whether to show keyboard for search as soon as dialog for country selection is launched, is decided by this.
This will decide whether to allow search from list of countries. When your custom master list is really short, you might want to remove search option from CCP dialog.
app:ccpDialog_showPhoneCode=“false"
(Default : TRUE or follows app:ccp_showPhoneCode when specified)
While using library as Country Selector, you don’t want to show phone code of countries in list. Normally, setting app:ccp_showPhoneCode as false is sufficient to hide phone code from both, CCP and CCP DIALOG as app:ccpDialog_showPhoneCode follows app:ccp_showPhoneCode by default.
This enables / disables fastScroller for the CCP Dialog.
When fastScroller is enabled, this will be the background color of Index bubble.
When fastScroller is enabled, this will be scroller handle color.
This will be the textAppearance for bubble text.
This### helps you modify theme of the dialog. This will be the background color for the CCP Dialog.
- 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