Java Code Examples for com.taobao.weex.utils.WXReflectionUtils#setValue()

The following examples show how to use com.taobao.weex.utils.WXReflectionUtils#setValue() . 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: WXSDKInstance.java    From ucar-weex-core with Apache License 2.0 6 votes vote down vote up
private void destroyView(View rootView) {
  try {
    if (rootView instanceof ViewGroup) {
      ViewGroup cViewGroup = ((ViewGroup) rootView);
      for (int index = 0; index < cViewGroup.getChildCount(); index++) {
        destroyView(cViewGroup.getChildAt(index));
      }

      cViewGroup.removeViews(0, ((ViewGroup) rootView).getChildCount());
      // Ensure that the viewgroup's status to be normal
      WXReflectionUtils.setValue(rootView, "mChildrenCount", 0);

    }
    if(rootView instanceof Destroyable){
      ((Destroyable)rootView).destroy();
    }
  } catch (Exception e) {
    WXLogUtils.e("WXSDKInstance destroyView Exception: ", e);
  }
}
 
Example 2
Source File: WXSDKInstance.java    From weex-uikit with MIT License 6 votes vote down vote up
private void destroyView(View rootView) {
  try {
    if (rootView instanceof ViewGroup) {
      ViewGroup cViewGroup = ((ViewGroup) rootView);
      for (int index = 0; index < cViewGroup.getChildCount(); index++) {
        destroyView(cViewGroup.getChildAt(index));
      }

      cViewGroup.removeViews(0, ((ViewGroup) rootView).getChildCount());
      // Ensure that the viewgroup's status to be normal
      WXReflectionUtils.setValue(rootView, "mChildrenCount", 0);

    }
    if(rootView instanceof Destroyable){
      ((Destroyable)rootView).destroy();
    }
  } catch (Exception e) {
    WXLogUtils.e("WXSDKInstance destroyView Exception: ", e);
  }
}
 
Example 3
Source File: WXSDKInstance.java    From weex with Apache License 2.0 6 votes vote down vote up
private void destroyView(View rootView) {
  try {
    if (rootView instanceof ViewGroup) {
      ViewGroup cViewGroup = ((ViewGroup) rootView);
      for (int index = 0; index < cViewGroup.getChildCount(); index++) {
        destroyView(cViewGroup.getChildAt(index));
      }

      cViewGroup.removeViews(0, ((ViewGroup) rootView).getChildCount());
      // Ensure that the viewgroup's status to be normal
      WXReflectionUtils.setValue(rootView, "mChildrenCount", 0);

    }
  } catch (Exception e) {
    WXLogUtils.e("WXSDKInstance destroyView Exception: " + WXLogUtils.getStackTrace(e));
  }
}
 
Example 4
Source File: WXScrollView.java    From ucar-weex-core with Apache License 2.0 5 votes vote down vote up
public WXScrollView(Context context) {
  super(context);
  mScrollViewListeners = new ArrayList<>();
  init();
  try {
    WXReflectionUtils.setValue(this, "mMinimumVelocity", 5);
  } catch (Exception e) {
    WXLogUtils.e("[WXScrollView] WXScrollView: ", e);
  }
}
 
Example 5
Source File: WXScrollView.java    From weex-uikit with MIT License 5 votes vote down vote up
public WXScrollView(Context context) {
  super(context);
  mScrollViewListeners = new ArrayList<>();
  init();
  try {
    WXReflectionUtils.setValue(this, "mMinimumVelocity", 5);
  } catch (Exception e) {
    WXLogUtils.e("[WXScrollView] WXScrollView: ", e);
  }
}
 
Example 6
Source File: WXScrollView.java    From weex with Apache License 2.0 5 votes vote down vote up
public WXScrollView(Context context) {
  super(context);
  mScrollViewListeners = new ArrayList<>();
  init();
  try {
    WXReflectionUtils.setValue(this, "mMinimumVelocity", 5);
  } catch (Exception e) {
    WXLogUtils.e("[WXScrollView] WXScrollView: " + WXLogUtils.getStackTrace(e));
  }
}