Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nkuppan authored May 30, 2023
1 parent 06cca0a commit 9d46711
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ Simple steps to achieve. Call country search activity with result.

Starting country selection as activity based

## XML Way

Calling as an activity:
--------------

Expand Down Expand Up @@ -143,6 +145,35 @@ supportFragmentManager.openCountrySelectionBottomSheet {
}
```

## Compose Way

Calling as a compose dialog:
--------------

Call the dialog inside compose like below. It will open the country selection as dialog with search option. Handle the dialog dismiss on the callback.

```kotlin
import com.github.nkuppan.countrycompose.presentation.country.CountrySelectionDialog

CountrySelectionDialog(onDismissRequest = {/*TODO Close dialog*/}) { country ->
message = "Selected Country ${country.name} & ${country.countryCode}"
}
```

Calling as a compose page:
--------------

Call the page inside compose like below. It will open the country selection as new page with search option. Handle the page backpress on the callback.
You can use this inside the composable using navigation-compose as well.

```kotlin
import com.github.nkuppan.countrycompose.presentation.country.CountrySelectionPage

CountrySelectionPage(onDismissRequest = {/*TODO Close page*/}) { country ->
message = "Selected Country ${country.name} & ${country.countryCode}"
}
```

## License

[Apache Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)
Expand Down

0 comments on commit 9d46711

Please sign in to comment.