Closed geronimo69 closed 4 years ago
This method is an extension function. for that you have to use Kotlin
But it is also deprecated, please follow the deprecation message: https://github.com/mikepenz/Android-Iconics/blob/5f0216136bdb55f1feeef0a3861b02703410dd39/library-core/src/main/java/com/mikepenz/iconics/utils/IconicsConverters.kt#L135-L139
I used until now (no kotlin):
implementation 'com.mikepenz:iconics-core:3.1.0@aar'
implementation "com.mikepenz:iconics-views:2.9.5@aar"
Android Studio notify me to update to version 4.02. so I updated to:
implementation 'com.mikepenz:iconics-core:4.0.2@aar'
implementation "com.mikepenz:iconics-views:4.0.2@aar"
But now for next code:
holder.mTraveler.setIcon(isFavorite
? new IconicsDrawable(mContext).icon(GoogleMaterial.Icon.gmd_card_travel).color(Color.WHITE) :
new IconicsDrawable(mContext).icon(GoogleMaterial.Icon.gmd_add_location).color(Color.WHITE));
get next error message:
error: no suitable method found for color(int)
method IconicsDrawable.color(Function0<? extends IconicsColor>) is not applicable (argument mismatch; int cannot be converted to Function0<? extends IconicsColor>)
method IconicsDrawable.color(IconicsColor) is not applicable (argument mismatch; int cannot be converted to IconicsColor)
Any suggestion for me please?
Android Iconics v4 is meant to be used in kotlin projects. If your project is still in java. please stay with 3.x (also never mix versions)
i try to assign a color to icon but can't resolve method toIconicsColor. Can guide me to fix the problem please?