Fixed
Status Update
Comments
al...@google.com <al...@google.com>
wi...@google.com <wi...@google.com>
da...@gmail.com <da...@gmail.com> #2
Trying to reproduce this on my 4.2.2 (v17) Nexus 4. Added this drawable:
<transition xmlns:android="http://schemas.android.com/apk/res/android " >
<item android:drawable="@drawable/test_drawable_blue"/>
<item android:drawable="@drawable/test_drawable_green"/>
</transition>
where blue/green drawables look like this:
<shape
xmlns:android="http://schemas.android.com/apk/res/android "
android:shape="rectangle">
<size
android:width="@dimen/drawable_large_size"
android:height="@dimen/drawable_small_size" />
<solid
android:color="@color/test_blue" />
</shape>
Then added this test:
@Test
public void testMutateTransitionDrawable() {
Drawable drawable = ResourcesCompat.getDrawable(mResources,
R.drawable.test_transition_drawable, null);
assertTrue(drawable instanceof TransitionDrawable);
Drawable mutated = drawable.mutate();
assertTrue(drawable instanceof TransitionDrawable);
assertTrue(mutated instanceof TransitionDrawable);
}
It passes on the device. Going to also try on other earlier devices a bit later in the day once they are charged.
<transition xmlns:android="
<item android:drawable="@drawable/test_drawable_blue"/>
<item android:drawable="@drawable/test_drawable_green"/>
</transition>
where blue/green drawables look like this:
<shape
xmlns:android="
android:shape="rectangle">
<size
android:width="@dimen/drawable_large_size"
android:height="@dimen/drawable_small_size" />
<solid
android:color="@color/test_blue" />
</shape>
Then added this test:
@Test
public void testMutateTransitionDrawable() {
Drawable drawable = ResourcesCompat.getDrawable(mResources,
R.drawable.test_transition_drawable, null);
assertTrue(drawable instanceof TransitionDrawable);
Drawable mutated = drawable.mutate();
assertTrue(drawable instanceof TransitionDrawable);
assertTrue(mutated instanceof TransitionDrawable);
}
It passes on the device. Going to also try on other earlier devices a bit later in the day once they are charged.
ch...@google.com <ch...@google.com>
ap...@google.com <ap...@google.com> #3
Also not reproducible on Galaxy Nexus running 4.0.1 (v14), 4.0.4 (v15) and 4.2.2 (v17)
ch...@google.com <ch...@google.com>
pr...@google.com <pr...@google.com> #4
ch...@beyls.net <ch...@beyls.net> #5
Tell me if I'm wrong but the OS uses the SplashScreen theme to initially load the vector drawable in the zygote process on API 23+, before the Activity is even launched. At that moment, AppCompat can't be used anyway, so the display would still be incorrect on API 23 if the VD is using features like gradients.
Description
Component used:
androidx.core.splashscreen.SplashScreen
Version used: 1.0.0 Devices/Android versions reproduced on: Android 5, Android 6SplashScreen.install
method callsandroid.content.Context.getDrawable
on API 21. It, in turn, callsandroid.graphics.drawable.VectorDrawable.inflate
instead ofVectorDrawableCompat.inflate
.VectorDrawable
does not support some features like gradients, what may lead to a crash (see:VectorDrawable
.Suggestion: At least enable the users of the library to use
VectorDrawableCompat
instead ofVectorDrawable
.