当前位置: 首页>>代码示例>>Java>>正文


Java WXLogUtils.eTag方法代码示例

本文整理汇总了Java中com.taobao.weex.utils.WXLogUtils.eTag方法的典型用法代码示例。如果您正苦于以下问题:Java WXLogUtils.eTag方法的具体用法?Java WXLogUtils.eTag怎么用?Java WXLogUtils.eTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.taobao.weex.utils.WXLogUtils的用法示例。


在下文中一共展示了WXLogUtils.eTag方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateViewType

import com.taobao.weex.utils.WXLogUtils; //导入方法依赖的package包/类
/**
 * generate viewtype by component
 * @param component
 * @return
 */
private int generateViewType(WXComponent component) {
    long id;
    try {
        id = Integer.parseInt(component.getDomObject().getRef());
        String type = component.getDomObject().getAttrs().getScope();

        if (!TextUtils.isEmpty(type)) {
            if (mRefToViewType == null) {
                mRefToViewType = new ArrayMap<>();
            }
            if (!mRefToViewType.containsKey(type)) {
                mRefToViewType.put(type, id);
            }
            id = mRefToViewType.get(type);

        }
    } catch (RuntimeException e) {
      WXLogUtils.eTag(TAG, e);
      id = RecyclerView.NO_ID;
      WXLogUtils.e(TAG, "getItemViewType: NO ID, this will crash the whole render system of WXListRecyclerView");
    }
    return (int) id;
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:29,代码来源:WXListComponent.java

示例2: generateViewType

import com.taobao.weex.utils.WXLogUtils; //导入方法依赖的package包/类
/**
 * generate viewtype by component
 *
 * @param component
 * @return
 */
private int generateViewType(WXComponent component) {
  long id;
  try {
    id = Integer.parseInt(component.getDomObject().getRef());
    String type = component.getDomObject().getAttrs().getScope();

    if (!TextUtils.isEmpty(type)) {
      if (mRefToViewType == null) {
        mRefToViewType = new ArrayMap<>();
      }
      if (!mRefToViewType.containsKey(type)) {
        mRefToViewType.put(type, id);
      }
      id = mRefToViewType.get(type);

    }
  } catch (RuntimeException e) {
    WXLogUtils.eTag(TAG, e);
    id = RecyclerView.NO_ID;
    WXLogUtils.e(TAG, "getItemViewType: NO ID, this will crash the whole render system of WXListRecyclerView");
  }
  return (int) id;
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:30,代码来源:BasicListComponent.java

示例3: push

import com.taobao.weex.utils.WXLogUtils; //导入方法依赖的package包/类
@WXModuleAnno
public void push(String param, final String callbackId) {

    if (!TextUtils.isEmpty(param)) {
        if (WXSDKEngine.getActivityNavBarSetter() != null) {
            if (WXSDKEngine.getActivityNavBarSetter().push(param)) {
                WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
                        MSG_SUCCESS);
                return;
            }
        }

        try {
            JSONObject jsonObject = new JSONObject(param);
            String url = jsonObject.optString(URL, "");
            if (!TextUtils.isEmpty(url)) {
                Uri rawUri = Uri.parse(url);
                String scheme = rawUri.getScheme();
                Uri.Builder builder = rawUri.buildUpon();
                if (TextUtils.isEmpty(scheme)) {
                    builder.scheme("http");
                }
                Intent intent = new Intent(Intent.ACTION_VIEW, builder.build());
                intent.addCategory(WEEX);
                intent.putExtra(INSTANCE_ID, mWXSDKInstance.getInstanceId());
                mWXSDKInstance.getContext().startActivity(intent);
                WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
                        MSG_SUCCESS);
            }
        } catch (Exception e) {
            WXLogUtils.eTag(TAG, e);
            WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
                    MSG_FAILED);
        }
    }

    WXBridgeManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callbackId,
            MSG_FAILED);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:40,代码来源:WXNavigatorModule.java

示例4: warmUpTextLayoutCache

import com.taobao.weex.utils.WXLogUtils; //导入方法依赖的package包/类
/**
 * As warming up TextLayoutCache done in the DOM thread may manipulate UI operation,
 there may be some exception, in which case the exception is ignored. After all,
 this is just a warm up operation.
 * @return false for warm up failure, otherwise returns true.
 */
private boolean warmUpTextLayoutCache(Layout layout) {
  boolean result;
  try {
    layout.draw(DUMMY_CANVAS);
    result = true;
  } catch (Exception e) {
    WXLogUtils.eTag(TAG, e);
    result = false;
  }
  return result;
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:18,代码来源:WXTextDomObject.java

示例5: push

import com.taobao.weex.utils.WXLogUtils; //导入方法依赖的package包/类
@JSMethod(uiThread = true)
public void push(String param, JSCallback callback) {

    if (!TextUtils.isEmpty(param)) {
        if (WXSDKEngine.getActivityNavBarSetter() != null) {
            if (WXSDKEngine.getActivityNavBarSetter().push(param)) {
                callback.invoke(MSG_SUCCESS);
                return;
            }
        }

        try {
            JSONObject jsonObject = JSON.parseObject(param);
            String url = jsonObject.getString(URL);
            if (!TextUtils.isEmpty(url)) {
                Uri rawUri = Uri.parse(url);
                String scheme = rawUri.getScheme();
                Uri.Builder builder = rawUri.buildUpon();
                if (TextUtils.isEmpty(scheme)) {
                    builder.scheme(Constants.Scheme.HTTP);
                }
                Intent intent = new Intent(Intent.ACTION_VIEW, builder.build());
                intent.addCategory(WEEX);
                intent.putExtra(INSTANCE_ID, mWXSDKInstance.getInstanceId());
                mWXSDKInstance.getContext().startActivity(intent);
                callback.invoke(MSG_SUCCESS);
            }
        } catch (Exception e) {
            WXLogUtils.eTag(TAG, e);
            callback.invoke(MSG_FAILED);
        }
    }

    callback.invoke(MSG_FAILED);
}
 
开发者ID:erguotou520,项目名称:weex-uikit,代码行数:36,代码来源:WXNavigatorModule.java

示例6: push

import com.taobao.weex.utils.WXLogUtils; //导入方法依赖的package包/类
@JSMethod(uiThread = true)
public void push(String param, JSCallback callback) {

    if (!TextUtils.isEmpty(param)) {
        if (WXSDKEngine.getActivityNavBarSetter() != null) {
            if (WXSDKEngine.getActivityNavBarSetter().push(param)) {
                if (callback != null) {
                    callback.invoke(MSG_SUCCESS);
                }
                return;
            }
        }

        try {
            JSONObject jsonObject = JSON.parseObject(param);
            String url = jsonObject.getString(URL);
            if (!TextUtils.isEmpty(url)) {
                Uri rawUri = Uri.parse(url);
                String scheme = rawUri.getScheme();
                Uri.Builder builder = rawUri.buildUpon();
                if (TextUtils.isEmpty(scheme)) {
                    builder.scheme(Constants.Scheme.HTTP);
                }
                Intent intent = new Intent(Intent.ACTION_VIEW, builder.build());
                intent.addCategory(WEEX);
                intent.putExtra(INSTANCE_ID, mWXSDKInstance.getInstanceId());
                mWXSDKInstance.getContext().startActivity(intent);
                if (callback != null) {
                    callback.invoke(MSG_SUCCESS);
                }
            }
        } catch (Exception e) {
            WXLogUtils.eTag(TAG, e);
            if (callback != null) {
                callback.invoke(MSG_FAILED);
            }
        }
    } else if (callback != null) {
        callback.invoke(MSG_FAILED);
    }
}
 
开发者ID:natjs,项目名称:nat-explorer,代码行数:42,代码来源:NavigatorModule.java

示例7: pushNative

import com.taobao.weex.utils.WXLogUtils; //导入方法依赖的package包/类
@JSMethod
public void pushNative(String encodeParam, JSCallback callback) {
    if (TextUtils.isEmpty(encodeParam)) {
        return;
    }
    try {
        JSONObject options = JSON.parseObject(encodeParam);
        String url = "";
        UWXTheme.NavBar navBar = null;
        JSONObject param = null;
        if (options.containsKey(UWXBundleInfo.KEY_URL)) {
            url = options.getString(UWXBundleInfo.KEY_URL);
        }
        if (options.containsKey(UWXBundleInfo.KEY_NAV_BAR)) {
            String _navBar = options.getString(UWXBundleInfo.KEY_NAV_BAR);
            if (!TextUtils.isEmpty(_navBar)) {
                navBar = JSON.parseObject(_navBar, UWXTheme.NavBar.class);
            }
        }
        if (options.containsKey(UWXBundleInfo.KEY_PARAM)) {
            param = options.getJSONObject(UWXBundleInfo.KEY_PARAM);
        }
        UWLog.v("params=" + encodeParam);
        if (!TextUtils.isEmpty(url)) {
            UWXNavigatorAdapter navigatorAdapter = UWXSDKManager.getInstance().getNavigatorAdapter();
            if (navigatorAdapter != null) {
                navigatorAdapter.pushNative((Activity) mWXSDKInstance.getContext(),url ,param);
                if (callback != null) {
                    callback.invoke(MSG_SUCCESS);
                }
            }
        } else {
            callback.invoke(MSG_FAILED);
        }
    } catch (Exception e) {
        WXLogUtils.eTag(TAG, e);
        if (callback != null) {
            callback.invoke(MSG_FAILED);
        }
    }
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:42,代码来源:UWXNavigatorModule.java

示例8: push

import com.taobao.weex.utils.WXLogUtils; //导入方法依赖的package包/类
@JSMethod
public void push(String encodeParam, JSCallback callback) {
    if (TextUtils.isEmpty(encodeParam)) {
        return;
    }
    try {
        JSONObject options = JSON.parseObject(encodeParam);
        String url = "";
        UWXTheme.NavBar navBar = null;
        JSONObject param = null;
        boolean animated = false;
        if (options.containsKey(UWXBundleInfo.KEY_URL)) {
            url = options.getString(UWXBundleInfo.KEY_URL);
        }
        if (options.containsKey(UWXBundleInfo.KEY_NAV_BAR)) {
            String _navBar = options.getString(UWXBundleInfo.KEY_NAV_BAR);
            if (!TextUtils.isEmpty(_navBar)) {
                navBar = JSON.parseObject(_navBar, UWXTheme.NavBar.class);
            }
        }
        if (options.containsKey(UWXBundleInfo.KEY_PARAM)) {
            param = options.getJSONObject(UWXBundleInfo.KEY_PARAM);
        }

        if (options.containsKey(UWXBundleInfo.KEY_SCENE_CONFIGS)) {
            animated = options.getBoolean(UWXBundleInfo.KEY_SCENE_CONFIGS);
        }
        UWLog.v("params=" + encodeParam);
        UWXTheme theme = null;
        if (navBar == null) {
            theme = UWXThemeManager.getInstance().getPageTheme();
        } else {
            UWXThemeManager.getInstance().getPageTheme().setNavBar(navBar);
            theme = UWXThemeManager.getInstance().getPageTheme();
        }
        if (!TextUtils.isEmpty(url)) {

            UWXJumpUtil.openPageByUrl((Activity) mWXSDKInstance.getContext(), url, param, theme);
            if (callback != null) {
                callback.invoke(MSG_SUCCESS);
            }
        } else {
            callback.invoke(MSG_FAILED);
        }
    } catch (Exception e) {
        WXLogUtils.eTag(TAG, e);
        if (callback != null) {
            callback.invoke(MSG_FAILED);
        }
    }
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:52,代码来源:UWXNavigatorModule.java


注:本文中的com.taobao.weex.utils.WXLogUtils.eTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。