Open mdluhosch opened 3 years ago
Can you please try 2.5.0. It seems to be working for 2.5.0 if not can you post the xml and all the java/kotlin code where ccp is used.
Also with 2.5.0 the arrow won't show. XML:
<com.hbb20.CountryCodePicker android:id="@+id/modify_country" android:layout_width="0dp" android:layout_height="wrap_content" android:inputType="text" app:ccp_autoDetectCountry="true" app:ccp_autoDetectLanguage="true" app:ccp_countryPreference="DE,US,GB" app:ccp_defaultLanguage="ENGLISH" app:ccp_defaultNameCode="DE" app:ccp_showArrow="true" app:ccp_showFlag="true" app:ccp_showFullName="true" app:ccp_showNameCode="false" app:ccp_showPhoneCode="false" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/modify_country_lbl" />
In the Code I don't do anything specific just reading and setting the country code:
val code = view?.modify_country?.selectedCountryNameCode ?: ""
And in the onCreateView:
v.modify_country.setCountryForNameCode("DE")
Not showing on 2.5.3
as well.
<com.hbb20.CountryCodePicker
android:id="@+id/country_picker_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
app:ccpDialog_backgroundColor="#888"
app:ccpDialog_searchEditTextTint="#fff"
app:ccpDialog_showTitle="false"
app:ccpDialog_textColor="#fff"
app:ccp_arrowColor="#fff"
app:ccp_arrowSize="30dp"
app:ccp_autoDetectLanguage="true"
app:ccp_contentColor="#fff"
app:ccp_showArrow="true"
app:ccp_showFullName="true"
app:ccp_showNameCode="false"
app:ccp_showPhoneCode="false"
app:ccp_textGravity="LEFT"
app:ccp_textSize="18sp" />
Did you find any solution ?
I finally narrowed it down. I created a new Android app from Android Studio (Basic Activity). Then I added the country code picker to the fragment_first.xml and everything was working with 2.5.0. Then I switched the Activity type inside MainActivity.kt into a FragmentActivity (was AppCompatActivity) which caused the arrow to disappear!
I found out that AppCompatActivity extends the FragmentActivity so I will propaply switch my app to also use the AppCompatActivity. So from my point of view you can close the issue.
Edit: I just checked and also in your Example application it is enough to switch the ExampleActivity.kt from AppCompatActivity to FragmentActivity and all the Arrows disappear.
Version 2.4.0 is the last one where I can see the arrow. For newer Versions I only see white where it should be. I also tried the following:
But the arrow just does not want to show up above 2.4.0.
Also with all of the versions I tested I get a compilation error when I try to set the attribute ccpDialog_backgroundColor.