Fixed
Status Update
Comments
am...@google.com <am...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit b6c7c78f9e7476b468dafe9d5f7dec6794d47f09
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Mon Nov 27 11:16:51 2023
Introduce DecayAnimation in AnchoredDraggable
Decay animation allows more realistic settling of a component. This is performed by now passing a `DecayAnimationSpec` parameter to AnchoredDraggable and using it when animating to the target. The new animation implementation will be added in a chain CL.
Bug: 288084801
Test: Tests will be added in a chain CL
Relnote: This change adds a `decayAnimationSpec` parameter to AnchoredDraggable allowing to use decay animation when settling to one of the anchors. The change also includes renaming the existing `animationSpec` to `snapAnimationSpec` to help understanding the use case of each spec.
Change-Id: I44ccd408d919328fd6504d31d8db59cf1d07de43
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/AnchoredDraggableSample.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableGestureTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableStateTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
https://android-review.googlesource.com/2847074
Branch: androidx-main
commit b6c7c78f9e7476b468dafe9d5f7dec6794d47f09
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Mon Nov 27 11:16:51 2023
Introduce DecayAnimation in AnchoredDraggable
Decay animation allows more realistic settling of a component. This is performed by now passing a `DecayAnimationSpec` parameter to AnchoredDraggable and using it when animating to the target. The new animation implementation will be added in a chain CL.
Bug: 288084801
Test: Tests will be added in a chain CL
Relnote: This change adds a `decayAnimationSpec` parameter to AnchoredDraggable allowing to use decay animation when settling to one of the anchors. The change also includes renaming the existing `animationSpec` to `snapAnimationSpec` to help understanding the use case of each spec.
Change-Id: I44ccd408d919328fd6504d31d8db59cf1d07de43
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/AnchoredDraggableSample.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableGestureTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableStateTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
an...@gmail.com <an...@gmail.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 365993d1a90c27704b71f6bee042a1749314a4b1
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Tue Nov 28 10:49:56 2023
Add tests for Animation in AnchoredDraggable
Added tests to check for different settling behaviors.
Bug: 288084801
Test: Added tests to verify behavior.
Change-Id: I369b30c69f7c29f676ae0671fef25c38ff3c74cb
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableStateTest.kt
https://android-review.googlesource.com/2847475
Branch: androidx-main
commit 365993d1a90c27704b71f6bee042a1749314a4b1
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Tue Nov 28 10:49:56 2023
Add tests for Animation in AnchoredDraggable
Added tests to check for different settling behaviors.
Bug: 288084801
Test: Added tests to verify behavior.
Change-Id: I369b30c69f7c29f676ae0671fef25c38ff3c74cb
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableStateTest.kt
am...@google.com <am...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit ff1a600df5f4d8ae21a75d8e3e0f24d6c5c2faee
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Mon Nov 27 15:51:12 2023
Modify settle function to perform decay animation if possible
When settling, a check will be performed to see if natural decay animation can be used. If not so, a target animation will be used. The consumed velocity is returned to the settle function, which could be used to show an overscroll effect.
Bug: 288084801
Test: Tests will be added in a chain CL.
Relnote: This change introduces a new `animateToWithDecay` function that naturally decays if possible. It takes the target value and the initial velocity. The `animateTo` functions no longer takes a velocity, but passes the available velocity in `lastVelocity` to animation, as it is concerned with reaching the target. If users need to pass a certain velocity for animation, they can use `animateToWithDecay` function.
Change-Id: I465dbd826e3969b784d08c65425f4bbda3de8493
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
https://android-review.googlesource.com/2847576
Branch: androidx-main
commit ff1a600df5f4d8ae21a75d8e3e0f24d6c5c2faee
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Mon Nov 27 15:51:12 2023
Modify settle function to perform decay animation if possible
When settling, a check will be performed to see if natural decay animation can be used. If not so, a target animation will be used. The consumed velocity is returned to the settle function, which could be used to show an overscroll effect.
Bug: 288084801
Test: Tests will be added in a chain CL.
Relnote: This change introduces a new `animateToWithDecay` function that naturally decays if possible. It takes the target value and the initial velocity. The `animateTo` functions no longer takes a velocity, but passes the available velocity in `lastVelocity` to animation, as it is concerned with reaching the target. If users need to pass a certain velocity for animation, they can use `animateToWithDecay` function.
Change-Id: I465dbd826e3969b784d08c65425f4bbda3de8493
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
an...@gmail.com <an...@gmail.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit 01142ddd5b14eb33e5145c4e72e6619a5c100fe4
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Thu Dec 21 12:34:00 2023
Introduce Overscroll in AnchoredDraggable
Adding overscroll support to AnchoredDraggable by giving the ability to pass a customized overscrollEffect object to AnchoredDraggable.
Bug: 288084801
Relnote: An OverscrollEffect has been introduced to allow for custom overscroll effects in anchoredDraggable. To retrieve the consumed velocity after animation, the consumed velocity is returned from the settle function.
Test: Added tests to verify behavior
Change-Id: I100683fe7473b1e5ff317ab22245a2b0a25bd549
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/AnchoredDraggableDemo.kt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/AnchoredDraggableSample.kt
A compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableOverscrollTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
https://android-review.googlesource.com/2888106
Branch: androidx-main
commit 01142ddd5b14eb33e5145c4e72e6619a5c100fe4
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Thu Dec 21 12:34:00 2023
Introduce Overscroll in AnchoredDraggable
Adding overscroll support to AnchoredDraggable by giving the ability to pass a customized overscrollEffect object to AnchoredDraggable.
Bug: 288084801
Relnote: An OverscrollEffect has been introduced to allow for custom overscroll effects in anchoredDraggable. To retrieve the consumed velocity after animation, the consumed velocity is returned from the settle function.
Test: Added tests to verify behavior
Change-Id: I100683fe7473b1e5ff317ab22245a2b0a25bd549
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/AnchoredDraggableDemo.kt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/AnchoredDraggableSample.kt
A compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableOverscrollTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
am...@google.com <am...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit 0f071d797bccf7eff2a23e408928ca76640af782
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Wed Nov 29 18:34:09 2023
Migrates AnchoredDraggable to Modifier.Node
Migrates AnchoredDraggable to Modifier.Node. This helps in adding Overscroll effect in AnchoredDraggable.
Bug: 288084801
Test: Added tests to verify behavior
Change-Id: I3f3338cd71763972c4b70f2e06c97e85285b0035
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableGestureTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable2D.kt
https://android-review.googlesource.com/2852691
Branch: androidx-main
commit 0f071d797bccf7eff2a23e408928ca76640af782
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Wed Nov 29 18:34:09 2023
Migrates AnchoredDraggable to Modifier.Node
Migrates AnchoredDraggable to Modifier.Node. This helps in adding Overscroll effect in AnchoredDraggable.
Bug: 288084801
Test: Added tests to verify behavior
Change-Id: I3f3338cd71763972c4b70f2e06c97e85285b0035
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableGestureTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable2D.kt
am...@google.com <am...@google.com> #7
This issue is marked as fixed, but there is still no replacement for ResistanceConfig
.
How should we properly migrate it?
an...@gmail.com <an...@gmail.com> #8
Can we document this / update the migration guide?
am...@google.com <am...@google.com> #9
It's issue with AppCompatActivity.java of support library which is fixed now.
ps...@gmail.com <ps...@gmail.com> #10
[Comment deleted]
ps...@gmail.com <ps...@gmail.com> #11
Issue is not fully fixed. I'm using "values-night" plus normal "values"
directories as well as
android:configChanges="orientation|screenSize".
But when performing orientation change, the colors inside "values-night"
get confused with "values" colors for some components like recyclerview
items and newly created fragments. I will upload a sample project that
reproduces the issue.
Στις 11 Μαρ 2016 2:42 πμ, ο χρήστης <android@googlecode.com> έγραψε:
directories as well as
android:configChanges="orientation|screenSize".
But when performing orientation change, the colors inside "values-night"
get confused with "values" colors for some components like recyclerview
items and newly created fragments. I will upload a sample project that
reproduces the issue.
Στις 11 Μαρ 2016 2:42 πμ, ο χρήστης <android@googlecode.com> έγραψε:
ke...@teslacoilsw.com <ke...@teslacoilsw.com> #12
I'm also still having some of the wrong resources being used. Additionally, the Support7Demo's AlertDialog demo still doesn't work, the dialogs are all light. The Dialog (not AlertDialog) demo does work.
Nexus 6P 6.0.1 and Galaxy S5 5.0
Nexus 6P 6.0.1 and Galaxy S5 5.0
ps...@gmail.com <ps...@gmail.com> #13
I modified the cheesesquare project to let you know what I mean.
App starts on night mode explicitly. While on night mode, rotate your phone to landscape scroll a little bit then rotate to portrait scroll again. A glitch appears where resources from default "values" (light theme) are being used instead.
check it out here
https://github.com/ThanosFisherman/cheesesquare
App starts on night mode explicitly. While on night mode, rotate your phone to landscape scroll a little bit then rotate to portrait scroll again. A glitch appears where resources from default "values" (light theme) are being used instead.
check it out here
ke...@teslacoilsw.com <ke...@teslacoilsw.com> #14
Re: #13
I think something along the lines of the following snippet will work around the specific issue you're having. This worked for me, though I suspect it needs more fleshing out to handle auto night mode and to handle N's system toggle.
@Override
public void onConfigurationChanged(Configuration newConfig) {
int currentNightMode = getResources().getConfiguration().uiMode
& Configuration.UI_MODE_NIGHT_MASK;
if (currentNightMode == Configuration.UI_MODE_NIGHT_YES)
newConfig.uiMode = (newConfig.uiMode & ~Configuration.UI_MODE_NIGHT_MASK) | Configuration.UI_MODE_NIGHT_YES;
super.onConfigurationChanged(newConfig);
}
I'm having issues with mixed resources but am not handling configuration changes. I haven't been able to make a test case yet. In my setup first time viewing the activity in either or dark works and then toggling once works, but toggling back to the original state keeps some elements of the other, like the list dividers and vector drawables that were tinted to ?attr/colorControlActivated. My setup does work if I just switch between using a light and dark theme, it's the -night values that throws things off. I'm not concerned that what appcompat daynight is trying to do can be done reliably and I'll need my dark theme independent of -night, and -night just to handle N.
I think something along the lines of the following snippet will work around the specific issue you're having. This worked for me, though I suspect it needs more fleshing out to handle auto night mode and to handle N's system toggle.
@Override
public void onConfigurationChanged(Configuration newConfig) {
int currentNightMode = getResources().getConfiguration().uiMode
& Configuration.UI_MODE_NIGHT_MASK;
if (currentNightMode == Configuration.UI_MODE_NIGHT_YES)
newConfig.uiMode = (newConfig.uiMode & ~Configuration.UI_MODE_NIGHT_MASK) | Configuration.UI_MODE_NIGHT_YES;
super.onConfigurationChanged(newConfig);
}
I'm having issues with mixed resources but am not handling configuration changes. I haven't been able to make a test case yet. In my setup first time viewing the activity in either or dark works and then toggling once works, but toggling back to the original state keeps some elements of the other, like the list dividers and vector drawables that were tinted to ?attr/colorControlActivated. My setup does work if I just switch between using a light and dark theme, it's the -night values that throws things off. I'm not concerned that what appcompat daynight is trying to do can be done reliably and I'll need my dark theme independent of -night, and -night just to handle N.
ps...@gmail.com <ps...@gmail.com> #15
[Comment deleted]
ps...@gmail.com <ps...@gmail.com> #16
[Comment deleted]
ps...@gmail.com <ps...@gmail.com> #17
[Comment deleted]
mn...@gmail.com <mn...@gmail.com> #18
Same issue is not fixed, we are seeing it within our app. When we come through a deep link with night mode enabled, scrolling down through a recyclerview shows some view holders as applying non -night values.
ai...@gmail.com <ai...@gmail.com> #19
Can confirm issue is not fixed with support library 25.1.0
dr...@gmail.com <dr...@gmail.com> #20
Can confirm issue is not fixed with support library 26.0.0
zf...@gmail.com <zf...@gmail.com> #21
confirm issue is not fixed with support library 25.4.0
pa...@gmail.com <pa...@gmail.com> #22
Also having problems with wrong resources using 26.0.0
Rotating from landscape -> portrait -> landscape works fine however going from landscape (left) -> landscape (right) messes up the resources. Most of the existing UI looks fine but all new views receives the wrong resources.
Rotating from landscape -> portrait -> landscape works fine however going from landscape (left) -> landscape (right) messes up the resources. Most of the existing UI looks fine but all new views receives the wrong resources.
jo...@gmail.com <jo...@gmail.com> #23
confirm issue is not fixed with support library 25.0.0 .
jo...@gmail.com <jo...@gmail.com> #24
Now, i got this bug in android 8.1, after rotate phone, some new widget got error resource.
vl...@desygner.com <vl...@desygner.com> #25
This issue definitely isn't fixed yet, getting it starting with Android 5.0. I found the easiest way to reproduce it 100% is to implement Lokalise SDK here https://github.com/lokalise/lokalise-android-sdk and then -night colors won't be used for new views (RecyclerView items, dialog views, etc.) as soon as onStop() is called, e.g. after going to another activity and coming back or putting the app to background and bringing it back to front. Please fix this!
ro...@gmail.com <ro...@gmail.com> #26
After 3 years this is still not fixed. The theme -night colors works when an app first starts, but then any subsequent starts from the desktop reverts colors back to non-night ones. As indicated, it looks like any onStop() will mess future starts of an application.
ri...@gmail.com <ri...@gmail.com> #27
Try calling the delegator method on the very first screen your app opens. I was having the same problem and it is starts working once I move the delegator code to the very first screen i.e. Splash Screen.
Description
Version used: 23.2.0
Theme used:
Devices/Android versions reproduced on: Nexus 5 with API 23
- Relevant code to trigger the issue: support7Demos under directory /Android/sdk/extras/android/support/samples/Support7Demos
- A screenrecord or screenshots showing the issue (if UI related).
0
down vote
favorite
I have downloaded the Android Support 23.2.0 and imported support7Demos under directory /Android/sdk/extras/android/support/samples/Support7Demos without making any changes. After importing the necessary dependencies, it builds successfully and generate an apk. I installed the apk on Smartisan T1 with API 19. The day night mode works as expected. But it does not work on Nexus 5 with API 23.
Please be noticed that
1, the code is from the Android official Support V7 sample, I did not make any changes at all. The same apk installed on different devices work different.
2,I have linked the apk file and videos in the attachment.
3, this issue could be stably reproduced and this issue occurs in Nexus 6P in emulator which installs MarshMallow while it works perfect in SamSung Galaxy 3 which installs JellyBean.
Is it a bug? And if it is a bug, is there any workaround?