com.taobao.weex.common.Destroyable Java Examples
The following examples show how to use
com.taobao.weex.common.Destroyable.
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: WXModuleManager.java From ucar-weex-core with Apache License 2.0 | 6 votes |
public static void destroyInstanceModules(String instanceId) { sDomModuleMap.remove(instanceId); Map<String, WXModule> moduleMap = sInstanceModuleMap.remove(instanceId); if (moduleMap == null || moduleMap.size() < 1) { return; } Iterator<Entry<String, WXModule>> iterator = moduleMap.entrySet().iterator(); Entry<String, WXModule> entry; while (iterator.hasNext()) { entry = iterator.next(); WXModule module = entry.getValue(); if(module instanceof Destroyable){ ((Destroyable)module).destroy(); } } }
Example #2
Source File: WXSDKInstance.java From ucar-weex-core with Apache License 2.0 | 6 votes |
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: WXModuleManager.java From weex-uikit with MIT License | 6 votes |
public static void destroyInstanceModules(String instanceId) { sDomModuleMap.remove(instanceId); HashMap<String, WXModule> moduleMap = sInstanceModuleMap.remove(instanceId); if (moduleMap == null || moduleMap.size() < 1) { return; } Iterator<Entry<String, WXModule>> iterator = moduleMap.entrySet().iterator(); Entry<String, WXModule> entry; while (iterator.hasNext()) { entry = iterator.next(); WXModule module = entry.getValue(); if(module instanceof Destroyable){ ((Destroyable)module).destroy(); } } }
Example #4
Source File: WXSDKInstance.java From weex-uikit with MIT License | 6 votes |
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); } }