├── .github └── FUNDING.yml ├── .gitignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── License.txt ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── in │ │ └── hbb20 │ │ └── countrycodepickerproject │ │ └── ApplicationTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ ├── bookos.ttf │ │ ├── hack.ttf │ │ ├── playfair.ttf │ │ ├── raleway.ttf │ │ └── titillium.ttf │ ├── java │ │ └── in │ │ │ └── hbb20 │ │ │ └── countrycodepickerproject │ │ │ ├── CCPCustomTalkBackProvider.java │ │ │ ├── CountryPreferenceFragment.kt │ │ │ ├── CustomColorFragment.kt │ │ │ ├── CustomFontFragment.kt │ │ │ ├── CustomMasterFragment.kt │ │ │ ├── CustomSizeFragment.kt │ │ │ ├── DefaultCountryFragment.kt │ │ │ ├── ExampleActivity.kt │ │ │ ├── FullNumberFragment.kt │ │ │ ├── GetCountryFragment.kt │ │ │ ├── HomeActivity.kt │ │ │ ├── IntroductionFragment.kt │ │ │ ├── LanguageSupportFragment.kt │ │ │ └── SetCountryFragment.kt │ └── res │ │ ├── drawable │ │ ├── card.xml │ │ ├── gradient.xml │ │ ├── ic_assignment_late_black_24dp.xml │ │ ├── ic_assignment_turned_in_black_24dp.xml │ │ ├── ic_ccp_launcher.png │ │ ├── ic_done_black_24dp.xml │ │ ├── img_a.png │ │ ├── img_b.png │ │ ├── img_c.png │ │ ├── img_d.png │ │ ├── img_f.png │ │ ├── img_g.png │ │ ├── img_h.png │ │ ├── img_i.png │ │ └── img_j.png │ │ ├── layout │ │ ├── activity_example.xml │ │ ├── activity_home.xml │ │ ├── fragment_country_preference.xml │ │ ├── fragment_custom_color.xml │ │ ├── fragment_custom_font.xml │ │ ├── fragment_custom_master_list.xml │ │ ├── fragment_custom_size.xml │ │ ├── fragment_default_country.xml │ │ ├── fragment_full_number.xml │ │ ├── fragment_get_country.xml │ │ ├── fragment_introduction.xml │ │ ├── fragment_language_support.xml │ │ └── fragment_set_country.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── raw │ │ ├── keep.xml │ │ └── to_be_deleted.txt │ │ ├── values-v16 │ │ └── styles.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── in │ └── hbb20 │ └── countrycodepickerproject │ └── ExampleUnitTest.kt ├── build.gradle ├── ccp ├── .gitignore ├── build.gradle ├── gradle.properties ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ ├── futuremind │ │ │ └── recyclerviewfastscroll │ │ │ │ ├── FastScroller.java │ │ │ │ ├── LICENSE │ │ │ │ ├── RecyclerViewScrollListener.java │ │ │ │ ├── SectionTitleProvider.java │ │ │ │ ├── Utils.java │ │ │ │ └── viewprovider │ │ │ │ ├── DefaultBubbleBehavior.java │ │ │ │ ├── DefaultScrollerViewProvider.java │ │ │ │ ├── ScrollerViewProvider.java │ │ │ │ ├── ViewBehavior.java │ │ │ │ └── VisibilityAnimationManager.java │ │ │ └── hbb20 │ │ │ ├── CCPCountry.java │ │ │ ├── CCPCountryGroup.java │ │ │ ├── CCPTalkBackTextProvider.java │ │ │ ├── CountryCodeAdapter.java │ │ │ ├── CountryCodeDialog.java │ │ │ ├── CountryCodePicker.java │ │ │ └── InternationalPhoneTextWatcher.java │ └── res │ │ ├── animator │ │ ├── fastscroll__default_hide.xml │ │ └── fastscroll__default_show.xml │ │ ├── drawable │ │ ├── ccp_ic_arrow_drop_down.xml │ │ ├── fastscroll__default_bubble.xml │ │ ├── fastscroll__default_handle.xml │ │ ├── flag_afghanistan.png │ │ ├── flag_aland.png │ │ ├── flag_albania.png │ │ ├── flag_algeria.png │ │ ├── flag_american_samoa.png │ │ ├── flag_andorra.png │ │ ├── flag_angola.png │ │ ├── flag_anguilla.png │ │ ├── flag_antarctica.png │ │ ├── flag_antigua_and_barbuda.png │ │ ├── flag_argentina.png │ │ ├── flag_armenia.png │ │ ├── flag_aruba.png │ │ ├── flag_australia.png │ │ ├── flag_austria.png │ │ ├── flag_azerbaijan.png │ │ ├── flag_bahamas.png │ │ ├── flag_bahrain.png │ │ ├── flag_bangladesh.png │ │ ├── flag_barbados.png │ │ ├── flag_belarus.png │ │ ├── flag_belgium.png │ │ ├── flag_belize.png │ │ ├── flag_benin.png │ │ ├── flag_bermuda.png │ │ ├── flag_bhutan.png │ │ ├── flag_bolivia.png │ │ ├── flag_bosnia.png │ │ ├── flag_botswana.png │ │ ├── flag_brazil.png │ │ ├── flag_british_indian_ocean_territory.png │ │ ├── flag_british_virgin_islands.png │ │ ├── flag_brunei.png │ │ ├── flag_bulgaria.png │ │ ├── flag_burkina_faso.png │ │ ├── flag_burundi.png │ │ ├── flag_cambodia.png │ │ ├── flag_cameroon.png │ │ ├── flag_canada.png │ │ ├── flag_cape_verde.png │ │ ├── flag_cayman_islands.png │ │ ├── flag_central_african_republic.png │ │ ├── flag_chad.png │ │ ├── flag_chile.png │ │ ├── flag_china.png │ │ ├── flag_christmas_island.png │ │ ├── flag_cocos.png │ │ ├── flag_colombia.png │ │ ├── flag_comoros.png │ │ ├── flag_cook_islands.png │ │ ├── flag_costa_rica.png │ │ ├── flag_cote_divoire.png │ │ ├── flag_croatia.png │ │ ├── flag_cuba.png │ │ ├── flag_curacao.png │ │ ├── flag_cyprus.png │ │ ├── flag_czech_republic.png │ │ ├── flag_democratic_republic_of_the_congo.png │ │ ├── flag_denmark.png │ │ ├── flag_djibouti.png │ │ ├── flag_dominica.png │ │ ├── flag_dominican_republic.png │ │ ├── flag_ecuador.png │ │ ├── flag_egypt.png │ │ ├── flag_el_salvador.png │ │ ├── flag_equatorial_guinea.png │ │ ├── flag_eritrea.png │ │ ├── flag_estonia.png │ │ ├── flag_ethiopia.png │ │ ├── flag_falkland_islands.png │ │ ├── flag_faroe_islands.png │ │ ├── flag_fiji.png │ │ ├── flag_finland.png │ │ ├── flag_france.png │ │ ├── flag_french_polynesia.png │ │ ├── flag_gabon.png │ │ ├── flag_gambia.png │ │ ├── flag_georgia.png │ │ ├── flag_germany.png │ │ ├── flag_ghana.png │ │ ├── flag_gibraltar.png │ │ ├── flag_greece.png │ │ ├── flag_greenland.png │ │ ├── flag_grenada.png │ │ ├── flag_guadeloupe.png │ │ ├── flag_guam.png │ │ ├── flag_guatemala.png │ │ ├── flag_guernsey.png │ │ ├── flag_guinea.png │ │ ├── flag_guinea_bissau.png │ │ ├── flag_guyana.png │ │ ├── flag_guyane.png │ │ ├── flag_haiti.png │ │ ├── flag_honduras.png │ │ ├── flag_hong_kong.png │ │ ├── flag_hungary.png │ │ ├── flag_iceland.png │ │ ├── flag_india.png │ │ ├── flag_indonesia.png │ │ ├── flag_iran.png │ │ ├── flag_iraq.png │ │ ├── flag_iraq_new.png │ │ ├── flag_ireland.png │ │ ├── flag_isleof_man.png │ │ ├── flag_israel.png │ │ ├── flag_italy.png │ │ ├── flag_jamaica.png │ │ ├── flag_japan.png │ │ ├── flag_jersey.png │ │ ├── flag_jordan.png │ │ ├── flag_kazakhstan.png │ │ ├── flag_kenya.png │ │ ├── flag_kiribati.png │ │ ├── flag_kosovo.png │ │ ├── flag_kuwait.png │ │ ├── flag_kyrgyzstan.png │ │ ├── flag_laos.png │ │ ├── flag_latvia.png │ │ ├── flag_lebanon.png │ │ ├── flag_lesotho.png │ │ ├── flag_liberia.png │ │ ├── flag_libya.png │ │ ├── flag_liechtenstein.png │ │ ├── flag_lithuania.png │ │ ├── flag_luxembourg.png │ │ ├── flag_macao.png │ │ ├── flag_macedonia.png │ │ ├── flag_madagascar.png │ │ ├── flag_malawi.png │ │ ├── flag_malaysia.png │ │ ├── flag_maldives.png │ │ ├── flag_mali.png │ │ ├── flag_malta.png │ │ ├── flag_marshall_islands.png │ │ ├── flag_martinique.png │ │ ├── flag_mauritania.png │ │ ├── flag_mauritius.png │ │ ├── flag_mexico.png │ │ ├── flag_micronesia.png │ │ ├── flag_moldova.png │ │ ├── flag_monaco.png │ │ ├── flag_mongolia.png │ │ ├── flag_montserrat.png │ │ ├── flag_morocco.png │ │ ├── flag_mozambique.png │ │ ├── flag_myanmar.png │ │ ├── flag_namibia.png │ │ ├── flag_nauru.png │ │ ├── flag_nepal.png │ │ ├── flag_netherlands.png │ │ ├── flag_netherlands_antilles.png │ │ ├── flag_new_caledonia.png │ │ ├── flag_new_zealand.png │ │ ├── flag_nicaragua.png │ │ ├── flag_niger.png │ │ ├── flag_nigeria.png │ │ ├── flag_niue.png │ │ ├── flag_norfolk_island.png │ │ ├── flag_north_korea.png │ │ ├── flag_northern_mariana_islands.png │ │ ├── flag_norway.png │ │ ├── flag_of_montenegro.png │ │ ├── flag_oman.png │ │ ├── flag_pakistan.png │ │ ├── flag_palau.png │ │ ├── flag_palestine.png │ │ ├── flag_panama.png │ │ ├── flag_papua_new_guinea.png │ │ ├── flag_paraguay.png │ │ ├── flag_peru.png │ │ ├── flag_philippines.png │ │ ├── flag_pitcairn_islands.png │ │ ├── flag_poland.png │ │ ├── flag_portugal.png │ │ ├── flag_puerto_rico.png │ │ ├── flag_qatar.png │ │ ├── flag_republic_of_the_congo.png │ │ ├── flag_romania.png │ │ ├── flag_russian_federation.png │ │ ├── flag_rwanda.png │ │ ├── flag_saint_barthelemy.png │ │ ├── flag_saint_helena.png │ │ ├── flag_saint_kitts_and_nevis.png │ │ ├── flag_saint_lucia.png │ │ ├── flag_saint_martin.png │ │ ├── flag_saint_pierre.png │ │ ├── flag_saint_vicent_and_the_grenadines.png │ │ ├── flag_samoa.png │ │ ├── flag_san_marino.png │ │ ├── flag_sao_tome_and_principe.png │ │ ├── flag_saudi_arabia.png │ │ ├── flag_senegal.png │ │ ├── flag_serbia.png │ │ ├── flag_serbia_and_montenegro.png │ │ ├── flag_seychelles.png │ │ ├── flag_sierra_leone.png │ │ ├── flag_singapore.png │ │ ├── flag_sint_maarten.png │ │ ├── flag_slovakia.png │ │ ├── flag_slovenia.png │ │ ├── flag_soloman_islands.png │ │ ├── flag_somalia.png │ │ ├── flag_south_africa.png │ │ ├── flag_south_georgia.png │ │ ├── flag_south_korea.png │ │ ├── flag_south_sudan.png │ │ ├── flag_soviet_union.png │ │ ├── flag_spain.png │ │ ├── flag_sri_lanka.png │ │ ├── flag_sudan.png │ │ ├── flag_suriname.png │ │ ├── flag_swaziland.png │ │ ├── flag_sweden.png │ │ ├── flag_switzerland.png │ │ ├── flag_syria.png │ │ ├── flag_taiwan.png │ │ ├── flag_tajikistan.png │ │ ├── flag_tanzania.png │ │ ├── flag_thailand.png │ │ ├── flag_tibet.png │ │ ├── flag_timor_leste.png │ │ ├── flag_togo.png │ │ ├── flag_tokelau.png │ │ ├── flag_tonga.png │ │ ├── flag_transparent.png │ │ ├── flag_trinidad_and_tobago.png │ │ ├── flag_tunisia.png │ │ ├── flag_turkey.png │ │ ├── flag_turkmenistan.png │ │ ├── flag_turks_and_caicos_islands.png │ │ ├── flag_tuvalu.png │ │ ├── flag_uae.png │ │ ├── flag_uganda.png │ │ ├── flag_ukraine.png │ │ ├── flag_united_kingdom.png │ │ ├── flag_united_states_of_america.png │ │ ├── flag_uruguay.png │ │ ├── flag_us_virgin_islands.png │ │ ├── flag_uzbekistan.png │ │ ├── flag_vanuatu.png │ │ ├── flag_vatican_city.png │ │ ├── flag_venezuela.png │ │ ├── flag_vietnam.png │ │ ├── flag_wallis_and_futuna.png │ │ ├── flag_yemen.png │ │ ├── flag_zambia.png │ │ ├── flag_zimbabwe.png │ │ ├── ic_backspace_black_24dp.xml │ │ └── ic_clear_black_24dp.xml │ │ ├── layout │ │ ├── fastscroll__default_bubble.xml │ │ ├── layout_code_picker.xml │ │ ├── layout_full_width_code_picker.xml │ │ ├── layout_picker_dialog.xml │ │ └── layout_recycler_country_tile.xml │ │ ├── raw │ │ ├── a_new_lang_template.xml │ │ ├── ccp_afrikaans.xml │ │ ├── ccp_arabic.xml │ │ ├── ccp_basque.xml │ │ ├── ccp_belarusian.xml │ │ ├── ccp_bengali.xml │ │ ├── ccp_chinese_simplified.xml │ │ ├── ccp_chinese_traditional.xml │ │ ├── ccp_czech.xml │ │ ├── ccp_danish.xml │ │ ├── ccp_dutch.xml │ │ ├── ccp_english.xml │ │ ├── ccp_farsi.xml │ │ ├── ccp_french.xml │ │ ├── ccp_german.xml │ │ ├── ccp_greek.xml │ │ ├── ccp_gujarati.xml │ │ ├── ccp_hausa.xml │ │ ├── ccp_hebrew.xml │ │ ├── ccp_hindi.xml │ │ ├── ccp_hungarian.xml │ │ ├── ccp_indonesia.xml │ │ ├── ccp_italian.xml │ │ ├── ccp_japanese.xml │ │ ├── ccp_kazakh.xml │ │ ├── ccp_korean.xml │ │ ├── ccp_lithuanian.xml │ │ ├── ccp_marathi.xml │ │ ├── ccp_polish.xml │ │ ├── ccp_portuguese.xml │ │ ├── ccp_punjabi.xml │ │ ├── ccp_russian.xml │ │ ├── ccp_serbian.xml │ │ ├── ccp_slovak.xml │ │ ├── ccp_slovenian.xml │ │ ├── ccp_spanish.xml │ │ ├── ccp_swedish.xml │ │ ├── ccp_tagalog.xml │ │ ├── ccp_tamil.xml │ │ ├── ccp_thai.xml │ │ ├── ccp_turkish.xml │ │ ├── ccp_ukrainian.xml │ │ ├── ccp_urdu.xml │ │ ├── ccp_uzbek.xml │ │ ├── ccp_vietnamese.xml │ │ └── keep_ccp.xml │ │ └── values │ │ ├── attr.xml │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ └── strings.xml │ └── test │ └── java │ └── com │ └── hbb20 │ └── countrycodepickerlib │ └── ExampleUnitTest.java ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── playstore.jpeg ├── settings.gradle └── tags /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: hbb20 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # Intellij 36 | *.iml 37 | .idea/ 38 | 39 | # Keystore files 40 | *.jks 41 | 42 | # External native build folder generated in Android Studio 2.2 and later 43 | .externalNativeBuild 44 | 45 | # Project backup file 46 | projectFilesBackup/ 47 | 48 | .DS_Store 49 | /captures 50 | 51 | .project 52 | .settings 53 | .vscode 54 | .classpath 55 | **/output.json 56 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at harshbbhakta@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | android { 5 | compileSdkVersion 33 6 | 7 | defaultConfig { 8 | applicationId "in.hbb20.countrycodepickerproject" 9 | minSdkVersion 14 10 | targetSdkVersion 33 11 | versionCode 7 12 | versionName "2.2.4" 13 | } 14 | buildTypes { 15 | release { 16 | // Enables code shrinking, obfuscation, and optimization for only 17 | // your project's release build type. 18 | minifyEnabled true 19 | 20 | // Enables resource shrinking, which is performed by the 21 | // Android Gradle plugin. 22 | shrinkResources true 23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 24 | } 25 | } 26 | } 27 | 28 | dependencies { 29 | implementation fileTree(include: ['*.jar'], dir: 'libs') 30 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion" 31 | debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7' 32 | implementation project(':ccp') 33 | implementation 'androidx.appcompat:appcompat:1.3.1' 34 | implementation 'androidx.legacy:legacy-support-v4:1.0.0' 35 | implementation 'androidx.cardview:cardview:1.0.0' 36 | testImplementation 'junit:junit:4.13.2' 37 | } 38 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /home/hbb20/AndroidSDK/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/in/hbb20/countrycodepickerproject/ApplicationTest.kt: -------------------------------------------------------------------------------- 1 | package `in`.hbb20.countrycodepickerproject 2 | 3 | import android.app.Application 4 | import android.test.ApplicationTestCase 5 | 6 | /** 7 | * [Testing Fundamentals](http://d.android.com/tools/testing/testing_android.html) 8 | */ 9 | class ApplicationTest: ApplicationTestCase(Application::class.java) -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/assets/bookos.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hbb20/CountryCodePickerProject/7a76d92a460df02f33b0d1ea5262c867223fc568/app/src/main/assets/bookos.ttf -------------------------------------------------------------------------------- /app/src/main/assets/hack.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hbb20/CountryCodePickerProject/7a76d92a460df02f33b0d1ea5262c867223fc568/app/src/main/assets/hack.ttf -------------------------------------------------------------------------------- /app/src/main/assets/playfair.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hbb20/CountryCodePickerProject/7a76d92a460df02f33b0d1ea5262c867223fc568/app/src/main/assets/playfair.ttf -------------------------------------------------------------------------------- /app/src/main/assets/raleway.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hbb20/CountryCodePickerProject/7a76d92a460df02f33b0d1ea5262c867223fc568/app/src/main/assets/raleway.ttf -------------------------------------------------------------------------------- /app/src/main/assets/titillium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hbb20/CountryCodePickerProject/7a76d92a460df02f33b0d1ea5262c867223fc568/app/src/main/assets/titillium.ttf -------------------------------------------------------------------------------- /app/src/main/java/in/hbb20/countrycodepickerproject/CCPCustomTalkBackProvider.java: -------------------------------------------------------------------------------- 1 | package in.hbb20.countrycodepickerproject; 2 | 3 | import com.hbb20.CCPCountry; 4 | import com.hbb20.CCPTalkBackTextProvider; 5 | 6 | class CCPCustomTalkBackProvider implements CCPTalkBackTextProvider { 7 | @Override 8 | public String getTalkBackTextForCountry(CCPCountry country) { 9 | if (country != null) { 10 | return "Country code is +" + country.getPhoneCode(); 11 | } else { 12 | return null; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/in/hbb20/countrycodepickerproject/CountryPreferenceFragment.kt: -------------------------------------------------------------------------------- 1 | package `in`.hbb20.countrycodepickerproject 2 | 3 | import android.os.Bundle 4 | import android.text.Editable 5 | import android.text.TextWatcher 6 | import android.view.LayoutInflater 7 | import android.view.View 8 | import android.view.ViewGroup 9 | import android.widget.Button 10 | import android.widget.EditText 11 | import android.widget.Toast 12 | 13 | import androidx.fragment.app.Fragment 14 | 15 | import com.hbb20.CountryCodePicker 16 | 17 | /** 18 | * A simple [Fragment] subclass. 19 | * create an instance of this fragment. 20 | */ 21 | class CountryPreferenceFragment: Fragment() { 22 | 23 | private lateinit var editTextCountryPreference: EditText 24 | private lateinit var buttonSetCountryPreference: Button 25 | private lateinit var ccp: CountryCodePicker 26 | private lateinit var buttonNext: Button 27 | 28 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 29 | // Inflate the layout for this fragment 30 | return inflater.inflate(R.layout.fragment_country_preference, container, false) 31 | } 32 | 33 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 34 | super.onViewCreated(view, savedInstanceState) 35 | 36 | assignViews() 37 | editTextWatcher() 38 | addClickListeners() 39 | } 40 | 41 | private fun addClickListeners() { 42 | buttonSetCountryPreference.setOnClickListener { 43 | try { 44 | val countryPreference = editTextCountryPreference.text.toString() 45 | ccp.setCountryPreference(countryPreference) 46 | 47 | Toast.makeText(activity, "Country preference list has been changed, click on CCP to see them at top of list.", Toast.LENGTH_LONG).show() 48 | } catch (ex: Exception) { 49 | } 50 | } 51 | 52 | buttonNext.setOnClickListener { (activity as ExampleActivity).viewPager.currentItem = (activity as ExampleActivity).viewPager.currentItem + 1 } 53 | } 54 | 55 | private fun editTextWatcher() { 56 | editTextCountryPreference.addTextChangedListener(object: TextWatcher { 57 | override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) { 58 | } 59 | 60 | override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { 61 | buttonSetCountryPreference.text = "set '$s' as Country preference." 62 | } 63 | 64 | override fun afterTextChanged(s: Editable) { 65 | } 66 | }) 67 | } 68 | 69 | private fun assignViews() { 70 | editTextCountryPreference = view!!.findViewById(R.id.editText_countryPreference) 71 | ccp = view!!.findViewById(R.id.ccp) 72 | buttonSetCountryPreference = view!!.findViewById(R.id.button_setCountryPreference) 73 | 74 | 75 | buttonNext = view!!.findViewById(R.id.button_next) 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /app/src/main/java/in/hbb20/countrycodepickerproject/CustomColorFragment.kt: -------------------------------------------------------------------------------- 1 | package `in`.hbb20.countrycodepickerproject 2 | 3 | import android.graphics.PorterDuff 4 | import android.os.Bundle 5 | import android.view.LayoutInflater 6 | import android.view.View 7 | import android.view.ViewGroup 8 | import android.widget.Button 9 | import android.widget.EditText 10 | import android.widget.RelativeLayout 11 | import android.widget.TextView 12 | import androidx.core.content.ContextCompat.getColor 13 | import androidx.fragment.app.Fragment 14 | import com.hbb20.CountryCodePicker 15 | 16 | /** 17 | * A simple [Fragment] subclass. 18 | */ 19 | class CustomColorFragment: Fragment() { 20 | 21 | private lateinit var buttonNext: Button 22 | private lateinit var textViewTitle: TextView 23 | private lateinit var editTextPhone: EditText 24 | private lateinit var ccp: CountryCodePicker 25 | private lateinit var relativeColor1: RelativeLayout 26 | private lateinit var relativeColor2: RelativeLayout 27 | private lateinit var relativeColor3: RelativeLayout 28 | private var selectedColor = -1 29 | 30 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 31 | // Inflate the layout for this fragment 32 | return inflater.inflate(R.layout.fragment_custom_color, container, false) 33 | } 34 | 35 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 36 | super.onViewCreated(view, savedInstanceState) 37 | 38 | assignViews() 39 | setClickListener() 40 | } 41 | 42 | private fun setClickListener() { 43 | relativeColor1.setOnClickListener { setColor(1, getColor(context!!, R.color.color1)) } 44 | 45 | relativeColor2.setOnClickListener { setColor(2, getColor(context!!, R.color.color2)) } 46 | 47 | relativeColor3.setOnClickListener { setColor(3, getColor(context!!, R.color.color3)) } 48 | 49 | buttonNext.setOnClickListener { (activity as ExampleActivity).viewPager.currentItem = (activity as ExampleActivity).viewPager.currentItem + 1 } 50 | 51 | ccp.setOnClickListener { 52 | ccp.launchCountrySelectionDialog() 53 | if (selectedColor != -1) { 54 | ccp.contentColor = selectedColor 55 | } 56 | } 57 | } 58 | 59 | private fun setColor(selection: Int, color: Int) { 60 | ccp.contentColor = color 61 | //textView 62 | textViewTitle.setTextColor(color) 63 | 64 | //editText 65 | editTextPhone.setTextColor(color) 66 | editTextPhone.setHintTextColor(color) 67 | editTextPhone.background.setColorFilter(color, PorterDuff.Mode.SRC_ATOP) 68 | 69 | //remove selected bg 70 | resetBG() 71 | 72 | //set selected bg 73 | val selectedBGColor = getColor(context!!, R.color.selectedTile) 74 | when (selection) { 75 | 1 -> relativeColor1.setBackgroundColor(selectedBGColor) 76 | 2 -> relativeColor2.setBackgroundColor(selectedBGColor) 77 | 3 -> relativeColor3.setBackgroundColor(selectedBGColor) 78 | } 79 | 80 | } 81 | 82 | private fun resetBG() { 83 | relativeColor1.setBackgroundColor(getColor(context!!, R.color.dullBG)) 84 | relativeColor2.setBackgroundColor(getColor(context!!, R.color.dullBG)) 85 | relativeColor3.setBackgroundColor(getColor(context!!, R.color.dullBG)) 86 | } 87 | 88 | private fun assignViews() { 89 | textViewTitle = view!!.findViewById(R.id.textView_title) 90 | editTextPhone = view!!.findViewById(R.id.editText_phone) 91 | ccp = view!!.findViewById(R.id.ccp) 92 | relativeColor1 = view!!.findViewById(R.id.relative_color1) 93 | relativeColor2 = view!!.findViewById(R.id.relative_color2) 94 | relativeColor3 = view!!.findViewById(R.id.relative_color3) 95 | buttonNext = view!!.findViewById(R.id.button_next) 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /app/src/main/java/in/hbb20/countrycodepickerproject/CustomFontFragment.kt: -------------------------------------------------------------------------------- 1 | package `in`.hbb20.countrycodepickerproject 2 | 3 | import android.graphics.Typeface 4 | import android.os.Bundle 5 | import android.view.LayoutInflater 6 | import android.view.View 7 | import android.view.ViewGroup 8 | import android.widget.Button 9 | import androidx.fragment.app.Fragment 10 | import com.hbb20.CountryCodePicker 11 | 12 | /** 13 | * A simple [Fragment] subclass. 14 | */ 15 | class CustomFontFragment: Fragment() { 16 | 17 | private lateinit var buttonNext: Button 18 | private lateinit var rootView: View 19 | private lateinit var ccp6: CountryCodePicker 20 | private lateinit var ccp5: CountryCodePicker 21 | private lateinit var ccp4: CountryCodePicker 22 | private lateinit var ccp3: CountryCodePicker 23 | private lateinit var ccp2: CountryCodePicker 24 | private lateinit var ccp1: CountryCodePicker 25 | 26 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 27 | rootView = inflater.inflate(R.layout.fragment_custom_font, container, false) 28 | return rootView 29 | } 30 | 31 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 32 | super.onViewCreated(view, savedInstanceState) 33 | 34 | assignViews() 35 | applyCustomFonts() 36 | setClickListener() 37 | } 38 | 39 | private fun applyCustomFonts() { 40 | setTTFfont(ccp2, "bookos.ttf") 41 | setTTFfont(ccp3, "hack.ttf") 42 | setTTFfont(ccp4, "playfair.ttf") 43 | setTTFfont(ccp5, "raleway.ttf") 44 | setTTFfont(ccp6, "titillium.ttf") 45 | } 46 | 47 | private fun setTTFfont(ccp: CountryCodePicker, fontFileName: String) { 48 | val typeFace = Typeface.createFromAsset(context!!.assets, fontFileName) 49 | ccp.setTypeFace(typeFace) 50 | } 51 | 52 | private fun setClickListener() { 53 | 54 | buttonNext.setOnClickListener { (activity as ExampleActivity).viewPager.currentItem = (activity as ExampleActivity).viewPager.currentItem + 1 } 55 | } 56 | 57 | private fun assignViews() { 58 | ccp1 = rootView.findViewById(R.id.ccp1) 59 | ccp2 = rootView.findViewById(R.id.ccp2) 60 | ccp3 = rootView.findViewById(R.id.ccp3) 61 | ccp4 = rootView.findViewById(R.id.ccp4) 62 | ccp5 = rootView.findViewById(R.id.ccp5) 63 | ccp6 = rootView.findViewById(R.id.ccp6) 64 | buttonNext = view!!.findViewById(R.id.button_next) 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/in/hbb20/countrycodepickerproject/CustomMasterFragment.kt: -------------------------------------------------------------------------------- 1 | package `in`.hbb20.countrycodepickerproject 2 | 3 | import android.os.Bundle 4 | import android.text.Editable 5 | import android.text.TextWatcher 6 | import android.view.LayoutInflater 7 | import android.view.View 8 | import android.view.ViewGroup 9 | import android.widget.Button 10 | import android.widget.EditText 11 | import android.widget.Toast 12 | import androidx.fragment.app.Fragment 13 | import com.hbb20.CountryCodePicker 14 | 15 | /** 16 | * A simple [Fragment] subclass. 17 | * create an instance of this fragment. 18 | */ 19 | class CustomMasterFragment: Fragment() { 20 | 21 | private lateinit var editTextCountryCustomMaster: EditText 22 | private lateinit var buttonSetCustomMaster: Button 23 | private lateinit var ccp: CountryCodePicker 24 | private lateinit var buttonNext: Button 25 | 26 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 27 | // Inflate the layout for this fragment 28 | return inflater.inflate(R.layout.fragment_custom_master_list, container, false) 29 | } 30 | 31 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 32 | super.onViewCreated(view, savedInstanceState) 33 | 34 | assignViews() 35 | editTextWatcher() 36 | addClickListeners() 37 | } 38 | 39 | private fun addClickListeners() { 40 | buttonSetCustomMaster.setOnClickListener { 41 | val customMasterCountries: String 42 | try { 43 | customMasterCountries = editTextCountryCustomMaster.text.toString() 44 | ccp.setCustomMasterCountries(customMasterCountries) 45 | Toast.makeText(activity, "Master list has been changed. Tap on ccp to see the changes.", Toast.LENGTH_LONG).show() 46 | } catch (ex: Exception) { 47 | } 48 | } 49 | 50 | buttonNext.setOnClickListener { (activity as ExampleActivity).viewPager.currentItem = (activity as ExampleActivity).viewPager.currentItem + 1 } 51 | } 52 | 53 | private fun editTextWatcher() { 54 | editTextCountryCustomMaster.addTextChangedListener(object: TextWatcher { 55 | override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) { 56 | } 57 | 58 | override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { 59 | buttonSetCustomMaster.text = "set '$s' as Custom Master List." 60 | } 61 | 62 | override fun afterTextChanged(s: Editable) { 63 | } 64 | }) 65 | } 66 | 67 | private fun assignViews() { 68 | editTextCountryCustomMaster = view!!.findViewById(R.id.editText_countryPreference) 69 | ccp = view!!.findViewById(R.id.ccp) 70 | buttonSetCustomMaster = view!!.findViewById(R.id.button_setCustomMaster) 71 | 72 | buttonNext = view!!.findViewById(R.id.button_next) 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /app/src/main/java/in/hbb20/countrycodepickerproject/CustomSizeFragment.kt: -------------------------------------------------------------------------------- 1 | package `in`.hbb20.countrycodepickerproject 2 | 3 | import android.os.Bundle 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import android.widget.Button 8 | import androidx.fragment.app.Fragment 9 | 10 | /** 11 | * A simple [Fragment] subclass. 12 | */ 13 | class CustomSizeFragment: Fragment() { 14 | 15 | private lateinit var buttonNext: Button 16 | 17 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 18 | // Inflate the layout for this fragment 19 | return inflater.inflate(R.layout.fragment_custom_size, container, false) 20 | } 21 | 22 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 23 | super.onViewCreated(view, savedInstanceState) 24 | 25 | buttonNext = getView()!!.findViewById(R.id.button_next) 26 | buttonNext.setOnClickListener { (activity as ExampleActivity).viewPager.currentItem = (activity as ExampleActivity).viewPager.currentItem + 1 } 27 | } 28 | } -------------------------------------------------------------------------------- /app/src/main/java/in/hbb20/countrycodepickerproject/DefaultCountryFragment.kt: -------------------------------------------------------------------------------- 1 | package `in`.hbb20.countrycodepickerproject 2 | 3 | import android.os.Bundle 4 | import android.text.Editable 5 | import android.text.TextWatcher 6 | import android.view.LayoutInflater 7 | import android.view.View 8 | import android.view.ViewGroup 9 | import android.widget.Button 10 | import android.widget.EditText 11 | import android.widget.Toast 12 | import androidx.fragment.app.Fragment 13 | import com.hbb20.CountryCodePicker 14 | 15 | /** 16 | * A simple [Fragment] subclass. 17 | */ 18 | class DefaultCountryFragment: Fragment() { 19 | 20 | private lateinit var editTextDefaultPhoneCode: EditText 21 | private lateinit var editTextDefaultNameCode: EditText 22 | private lateinit var buttonSetNewDefaultPhoneCode: Button 23 | private lateinit var buttonSetNewDefaultNameCode: Button 24 | private lateinit var buttonResetToDefault: Button 25 | private lateinit var ccp: CountryCodePicker 26 | private lateinit var buttonNext: Button 27 | 28 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 29 | // Inflate the layout for this fragment 30 | return inflater.inflate(R.layout.fragment_default_country, container, false) 31 | } 32 | 33 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 34 | super.onViewCreated(view, savedInstanceState) 35 | 36 | assignViews() 37 | editTextWatcher() 38 | addClickListeners() 39 | } 40 | 41 | private fun addClickListeners() { 42 | buttonSetNewDefaultPhoneCode.setOnClickListener { 43 | try { 44 | val code = Integer.parseInt(editTextDefaultPhoneCode.text.toString()) 45 | @Suppress("DEPRECATION") 46 | ccp.setDefaultCountryUsingPhoneCode(code) 47 | Toast.makeText(activity, "Now default country is " + ccp.defaultCountryName + " with phone code " + ccp.defaultCountryCode, Toast.LENGTH_LONG).show() 48 | } catch (ex: Exception) { 49 | Toast.makeText(activity, "Invalid number format", Toast.LENGTH_LONG).show() 50 | } 51 | } 52 | 53 | buttonSetNewDefaultNameCode.setOnClickListener { 54 | val nameCode: String 55 | try { 56 | nameCode = editTextDefaultNameCode.text.toString() 57 | ccp.setDefaultCountryUsingNameCode(nameCode) 58 | Toast.makeText(activity, "Now default country is " + ccp.defaultCountryName + " with phone code " + ccp.defaultCountryCode, Toast.LENGTH_LONG).show() 59 | } catch (ex: Exception) { 60 | 61 | } 62 | } 63 | 64 | buttonResetToDefault.setOnClickListener { ccp.resetToDefaultCountry() } 65 | 66 | buttonNext.setOnClickListener { (activity as ExampleActivity).viewPager.currentItem = (activity as ExampleActivity).viewPager.currentItem + 1 } 67 | } 68 | 69 | private fun editTextWatcher() { 70 | editTextDefaultPhoneCode.addTextChangedListener(object: TextWatcher { 71 | override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) { 72 | } 73 | 74 | override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { 75 | buttonSetNewDefaultPhoneCode.text = "set $s as Default Country Code" 76 | } 77 | 78 | override fun afterTextChanged(s: Editable) { 79 | } 80 | }) 81 | 82 | editTextDefaultNameCode.addTextChangedListener(object: TextWatcher { 83 | override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) { 84 | } 85 | 86 | override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { 87 | buttonSetNewDefaultNameCode.text = "set '$s' as Default Country Name Code" 88 | } 89 | 90 | override fun afterTextChanged(s: Editable) { 91 | } 92 | }) 93 | } 94 | 95 | private fun assignViews() { 96 | editTextDefaultPhoneCode = view!!.findViewById(R.id.editText_defaultCode) 97 | ccp = view!!.findViewById(R.id.ccp) 98 | buttonSetNewDefaultPhoneCode = view!!.findViewById(R.id.button_setDefaultCode) 99 | buttonResetToDefault = view!!.findViewById(R.id.button_resetToDefault) 100 | 101 | editTextDefaultNameCode = view!!.findViewById(R.id.editText_defaultNameCode) 102 | buttonSetNewDefaultNameCode = view!!.findViewById(R.id.button_setDefaultNameCode) 103 | 104 | buttonNext = view!!.findViewById(R.id.button_next) 105 | } 106 | } -------------------------------------------------------------------------------- /app/src/main/java/in/hbb20/countrycodepickerproject/ExampleActivity.kt: -------------------------------------------------------------------------------- 1 | package `in`.hbb20.countrycodepickerproject 2 | 3 | import android.os.Bundle 4 | import androidx.appcompat.app.AppCompatActivity 5 | import androidx.fragment.app.Fragment 6 | import androidx.fragment.app.FragmentManager 7 | import androidx.fragment.app.FragmentPagerAdapter 8 | import androidx.viewpager.widget.ViewPager 9 | 10 | const val EXTRA_INIT_TAB = "extraInitTab" 11 | 12 | class ExampleActivity: AppCompatActivity() { 13 | 14 | internal lateinit var viewPager: ViewPager 15 | private var pagerAdapter: PagerAdapter? = null 16 | private var init = 0 17 | private var initLoaded = false 18 | 19 | override fun onCreate(savedInstanceState: Bundle?) { 20 | super.onCreate(savedInstanceState) 21 | setContentView(R.layout.activity_example) 22 | 23 | init = intent.getIntExtra(EXTRA_INIT_TAB, 0) 24 | assignViews() 25 | setUpViewPager() 26 | } 27 | 28 | /** 29 | * Assign adapter to viewPager 30 | */ 31 | private fun setUpViewPager() { 32 | if (pagerAdapter == null) { 33 | pagerAdapter = PagerAdapter(supportFragmentManager) 34 | } 35 | viewPager.adapter = pagerAdapter 36 | if (!initLoaded) { 37 | viewPager.currentItem = init 38 | initLoaded = true 39 | } 40 | } 41 | 42 | /** 43 | * assign views to object from layout 44 | */ 45 | private fun assignViews() { 46 | viewPager = findViewById(R.id.viewPager) 47 | } 48 | 49 | private inner class PagerAdapter(fm: FragmentManager): FragmentPagerAdapter(fm) { 50 | private val fragments = listOf( 51 | { IntroductionFragment() }, 52 | { DefaultCountryFragment() }, 53 | { CountryPreferenceFragment() }, 54 | { CustomMasterFragment() }, 55 | { SetCountryFragment() }, 56 | { GetCountryFragment() }, 57 | { FullNumberFragment() }, 58 | { CustomColorFragment() }, 59 | { CustomSizeFragment() }, 60 | { CustomFontFragment() }, 61 | { LanguageSupportFragment() } 62 | ) 63 | 64 | override fun getItem(position: Int): Fragment { 65 | return fragments[position]() 66 | } 67 | 68 | override fun getCount(): Int { 69 | return fragments.size 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/java/in/hbb20/countrycodepickerproject/FullNumberFragment.kt: -------------------------------------------------------------------------------- 1 | package `in`.hbb20.countrycodepickerproject 2 | 3 | import android.os.Bundle 4 | import android.text.Editable 5 | import android.text.TextWatcher 6 | import android.view.LayoutInflater 7 | import android.view.View 8 | import android.view.ViewGroup 9 | import android.widget.Button 10 | import android.widget.EditText 11 | import android.widget.ImageView 12 | import android.widget.TextView 13 | import androidx.core.content.ContextCompat.getDrawable 14 | import androidx.fragment.app.Fragment 15 | import com.hbb20.CountryCodePicker 16 | 17 | /** 18 | * A simple [Fragment] subclass. 19 | */ 20 | class FullNumberFragment: Fragment() { 21 | 22 | private lateinit var editTextLoadFullNumber: EditText 23 | private lateinit var editTextLoadCarrierNumber: EditText 24 | private lateinit var editTextGetCarrierNumber: EditText 25 | private lateinit var editTextGetFullNumber: TextView 26 | private lateinit var ccpLoadNumber: CountryCodePicker 27 | private lateinit var ccpGetNumber: CountryCodePicker 28 | private lateinit var tvValidity: TextView 29 | private lateinit var imgValidity: ImageView 30 | private lateinit var buttonLoadNumber: Button 31 | private lateinit var buttonGetNumber: Button 32 | private lateinit var buttonGetNumberWithPlus: Button 33 | private lateinit var buttonFormattedFullNumber: Button 34 | private lateinit var buttonNext: Button 35 | 36 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 37 | // Inflate the layout for this fragment 38 | return inflater.inflate(R.layout.fragment_full_number, container, false) 39 | } 40 | 41 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 42 | super.onViewCreated(view, savedInstanceState) 43 | 44 | assignView() 45 | registerCarrierEditText() 46 | setClickListener() 47 | addTextWatcher() 48 | } 49 | 50 | private fun addTextWatcher() { 51 | editTextLoadFullNumber.addTextChangedListener(object: TextWatcher { 52 | override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) { 53 | } 54 | 55 | override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { 56 | buttonLoadNumber.text = "Load $s to CCP." 57 | } 58 | 59 | override fun afterTextChanged(s: Editable) { 60 | } 61 | }) 62 | } 63 | 64 | private fun setClickListener() { 65 | buttonLoadNumber.setOnClickListener { ccpLoadNumber.fullNumber = editTextLoadFullNumber.text.toString() } 66 | 67 | buttonFormattedFullNumber.setOnClickListener { editTextGetFullNumber.text = ccpGetNumber.formattedFullNumber } 68 | 69 | buttonGetNumber.setOnClickListener { editTextGetFullNumber.text = ccpGetNumber.fullNumber } 70 | 71 | buttonGetNumberWithPlus.setOnClickListener { editTextGetFullNumber.text = ccpGetNumber.fullNumberWithPlus } 72 | 73 | buttonNext.setOnClickListener { (activity as ExampleActivity).viewPager.currentItem = (activity as ExampleActivity).viewPager.currentItem + 1 } 74 | } 75 | 76 | private fun registerCarrierEditText() { 77 | ccpLoadNumber.registerCarrierNumberEditText(editTextLoadCarrierNumber) 78 | ccpGetNumber.registerCarrierNumberEditText(editTextGetCarrierNumber) 79 | ccpGetNumber.setPhoneNumberValidityChangeListener { isValidNumber -> 80 | if (isValidNumber) { 81 | imgValidity.setImageDrawable(getDrawable(context!!, R.drawable.ic_assignment_turned_in_black_24dp)) 82 | tvValidity.text = "Valid Number" 83 | } else { 84 | imgValidity.setImageDrawable(getDrawable(context!!, R.drawable.ic_assignment_late_black_24dp)) 85 | tvValidity.text = "Invalid Number" 86 | } 87 | } 88 | 89 | ccpLoadNumber.registerCarrierNumberEditText(editTextLoadCarrierNumber) 90 | } 91 | 92 | private fun assignView() { 93 | //load number 94 | editTextLoadFullNumber = view!!.findViewById(R.id.editText_loadFullNumber) 95 | editTextLoadCarrierNumber = view!!.findViewById(R.id.editText_loadCarrierNumber) 96 | ccpLoadNumber = view!!.findViewById(R.id.ccp_loadFullNumber) 97 | buttonLoadNumber = view!!.findViewById(R.id.button_loadFullNumber) 98 | 99 | //get number 100 | editTextGetCarrierNumber = view!!.findViewById(R.id.editText_getCarrierNumber) 101 | editTextGetFullNumber = view!!.findViewById(R.id.textView_getFullNumber) 102 | buttonGetNumber = view!!.findViewById(R.id.button_getFullNumber) 103 | buttonGetNumberWithPlus = view!!.findViewById(R.id.button_getFullNumberWithPlus) 104 | ccpGetNumber = view!!.findViewById(R.id.ccp_getFullNumber) 105 | buttonFormattedFullNumber = view!!.findViewById(R.id.button_getFormattedFullNumberWithPlus) 106 | tvValidity = view!!.findViewById(R.id.tv_validity) 107 | imgValidity = view!!.findViewById(R.id.img_validity) 108 | 109 | buttonNext = view!!.findViewById(R.id.button_next) 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /app/src/main/java/in/hbb20/countrycodepickerproject/GetCountryFragment.kt: -------------------------------------------------------------------------------- 1 | package `in`.hbb20.countrycodepickerproject 2 | 3 | import android.os.Bundle 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import android.widget.Button 8 | import android.widget.TextView 9 | import androidx.fragment.app.Fragment 10 | import com.hbb20.CountryCodePicker 11 | 12 | /** 13 | * A simple [Fragment] subclass. 14 | */ 15 | class GetCountryFragment: Fragment() { 16 | 17 | private lateinit var textViewCountryName: TextView 18 | private lateinit var textViewCountryCode: TextView 19 | private lateinit var textViewCountryNameCode: TextView 20 | private lateinit var buttonReadCountry: Button 21 | private lateinit var ccp: CountryCodePicker 22 | private lateinit var buttonNext: Button 23 | 24 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 25 | // Inflate the layout for this fragment 26 | return inflater.inflate(R.layout.fragment_get_country, container, false) 27 | } 28 | 29 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 30 | super.onViewCreated(view, savedInstanceState) 31 | 32 | assignViews() 33 | setClickListener() 34 | } 35 | 36 | private fun setClickListener() { 37 | buttonReadCountry.setOnClickListener { 38 | textViewCountryName.text = ccp.selectedCountryName 39 | textViewCountryCode.text = ccp.selectedCountryCode 40 | textViewCountryNameCode.text = ccp.selectedCountryNameCode 41 | } 42 | 43 | buttonNext.setOnClickListener { (activity as ExampleActivity).viewPager.currentItem = (activity as ExampleActivity).viewPager.currentItem + 1 } 44 | } 45 | 46 | private fun assignViews() { 47 | ccp = view!!.findViewById(R.id.ccp) 48 | textViewCountryCode = view!!.findViewById(R.id.textView_countryCode) 49 | textViewCountryName = view!!.findViewById(R.id.textView_countryName) 50 | textViewCountryNameCode = view!!.findViewById(R.id.textView_countryNameCode) 51 | buttonReadCountry = view!!.findViewById(R.id.button_readCountry) 52 | buttonNext = view!!.findViewById(R.id.button_next) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/in/hbb20/countrycodepickerproject/HomeActivity.kt: -------------------------------------------------------------------------------- 1 | package `in`.hbb20.countrycodepickerproject 2 | 3 | import android.content.Intent 4 | import android.os.Bundle 5 | import android.util.Log 6 | import android.widget.Button 7 | import android.widget.TextView 8 | import androidx.appcompat.app.AppCompatActivity 9 | import java.util.* 10 | 11 | class HomeActivity: AppCompatActivity() { 12 | 13 | private lateinit var textIntro: TextView 14 | private lateinit var textDefaultCountry: TextView 15 | private lateinit var textPreference: TextView 16 | private lateinit var textCustomMaster: TextView 17 | private lateinit var textSetCountry: TextView 18 | private lateinit var textGetCountry: TextView 19 | private lateinit var textFullNumber: TextView 20 | private lateinit var textCustomColor: TextView 21 | private lateinit var textCustomSize: TextView 22 | private lateinit var textCustomFont: TextView 23 | private lateinit var textCustomLanguage: TextView 24 | private lateinit var startDemo: Button 25 | 26 | override fun onCreate(savedInstanceState: Bundle?) { 27 | super.onCreate(savedInstanceState) 28 | setContentView(R.layout.activity_home) 29 | 30 | assignViews() 31 | printCountries() 32 | } 33 | 34 | private fun printCountries() { 35 | val list = Locale.getISOCountries() // Fetch list of ISO 3166 country codes 36 | for (i in list.indices) { 37 | list[i] = Locale("es", list[i]).displayName 38 | Log.d("Country Name", "printCountries: " + list[i]) 39 | } 40 | // 41 | // .map { 42 | // // Create a new Locale in users default language, but set country to X 43 | // it to Locale("bn", it).displayCountry // then extract the localized name of the country. 44 | // } 45 | // .toMap() // Turn into Map with ISO 3166 key and Localised country name as value 46 | // 47 | // print(list) 48 | } 49 | 50 | private fun assignViews() { 51 | textIntro = findViewById(R.id.textIntro) 52 | setClick(textIntro, 0) 53 | 54 | textDefaultCountry = findViewById(R.id.textDefaultCountry) 55 | setClick(textDefaultCountry, 1) 56 | 57 | textPreference = findViewById(R.id.textCountryPreference) 58 | setClick(textPreference, 2) 59 | 60 | textCustomMaster = findViewById(R.id.textCustomMaster) 61 | setClick(textCustomMaster, 3) 62 | 63 | textSetCountry = findViewById(R.id.textSetCountry) 64 | setClick(textSetCountry, 4) 65 | 66 | textGetCountry = findViewById(R.id.textGetCountry) 67 | setClick(textGetCountry, 5) 68 | 69 | textFullNumber = findViewById(R.id.textFullNumber) 70 | setClick(textFullNumber, 6) 71 | 72 | textCustomColor = findViewById(R.id.textCustomColor) 73 | setClick(textCustomColor, 7) 74 | 75 | textCustomSize = findViewById(R.id.textCustomSize) 76 | setClick(textCustomSize, 8) 77 | 78 | textCustomFont = findViewById(R.id.textCustomFont) 79 | setClick(textCustomFont, 9) 80 | 81 | textCustomLanguage = findViewById(R.id.textCustomLanguage) 82 | setClick(textCustomLanguage, 10) 83 | 84 | startDemo = findViewById(R.id.buttonGo) 85 | startDemo.setOnClickListener { 86 | val i = Intent(baseContext, ExampleActivity::class.java) 87 | i.putExtra(EXTRA_INIT_TAB, 0) 88 | startActivity(i) 89 | } 90 | } 91 | 92 | private fun setClick(text: TextView, tabIndex: Int) { 93 | text.setOnClickListener { 94 | val i = Intent(baseContext, ExampleActivity::class.java) 95 | i.putExtra(EXTRA_INIT_TAB, tabIndex) 96 | startActivity(i) 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /app/src/main/java/in/hbb20/countrycodepickerproject/IntroductionFragment.kt: -------------------------------------------------------------------------------- 1 | package `in`.hbb20.countrycodepickerproject 2 | 3 | import android.os.Bundle 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import android.widget.Button 8 | import android.widget.EditText 9 | 10 | import androidx.fragment.app.Fragment 11 | 12 | import com.hbb20.CountryCodePicker 13 | 14 | /** 15 | * A simple [Fragment] subclass. 16 | */ 17 | class IntroductionFragment: Fragment() { 18 | 19 | 20 | private lateinit var buttonGo: Button 21 | private lateinit var countryCodePicker: CountryCodePicker 22 | private lateinit var etPhone: EditText 23 | 24 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 25 | // Inflate the layout for this fragment 26 | return inflater.inflate(R.layout.fragment_introduction, container, false) 27 | } 28 | 29 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 30 | super.onViewCreated(view, savedInstanceState) 31 | assignViews() 32 | setClickListener() 33 | setCustomTalkBackProvider() 34 | } 35 | 36 | private fun assignViews() { 37 | buttonGo = view!!.findViewById(R.id.button_letsGo) 38 | etPhone = view!!.findViewById(R.id.et_phone) 39 | countryCodePicker = view!!.findViewById(R.id.ccp) 40 | countryCodePicker.registerCarrierNumberEditText(etPhone) 41 | } 42 | 43 | private fun setClickListener() { 44 | buttonGo.setOnClickListener { (activity as ExampleActivity).viewPager.currentItem = 1 } 45 | } 46 | 47 | private fun setCustomTalkBackProvider() { 48 | countryCodePicker.setTalkBackTextProvider(CCPCustomTalkBackProvider()) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/in/hbb20/countrycodepickerproject/LanguageSupportFragment.kt: -------------------------------------------------------------------------------- 1 | package `in`.hbb20.countrycodepickerproject 2 | 3 | import android.os.Bundle 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import android.widget.Button 8 | import android.widget.RadioButton 9 | import android.widget.RadioGroup 10 | import android.widget.Toast 11 | import androidx.fragment.app.Fragment 12 | import com.hbb20.CountryCodePicker 13 | import com.hbb20.CountryCodePicker.Language.* 14 | 15 | /** 16 | * A simple [Fragment] subclass. 17 | */ 18 | class LanguageSupportFragment: Fragment() { 19 | 20 | private lateinit var radioGroup: RadioGroup 21 | private lateinit var radioEnglish: RadioButton 22 | private lateinit var radioJapanese: RadioButton 23 | private lateinit var radioSpanish: RadioButton 24 | private lateinit var ccp: CountryCodePicker 25 | private lateinit var buttonNext: Button 26 | private lateinit var rootView: View 27 | 28 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 29 | rootView = inflater.inflate(R.layout.fragment_language_support, container, false) 30 | return rootView 31 | } 32 | 33 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 34 | super.onViewCreated(view, savedInstanceState) 35 | 36 | assignViews() 37 | setClickListener() 38 | } 39 | 40 | private fun setClickListener() { 41 | radioGroup.setOnCheckedChangeListener { _, checkedId -> 42 | when (checkedId) { 43 | R.id.radioEnglish -> { 44 | ccp.changeDefaultLanguage(ENGLISH) 45 | Toast.makeText(context, "Language is updated to ENGLISH", Toast.LENGTH_SHORT).show() 46 | } 47 | R.id.radioJapanese -> { 48 | ccp.changeDefaultLanguage(JAPANESE) 49 | Toast.makeText(context, "Language is updated to JAPANESE", Toast.LENGTH_SHORT).show() 50 | } 51 | R.id.radioSpanish -> { 52 | ccp.changeDefaultLanguage(SPANISH) 53 | Toast.makeText(context, "Language is updated to SPANISH", Toast.LENGTH_SHORT).show() 54 | } 55 | } 56 | } 57 | 58 | buttonNext.setOnClickListener { (activity as ExampleActivity).viewPager.currentItem = (activity as ExampleActivity).viewPager.currentItem + 1 } 59 | } 60 | 61 | private fun assignViews() { 62 | ccp = rootView.findViewById(R.id.ccp) 63 | radioGroup = rootView.findViewById(R.id.radioGroup) 64 | radioEnglish = rootView.findViewById(R.id.radioEnglish) 65 | radioJapanese = rootView.findViewById(R.id.radioJapanese) 66 | radioSpanish = rootView.findViewById(R.id.radioSpanish) 67 | buttonNext = view!!.findViewById(R.id.button_next) 68 | } 69 | } -------------------------------------------------------------------------------- /app/src/main/java/in/hbb20/countrycodepickerproject/SetCountryFragment.kt: -------------------------------------------------------------------------------- 1 | package `in`.hbb20.countrycodepickerproject 2 | 3 | import android.os.Bundle 4 | import android.text.Editable 5 | import android.text.TextWatcher 6 | import android.view.LayoutInflater 7 | import android.view.View 8 | import android.view.ViewGroup 9 | import android.widget.Button 10 | import android.widget.EditText 11 | import android.widget.Toast 12 | import androidx.fragment.app.Fragment 13 | import com.hbb20.CountryCodePicker 14 | 15 | /** 16 | * A simple [Fragment] subclass. 17 | * create an instance of this fragment. 18 | */ 19 | class SetCountryFragment: Fragment() { 20 | 21 | private lateinit var editTextCode: EditText 22 | private lateinit var editTextNameCode: EditText 23 | private lateinit var buttonSetCode: Button 24 | private lateinit var buttonSetNameCode: Button 25 | private lateinit var ccp: CountryCodePicker 26 | private lateinit var buttonNext: Button 27 | 28 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 29 | // Inflate the layout for this fragment 30 | return inflater.inflate(R.layout.fragment_set_country, container, false) 31 | } 32 | 33 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 34 | super.onViewCreated(view, savedInstanceState) 35 | 36 | assignViews() 37 | editTextWatcher() 38 | addClickListeners() 39 | } 40 | 41 | private fun addClickListeners() { 42 | buttonSetCode.setOnClickListener { 43 | try { 44 | val code = Integer.parseInt(editTextCode.text.toString()) 45 | ccp.setCountryForPhoneCode(code) 46 | } catch (ex: Exception) { 47 | Toast.makeText(activity, "Invalid number format", Toast.LENGTH_LONG).show() 48 | } 49 | } 50 | 51 | buttonSetNameCode.setOnClickListener { 52 | try { 53 | val code = editTextNameCode.text.toString() 54 | ccp.setCountryForNameCode(code) 55 | } catch (ex: Exception) { 56 | } 57 | } 58 | 59 | buttonNext.setOnClickListener { (activity as ExampleActivity).viewPager.currentItem = (activity as ExampleActivity).viewPager.currentItem + 1 } 60 | } 61 | 62 | private fun editTextWatcher() { 63 | editTextCode.addTextChangedListener(object: TextWatcher { 64 | override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) { 65 | } 66 | 67 | override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { 68 | buttonSetCode.text = "Set country with code $s" 69 | } 70 | 71 | override fun afterTextChanged(s: Editable) { 72 | } 73 | }) 74 | 75 | editTextNameCode.addTextChangedListener(object: TextWatcher { 76 | override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) { 77 | } 78 | 79 | override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { 80 | buttonSetNameCode.text = "Set country with name code '$s'" 81 | } 82 | 83 | override fun afterTextChanged(s: Editable) { 84 | } 85 | }) 86 | 87 | ccp.setOnCountryChangeListener { 88 | Toast.makeText(context, "This is from OnCountryChangeListener. \n Country updated to " + ccp.selectedCountryName + "(" + ccp.selectedCountryCodeWithPlus + ")", Toast.LENGTH_SHORT).show() 89 | } 90 | } 91 | 92 | private fun assignViews() { 93 | editTextNameCode = view!!.findViewById(R.id.editText_countryNameCode) 94 | editTextCode = view!!.findViewById(R.id.editText_countryCode) 95 | ccp = view!!.findViewById(R.id.ccp) 96 | buttonSetCode = view!!.findViewById(R.id.button_setCountry) 97 | buttonSetNameCode = view!!.findViewById(R.id.button_setCountryNameCode) 98 | buttonNext = view!!.findViewById(R.id.button_next) 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/card.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 39 | 40 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/gradient.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_assignment_late_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_assignment_turned_in_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_ccp_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hbb20/CountryCodePickerProject/7a76d92a460df02f33b0d1ea5262c867223fc568/app/src/main/res/drawable/ic_ccp_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_done_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hbb20/CountryCodePickerProject/7a76d92a460df02f33b0d1ea5262c867223fc568/app/src/main/res/drawable/img_a.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hbb20/CountryCodePickerProject/7a76d92a460df02f33b0d1ea5262c867223fc568/app/src/main/res/drawable/img_b.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hbb20/CountryCodePickerProject/7a76d92a460df02f33b0d1ea5262c867223fc568/app/src/main/res/drawable/img_c.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hbb20/CountryCodePickerProject/7a76d92a460df02f33b0d1ea5262c867223fc568/app/src/main/res/drawable/img_d.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hbb20/CountryCodePickerProject/7a76d92a460df02f33b0d1ea5262c867223fc568/app/src/main/res/drawable/img_f.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hbb20/CountryCodePickerProject/7a76d92a460df02f33b0d1ea5262c867223fc568/app/src/main/res/drawable/img_g.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hbb20/CountryCodePickerProject/7a76d92a460df02f33b0d1ea5262c867223fc568/app/src/main/res/drawable/img_h.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hbb20/CountryCodePickerProject/7a76d92a460df02f33b0d1ea5262c867223fc568/app/src/main/res/drawable/img_i.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_j.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hbb20/CountryCodePickerProject/7a76d92a460df02f33b0d1ea5262c867223fc568/app/src/main/res/drawable/img_j.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_example.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_home.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 17 | 18 | 25 | 26 | 29 | 30 | 34 | 35 | 38 | 39 | 40 | 43 | 44 | 48 | 49 | 52 | 53 | 54 | 57 | 58 | 62 | 63 | 66 | 67 | 68 | 71 | 72 | 76 | 77 | 80 | 81 | 82 | 85 | 86 | 90 | 91 | 94 | 95 | 96 | 99 | 100 | 104 | 105 | 108 | 109 | 110 | 113 | 114 | 118 | 119 | 122 | 123 | 124 | 127 | 128 | 132 | 133 | 136 | 137 | 138 | 141 | 142 | 146 | 147 | 150 | 151 | 152 | 155 | 156 | 160 | 161 | 164 | 165 | 166 | 169 | 170 | 174 | 175 | 178 | 179 | 180 | 181 | 182 |