Fixed
Status Update
Comments
k....@gmail.com <k....@gmail.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
Description
It seems that a number of devices in the wild do not support the RouteInfo.getPresentationDisplay() method despite reporting as API 17+.
As a result, a NoSuchMethodError exception is thrown MediaRouterJellybeanMr1.RouteInfo.getPresentationDisplay()'s implementation:
public static Display getPresentationDisplay(Object routeObj) {
return ((android.media.MediaRouter.RouteInfo)routeObj).getPresentationDisplay();
}
Here is an example stack trace:
java.lang.NoSuchMethodError: android.media.MediaRouter$RouteInfo.getPresentationDisplay
at android.support.v7.media.MediaRouterJellybeanMr1$RouteInfo.getPresentationDisplay()
at android.support.v7.media.SystemMediaRouteProvider$JellybeanMr1Impl.onBuildSystemRouteDescriptor()
at android.support.v7.media.SystemMediaRouteProvider$JellybeanImpl.onCreateRouteController()
at android.support.v7.media.SystemMediaRouteProvider$JellybeanImpl.addSystemRouteNoPublish()
at android.support.v7.media.SystemMediaRouteProvider$JellybeanImpl.updateSystemRoutes()
at android.support.v7.media.SystemMediaRouteProvider$JellybeanImpl.()
at android.support.v7.media.SystemMediaRouteProvider$JellybeanMr1Impl.()
at android.support.v7.media.SystemMediaRouteProvider.obtain()
at android.support.v7.media.MediaRouter$GlobalMediaRouter.()
at android.support.v7.media.MediaRouter.getInstance()
at com.google.android.libraries.cast.companionlibrary.cast.BaseCastManager.()
at com.google.android.libraries.cast.companionlibrary.cast.VideoCastManager.()
The above stack trace happens in the CastCompanionLibrary's BaseCastManager's constructor:
protected BaseCastManager(Context context, String applicationId) {
...
mMediaRouter = MediaRouter.getInstance(mContext);
...
}
Suggested fix would be putting this in a try-catch block and returning null on NoSuchMethodError.
~Philip Peng (phpeng-ms / Keripo)