I'm doing a project about entering mobile phones with country codes in android studio with kotlin jetpack compose. I think there are about 200 or 250 countries, and of course they have pictures. If I put these pictures in the drawable file, they can be mixed with other image files and a bad code will appear, I think. For this reason, I created a separate drawable file called drawable-country-flags and added the flag images to it, but when I say R.drawable.tr, I cannot access it and there is no other option. Can I access the flag images in this drawable file? if i can access how? Or is there a better way? can i get your suggestions?
I try to access this for example :
data class CountryData(
private var cCodes: String,
val countryPhoneCode: String = "+90",
val cNames:String = "tr",
val flagResID: Int = R.drawable.tr
) {
val countryCode = cCodes.lowercase(Locale.getDefault())
}
No, you can't store your images here. You can only create drawable folders for different configurations (like screen sizes, night-light themes etc).
I think you have 2 options to solve your problem:
drawable
folderbuild.gradle
as a dependency.