Java Code Examples for com.facebook.react.uimanager.ViewProps#ON

The following examples show how to use com.facebook.react.uimanager.ViewProps#ON . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ReactSwitchManager.java    From react-native-GPay with MIT License 5 votes vote down vote up
@ReactProp(name = ViewProps.ON)
public void setOn(ReactSwitch view, boolean on) {
  // we set the checked change listener to null and then restore it so that we don't fire an
  // onChange event to JS when JS itself is updating the value of the switch
  view.setOnCheckedChangeListener(null);
  view.setOn(on);
  view.setOnCheckedChangeListener(ON_CHECKED_CHANGE_LISTENER);
}
 
Example 2
Source File: ReactCheckBoxManager.java    From react-native-GPay with MIT License 5 votes vote down vote up
@ReactProp(name = ViewProps.ON)
public void setOn(ReactCheckBox view, boolean on) {
  // we set the checked change listener to null and then restore it so that we don't fire an
  // onChange event to JS when JS itself is updating the value of the checkbox
  view.setOnCheckedChangeListener(null);
  view.setOn(on);
  view.setOnCheckedChangeListener(ON_CHECKED_CHANGE_LISTENER);
}