Fixed
Status Update
Comments
ki...@google.com <ki...@google.com>
ja...@google.com <ja...@google.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.
ma...@gmail.com <ma...@gmail.com> #3
Also not reproducible on Galaxy Nexus running 4.0.1 (v14), 4.0.4 (v15) and 4.2.2 (v17)
Description
* Impl
* *********** */
/**
* Returns a [Sequence] walking up this view's [parent][View.getParent] hierarchy chain.
*/
val View.ancestors: Sequence<ViewParent>
get() = generateSequence(parent, ViewParent::getParent)
/* ***********
* Tests
* *********** */
@Test
fun ancestors_root() {
val actual = view.ancestors.toList()
val expected = emptyList<ViewParent>()
assertEquals(expected, actual)
}
@Test
fun ancestors() {
val parents = listOf(
FrameLayout(context),
LinearLayout(context),
RelativeLayout(context)
)
for ((parent, child) in parents.zipWithNext()) {
parent.addView(child)
}
parents.last().addView(view)
val expected = parents.reversed()
val actual = view.ancestors.toList()
assertEquals(expected, actual)
}