Files
react-native/ReactAndroid
Oleksandr Melnykov aac95b409b Fix switch being stuck in intermidiate state on Android
Summary:
This diff fixes the bug of the switch component on Android being stuck in the middle when a user releases their finger whily dragging the thumb.

When a user releases their finger while dragging the thumb, `setChecked` will be called and if `mAllowChange` is set to false, `super.setChecked` is never called. The supper method will actually make sure the thumb will be animated to the correct edge. Without calling the super method, the thumb might stay in the middle of the switch where a user released their finger.

The fix had to be applied both to ReactSwitch and FbReactSwitchCompat.

One more fix had to be made to FbReactSwitchCompat since D5884661 was applied to ReactSwitch, but not to FbReactSwitchCompat:

if (mAllowChange && **isChecked() != checked**) {
...
}

Reviewed By: mdvacca

Differential Revision: D15535611

fbshipit-source-id: 22ca1fe3fa993ae65cbd677bfae2208a02c368d4
2019-05-30 10:36:24 -07:00
..
2018-05-27 15:17:55 -07:00

Building React Native for Android

See the docs on the website.

Running tests

When you submit a pull request CircleCI will automatically run all tests. To run tests locally, see Testing.