Skip to content
This repository has been archived by the owner on Aug 4, 2019. It is now read-only.

Commit

Permalink
Set the default country for the country picker,closed #29
Browse files Browse the repository at this point in the history
  • Loading branch information
TinaT2 committed Jul 30, 2019
1 parent 5da055e commit 6b1322b
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class RegistrationFragment : BaseFragment() {
phoneInputEditTextWatcher()
phoneFormat()
initObserver()
changeCountryImage("ir")
}

private fun initToolbar() {
Expand Down Expand Up @@ -111,7 +112,8 @@ class RegistrationFragment : BaseFragment() {
}

private fun countryPicker() {
val countryPicker = CountryPicker.Builder(requireContext()).setCountrySelectionListener { country ->
val countryPicker = CountryPicker.Builder(requireContext()).setCountrySelectionListener{
country ->

mCountryCode = country.code
mDialCode = country.dialCode
Expand All @@ -130,6 +132,7 @@ class RegistrationFragment : BaseFragment() {
}



private fun changeCountryImage(flagName: String) {
val iconResId = resources.getIdentifier(flagName, "drawable", activity?.packageName)
mCountryFlagImageView.setImageResource(iconResId)
Expand Down
Binary file removed app/src/main/res/drawable-hdpi/iran_flag.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-ldpi/iran_flag.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/iran_flag.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-xhdpi/iran_flag.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-xxhdpi/iran_flag.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-xxxhdpi/iran_flag.png
Binary file not shown.
1 change: 0 additions & 1 deletion app/src/main/res/layout/fragment_registration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
android:layout_marginStart="16dp" android:layout_marginTop="20dp">

<ImageView
android:src="@drawable/iran_flag"
android:layout_width="28dp" android:layout_height="20dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" android:id="@+id/imageButton_registration_flags"
Expand Down

0 comments on commit 6b1322b

Please sign in to comment.