Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nkuppan committed Mar 24, 2020
1 parent 437b8e4 commit f9052ca
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Country's list with flag image. Can launch this activity to show the list of cou
How to add to your project
--------------

Sample implementation gif file for country selection and using search functionality

<img src="screenshots/country.gif" width="270" height="480"/>

Add repository info in your root project gradle file

```gradle
Expand Down Expand Up @@ -35,25 +39,22 @@ startActivityForResult( Intent(context, CountrySearchActivity::class.java), Requ
You will receive your result once the user is selected the country

```java
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)

if (requestCode == RequestCode.COUNTRY_SEARCH_CODE && resultCode == Activity.RESULT_OK) {

data?.apply {

val country: CountryModel? = getParcelableExtra(RequestParam.SELECTED_VALUE)

if (country != null) {
Snackbar.make(
button,
"Selected Country [ name, code ] [${country.countryName} , ${country.countryCode}]",
Snackbar.LENGTH_SHORT
).show()
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)

if (requestCode == RequestCode.COUNTRY_SEARCH_CODE && resultCode == Activity.RESULT_OK) {
data?.apply {
val country: CountryModel? = getParcelableExtra(RequestParam.SELECTED_VALUE)
if (country != null) {
Snackbar.make(
button,
"Selected Country [ name, code ] [${country.countryName} , ${country.countryCode}]",
Snackbar.LENGTH_SHORT
).show()
}
}
}
}
```


Expand Down

0 comments on commit f9052ca

Please sign in to comment.