From 1eb33c733eda9312b65ba468d3450b427e5b5d8f Mon Sep 17 00:00:00 2001 From: Arthur Thompson Date: Thu, 24 Feb 2022 10:36:28 -0800 Subject: [PATCH 1/2] fix: Set selected contry spinner fixes #2005 --- .../java/com/firebase/ui/auth/ui/phone/CountryListSpinner.java | 1 + 1 file changed, 1 insertion(+) diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/phone/CountryListSpinner.java b/auth/src/main/java/com/firebase/ui/auth/ui/phone/CountryListSpinner.java index 089a410a2..78ce5053f 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/phone/CountryListSpinner.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/phone/CountryListSpinner.java @@ -86,6 +86,7 @@ public CountryListSpinner(Context context, AttributeSet attrs, int defStyle) { public void onItemClick(AdapterView parent, View view, int position, long id) { CountryInfo info = mCountryListAdapter.getItem(position); if (info != null) { + mSelectedCountryInfo = info; setText(info.toShortString()); } From 2be43126b8fcf32dff760ae534f74654839c41a4 Mon Sep 17 00:00:00 2001 From: Rosalyn Tan Date: Fri, 25 Mar 2022 15:03:30 -0700 Subject: [PATCH 2/2] Use `setSelectedForCountry` helper method. --- .../java/com/firebase/ui/auth/ui/phone/CountryListSpinner.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/phone/CountryListSpinner.java b/auth/src/main/java/com/firebase/ui/auth/ui/phone/CountryListSpinner.java index 78ce5053f..d61504564 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/phone/CountryListSpinner.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/phone/CountryListSpinner.java @@ -86,8 +86,7 @@ public CountryListSpinner(Context context, AttributeSet attrs, int defStyle) { public void onItemClick(AdapterView parent, View view, int position, long id) { CountryInfo info = mCountryListAdapter.getItem(position); if (info != null) { - mSelectedCountryInfo = info; - setText(info.toShortString()); + setSelectedForCountry(info.getCountryCode(), info.getLocale()); } onUnfocus();