Fixed
Status Update
Comments
ca...@google.com <ca...@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.
ro...@google.com <ro...@google.com> #3
Also not reproducible on Galaxy Nexus running 4.0.1 (v14), 4.0.4 (v15) and 4.2.2 (v17)
ro...@google.com <ro...@google.com> #4
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit 0d8eb4081585d1be1997cb097f5fd54b41ddf8bb
Author: Alex Vanyo <vanyo@google.com>
Date: Tue Nov 23 01:06:28 2021
Convert WindowInsetsControllerCompat behavior to depend on a View to align behavior
Relnote: Converted WindowInsetsControllerCompat to depend on a View instead of a Window or the platform WindowInsetsController. This improves behavior with Dialogs, showing the IME, and ensures the non-deprecated creation methods workaroundhttps://issuetracker.google.com/issues/180881870 .
Bug: 207401542,210121779
Test: Updated and new tests
Change-Id: I292640cb4acc39e47a4d2ce0502293d42468ed67
M core/core/api/restricted_current.txt
M core/core/src/androidTest/java/androidx/core/view/WindowInsetsAnimationCompatActivityTest.kt
M core/core/src/main/java/androidx/core/view/ViewCompat.java
M core/core/api/public_plus_experimental_current.txt
M samples/Support4Demos/src/main/java/com/example/android/supportv4/view/WindowInsetsControllerPlayground.kt
M core/core/src/main/java/androidx/core/view/WindowCompat.java
M core/core/src/androidTest/java/androidx/core/view/WindowInsetsControllerCompatActivityTest.kt
M core/core/api/current.txt
M core/core/src/main/java/androidx/core/view/WindowInsetsControllerCompat.java
M core/core/src/androidTest/java/androidx/core/view/WindowInsetsCompatActivityTest.kt
M core/core/src/androidTest/java/androidx/core/view/ViewCompatTest.java
https://android-review.googlesource.com/1900054
Branch: androidx-main
commit 0d8eb4081585d1be1997cb097f5fd54b41ddf8bb
Author: Alex Vanyo <vanyo@google.com>
Date: Tue Nov 23 01:06:28 2021
Convert WindowInsetsControllerCompat behavior to depend on a View to align behavior
Relnote: Converted WindowInsetsControllerCompat to depend on a View instead of a Window or the platform WindowInsetsController. This improves behavior with Dialogs, showing the IME, and ensures the non-deprecated creation methods workaround
Bug: 207401542,210121779
Test: Updated and new tests
Change-Id: I292640cb4acc39e47a4d2ce0502293d42468ed67
M core/core/api/restricted_current.txt
M core/core/src/androidTest/java/androidx/core/view/WindowInsetsAnimationCompatActivityTest.kt
M core/core/src/main/java/androidx/core/view/ViewCompat.java
M core/core/api/public_plus_experimental_current.txt
M samples/Support4Demos/src/main/java/com/example/android/supportv4/view/WindowInsetsControllerPlayground.kt
M core/core/src/main/java/androidx/core/view/WindowCompat.java
M core/core/src/androidTest/java/androidx/core/view/WindowInsetsControllerCompatActivityTest.kt
M core/core/api/current.txt
M core/core/src/main/java/androidx/core/view/WindowInsetsControllerCompat.java
M core/core/src/androidTest/java/androidx/core/view/WindowInsetsCompatActivityTest.kt
M core/core/src/androidTest/java/androidx/core/view/ViewCompatTest.java
Description
Requiring a Window instance when constructing WindowInsetsControllerCompat hinders composability, and requires unfortunate hacks like casting the Context to Activity to obtain a Window (which won't return the right instance in all cases, e.g. with
Dialog
s).We should look into removing this dependency, or making it optional.