Merge "Fix potential NPE when looking up view tags for animating" into udc-dev
This commit is contained in:
@@ -523,6 +523,7 @@ public class PhysicsAnimationLayout extends FrameLayout {
|
|||||||
*/
|
*/
|
||||||
@Nullable private SpringAnimation getSpringAnimationFromView(
|
@Nullable private SpringAnimation getSpringAnimationFromView(
|
||||||
DynamicAnimation.ViewProperty property, View view) {
|
DynamicAnimation.ViewProperty property, View view) {
|
||||||
|
if (view == null) return null;
|
||||||
return (SpringAnimation) view.getTag(getTagIdForProperty(property));
|
return (SpringAnimation) view.getTag(getTagIdForProperty(property));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -531,11 +532,13 @@ public class PhysicsAnimationLayout extends FrameLayout {
|
|||||||
* system.
|
* system.
|
||||||
*/
|
*/
|
||||||
@Nullable private ViewPropertyAnimator getViewPropertyAnimatorFromView(View view) {
|
@Nullable private ViewPropertyAnimator getViewPropertyAnimatorFromView(View view) {
|
||||||
|
if (view == null) return null;
|
||||||
return (ViewPropertyAnimator) view.getTag(R.id.reorder_animator_tag);
|
return (ViewPropertyAnimator) view.getTag(R.id.reorder_animator_tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Retrieves the target animator from the view via the view tag system. */
|
/** Retrieves the target animator from the view via the view tag system. */
|
||||||
@Nullable private ObjectAnimator getTargetAnimatorFromView(View view) {
|
@Nullable private ObjectAnimator getTargetAnimatorFromView(View view) {
|
||||||
|
if (view == null) return null;
|
||||||
return (ObjectAnimator) view.getTag(R.id.target_animator_tag);
|
return (ObjectAnimator) view.getTag(R.id.target_animator_tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user