本文整理汇总了Java中com.taobao.weex.common.WXModule类的典型用法代码示例。如果您正苦于以下问题:Java WXModule类的具体用法?Java WXModule怎么用?Java WXModule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WXModule类属于com.taobao.weex.common包,在下文中一共展示了WXModule类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: findModule
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
private static WXModule findModule(String instanceId, String moduleStr,ModuleFactory factory) {
// find WXModule
WXModule wxModule = sGlobalModuleMap.get(moduleStr);
//not global module
if (wxModule == null) {
HashMap<String, WXModule> moduleMap = sInstanceModuleMap.get(instanceId);
if (moduleMap == null) {
moduleMap = new HashMap<>();
sInstanceModuleMap.put(instanceId, moduleMap);
}
// if cannot find the Module, create a new Module and save it
wxModule = moduleMap.get(moduleStr);
if (wxModule == null) {
try {
wxModule = factory.buildInstance();
} catch (Exception e) {
WXLogUtils.e(moduleStr + " module build instace failed.", e);
return null;
}
moduleMap.put(moduleStr, wxModule);
}
}
return wxModule;
}
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:27,代码来源:WXModuleManager.java
示例2: destroyInstanceModules
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
public static void destroyInstanceModules(String 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();
}
}
}
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:17,代码来源:WXModuleManager.java
示例3: onActivityCreate
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
/**Hook Activity life cycle callback begin***/
public static void onActivityCreate(String instanceId){
Map<String, WXModule> modules = sInstanceModuleMap.get(instanceId);
if(modules!=null) {
for (String key : modules.keySet()) {
WXModule module = modules.get(key);
if (module != null) {
module.onActivityCreate();
} else {
WXLogUtils.w("onActivityCreate can not find the " + key + " module");
}
}
}
}
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:19,代码来源:WXModuleManager.java
示例4: destroyInstanceModules
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
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();
}
}
}
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:18,代码来源:WXModuleManager.java
示例5: fireModuleEvent
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
/**
* Notifies WEEX that this event has occurred
* @param eventName WEEX register event
* @param module Events occur in this Module
* @param params The parameters to be notified to WEEX are required
*/
public void fireModuleEvent(String eventName, WXModule module,Map<String, Object> params) {
if (TextUtils.isEmpty(eventName) || module == null) {
return;
}
Map<String, Object> event = new HashMap<>();
event.put("type", eventName);
event.put("module", module.getModuleName());
event.put("data", params);
List<String> callbacks = module.getEventCallbacks(eventName);
if (callbacks != null) {
for (String callback : callbacks) {
SimpleJSCallback jsCallback = new SimpleJSCallback(mInstanceId, callback);
if (module.isOnce(callback)) {
jsCallback.invoke(event);
} else {
jsCallback.invokeAndKeepAlive(event);
}
}
}
}
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:29,代码来源:WXSDKInstance.java
示例6: onActivityCreate
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
/**Hook Activity life cycle callback begin***/
public static void onActivityCreate(String instanceId){
HashMap<String, WXModule> modules = sInstanceModuleMap.get(instanceId);
if(modules!=null) {
for (String key : modules.keySet()) {
WXModule module = modules.get(key);
if (module != null) {
module.onActivityCreate();
} else {
WXLogUtils.w("onActivityCreate can not find the " + key + " module");
}
}
}
}
开发者ID:erguotou520,项目名称:weex-uikit,代码行数:19,代码来源:WXModuleManager.java
示例7: destroyInstanceModules
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
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();
}
}
}
开发者ID:erguotou520,项目名称:weex-uikit,代码行数:18,代码来源:WXModuleManager.java
示例8: fireModuleEvent
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
/**
* Notifies WEEX that this event has occurred
* @param eventName WEEX register event
* @param module Events occur in this Module
* @param params The parameters to be notified to WEEX are required
*/
public void fireModuleEvent(String eventName, WXModule module,Map<String, Object> params) {
if (TextUtils.isEmpty(eventName) || module == null) {
return;
}
List<String> callbacks = module.getEventCallbacks(eventName);
if (callbacks != null) {
for (String callback : callbacks) {
SimpleJSCallback jsCallback = new SimpleJSCallback(mInstanceId, callback);
if (module.isOnce(callback)) {
jsCallback.invokeAndKeepAlive(params);
} else {
jsCallback.invoke(params);
}
}
}
}
开发者ID:erguotou520,项目名称:weex-uikit,代码行数:23,代码来源:WXSDKInstance.java
示例9: calCategory
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
private static String calCategory(IWXObject plugin) {
if (plugin != null) {
if (plugin instanceof WXModule) {
return Constants.CATEGORY_MODULE;
} else if (plugin instanceof WXComponent) {
return Constants.CATEGORY_COMPONENT;
}
}
return Constants.CATEGORY_MODULE;
}
开发者ID:wangwei123,项目名称:my-weex,代码行数:11,代码来源:PluginEntry.java
示例10: dispatchCallModuleMethod
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
private static Object dispatchCallModuleMethod(@NonNull WXSDKInstance instance, @NonNull WXModule wxModule,
@NonNull JSONArray args, @NonNull Invoker invoker) throws Exception{
if(!instance.isPreRenderMode()) {
return instance.getNativeInvokeHelper().invoke(wxModule,invoker,args);
}
// we are in preRender mode
if(invoker.isRunOnUIThread()) {/*ASYNC CALL*/
DOMAction moduleInvocationAction = Actions.getModuleInvocationAction(wxModule,args,invoker);
WXSDKManager.getInstance().getWXDomManager().postAction(instance.getInstanceId(), moduleInvocationAction,false);
return null;
} else {/*SYNC CALL*/
return instance.getNativeInvokeHelper().invoke(wxModule,invoker,args);
}
}
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:15,代码来源:WXModuleManager.java
示例11: findModule
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
private static WXModule findModule(String instanceId, String moduleStr,ModuleFactory factory) {
// find WXModule
WXModule wxModule = sGlobalModuleMap.get(moduleStr);
//not global module
if (wxModule == null) {
Map<String, WXModule> moduleMap = sInstanceModuleMap.get(instanceId);
if (moduleMap == null) {
moduleMap = new ConcurrentHashMap<>();
sInstanceModuleMap.put(instanceId, moduleMap);
}
// if cannot find the Module, create a new Module and save it
wxModule = moduleMap.get(moduleStr);
if (wxModule == null) {
try {
wxModule = factory.buildInstance();
wxModule.setModuleName(moduleStr);
} catch (Exception e) {
WXLogUtils.e(moduleStr + " module build instace failed.", e);
return null;
}
moduleMap.put(moduleStr, wxModule);
}
}
return wxModule;
}
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:28,代码来源:WXModuleManager.java
示例12: onActivityStart
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
public static void onActivityStart(String instanceId){
Map<String, WXModule> modules = sInstanceModuleMap.get(instanceId);
if(modules!=null) {
for (String key : modules.keySet()) {
WXModule module = modules.get(key);
if (module != null) {
module.onActivityStart();
} else {
WXLogUtils.w("onActivityStart can not find the " + key + " module");
}
}
}
}
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:15,代码来源:WXModuleManager.java
示例13: onActivityPause
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
public static void onActivityPause(String instanceId){
Map<String, WXModule> modules = sInstanceModuleMap.get(instanceId);
if(modules!=null) {
for (String key : modules.keySet()) {
WXModule module = modules.get(key);
if (module != null) {
module.onActivityPause();
} else {
WXLogUtils.w("onActivityPause can not find the " + key + " module");
}
}
}
}
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:14,代码来源:WXModuleManager.java
示例14: onActivityResume
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
public static void onActivityResume(String instanceId){
Map<String, WXModule> modules = sInstanceModuleMap.get(instanceId);
if(modules!=null) {
for (String key : modules.keySet()) {
WXModule module = modules.get(key);
if (module != null) {
module.onActivityResume();
} else {
WXLogUtils.w("onActivityResume can not find the " + key + " module");
}
}
}
}
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:14,代码来源:WXModuleManager.java
示例15: onActivityStop
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
public static void onActivityStop(String instanceId){
Map<String, WXModule> modules = sInstanceModuleMap.get(instanceId);
if(modules!=null) {
for (String key : modules.keySet()) {
WXModule module = modules.get(key);
if (module != null) {
module.onActivityStop();
} else {
WXLogUtils.w("onActivityStop can not find the " + key + " module");
}
}
}
}
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:14,代码来源:WXModuleManager.java
示例16: onActivityDestroy
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
public static void onActivityDestroy(String instanceId){
Map<String, WXModule> modules = sInstanceModuleMap.get(instanceId);
if(modules!=null) {
for (String key : modules.keySet()) {
WXModule module = modules.get(key);
if (module != null) {
module.onActivityDestroy();
} else {
WXLogUtils.w("onActivityDestroy can not find the " + key + " module");
}
}
}
}
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:14,代码来源:WXModuleManager.java
示例17: onActivityBack
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
public static boolean onActivityBack(String instanceId){
Map<String, WXModule> modules = sInstanceModuleMap.get(instanceId);
if(modules!=null) {
for (String key : modules.keySet()) {
WXModule module = modules.get(key);
if (module != null) {
return module.onActivityBack();
} else {
WXLogUtils.w("onActivityCreate can not find the " + key + " module");
}
}
}
return false;
}
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:15,代码来源:WXModuleManager.java
示例18: onActivityResult
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
public static void onActivityResult(String instanceId,int requestCode, int resultCode, Intent data){
Map<String, WXModule> modules = sInstanceModuleMap.get(instanceId);
if(modules!=null) {
for (String key : modules.keySet()) {
WXModule module = modules.get(key);
if (module != null) {
module.onActivityResult(requestCode, resultCode, data);
} else {
WXLogUtils.w("onActivityResult can not find the " + key + " module");
}
}
}
}
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:15,代码来源:WXModuleManager.java
示例19: onCreateOptionsMenu
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
public static boolean onCreateOptionsMenu(String instanceId,Menu menu) {
Map<String, WXModule> modules = sInstanceModuleMap.get(instanceId);
if(modules!=null) {
for (String key : modules.keySet()) {
WXModule module = modules.get(key);
if (module != null) {
module.onCreateOptionsMenu(menu);
} else {
WXLogUtils.w("onActivityResult can not find the " + key + " module");
}
}
}
return false;
}
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:15,代码来源:WXModuleManager.java
示例20: onRequestPermissionsResult
import com.taobao.weex.common.WXModule; //导入依赖的package包/类
public static void onRequestPermissionsResult(String instanceId ,int requestCode, String[] permissions, int[] grantResults) {
Map<String, WXModule> modules = sInstanceModuleMap.get(instanceId);
if(modules!=null) {
for (String key : modules.keySet()) {
WXModule module = modules.get(key);
if (module != null) {
module.onRequestPermissionsResult(requestCode, permissions, grantResults);
} else {
WXLogUtils.w("onActivityResult can not find the " + key + " module");
}
}
}
}
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:14,代码来源:WXModuleManager.java
注:本文中的com.taobao.weex.common.WXModule类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论