agoda-com / Kakao

This repo is no longer supported. Please visit a https://github.com/KakaoCup/Kakao
Apache License 2.0
1.11k stars 102 forks source link

DrawableMatcher getDrawable from resource #261

Closed pavel-vasilev closed 3 years ago

pavel-vasilev commented 3 years ago

Hi, there are multiple methods to get drawable from resId:

Is there any reason why u are using ContextCompat.getDrawable in your library instead of AppCompatResources.getDrawable?

If you not enable vectorDrawables.useSupportLibrary in build.gradle, those two methods return BitmapDrawable, after enabling first return VectorDrawable, and second return VectorDrawableCompat. Some of vectors in my project contain fillType=evenOdd attribute(which is working on api 24 on vector drawable), after upgrading to vector drawable compat app looks the same, but tests that check drawables broke on api 23 (because library use ContextCompat.getDrawable)

Instead of passing resId, i can pass drawable in all tests that use hasDrawable method. But maybe library should use different method for getting drawables by default, what you think?