Skip to content

Commit 32888a8

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Disable state list animator during measurements of ReactSlider
Summary: This diff disables the state list animator from the ReactSlider object used to measure ReactSlider. The motivation is to fix T63030542, which it seems to be caused by the state list animator being accessed and modified from different threads We don't have a way to reproduce, but based on my analysis this diff will fix T63030542. I would like to land this diff and then keep tracking production data for the crash reported on T63030542 Changelog: [Android][Fixed] Fix intermittent crash of ReactSlider on Android Reviewed By: fkgozali Differential Revision: D21920698 fbshipit-source-id: 54af388043d5041c4bf981c81364780d3f52d818
1 parent 965635f commit 32888a8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderManager.java

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ public long measure(
7373
YogaMeasureMode heightMode) {
7474
if (!mMeasured) {
7575
SeekBar reactSlider = new ReactSlider(getThemedContext(), null, STYLE);
76+
// reactSlider is used for measurements purposes, it is not necessary to set a
77+
// StateListAnimator.
78+
// It is not safe to access StateListAnimator from a background thread.
79+
reactSlider.setStateListAnimator(null);
7680
final int spec =
7781
View.MeasureSpec.makeMeasureSpec(
7882
ViewGroup.LayoutParams.WRAP_CONTENT, View.MeasureSpec.UNSPECIFIED);

0 commit comments

Comments
 (0)