Vadim
12/16/2020, 6:55 PMIcon(vectorResource(R.drawable.ic_accessory_arrow))
where ic_accessory_arrow
is a vector drawable. This code crashes on API 21 with android.content.res.Resources$NotFoundException: File res/drawable-xxhdpi-v4/ic_accessory_arrow.png from xml type xml resource ID #0x7f0800e3
exception. So, what should I do for older SDKs? Write it like that?
// Random number here: I don't even know which API versions implicitly convert vector drawables to png
if (Build.VERSION.SDK_INT > 23) {
Icon(vectorResource(…))
} else {
Icon(imageResource(…))
}
Nader Jawad
12/16/2020, 10:32 PMpainterResource
API that will automatically load an ImagePainter
or a VectorPainter
Nader Jawad
12/16/2020, 10:33 PMVadim
12/16/2020, 10:42 PM