本文整理汇总了Java中com.taobao.weex.WXEnvironment.isApkDebugable方法的典型用法代码示例。如果您正苦于以下问题:Java WXEnvironment.isApkDebugable方法的具体用法?Java WXEnvironment.isApkDebugable怎么用?Java WXEnvironment.isApkDebugable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.taobao.weex.WXEnvironment
的用法示例。
在下文中一共展示了WXEnvironment.isApkDebugable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: callRemoveEvent
import com.taobao.weex.WXEnvironment; //导入方法依赖的package包/类
/**
* JavaScript uses this methods to call Android code
* @param instanceId
* @param ref
* @param event
* @param callback
* @return int
*/
public int callRemoveEvent(String instanceId, String ref, String event, String callback) {
long start = System.currentTimeMillis();
WXSDKInstance instance = WXSDKManager.getInstance().getSDKInstance(instanceId);
if(instance != null) {
instance.firstScreenCreateInstanceTime(start);
}
int errorCode = IWXBridge.INSTANCE_RENDERING;
try {
errorCode = WXBridgeManager.getInstance().callRemoveEvent(instanceId, ref, event, callback);
} catch (Throwable e) {
//catch everything during call native.
if(WXEnvironment.isApkDebugable()){
WXLogUtils.e(TAG,"callRemoveEvent throw exception:" + e.getMessage());
}
}
if(instance != null) {
instance.callNativeTime(System.currentTimeMillis() - start);
}
return errorCode;
}
示例2: clone
import com.taobao.weex.WXEnvironment; //导入方法依赖的package包/类
/**
* Clone the current object. This is not a deep copy, only shadow copy of some reference.
* @return The result object of clone.
*/
@Override
public WXDomObject clone() {
if (sDestroy.get()) {
return null;
}
WXDomObject dom = null;
try {
dom = new WXDomObject();
copyFields(dom);
} catch (Exception e) {
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.e("WXDomObject clone error: ", e);
}
}
return dom;
}
示例3: reportJSException
import com.taobao.weex.WXEnvironment; //导入方法依赖的package包/类
/**
* Report JavaScript Exception
*/
public void reportJSException(String instanceId, String function,
String exception) {
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.e("reportJSException >>>> instanceId:" + instanceId
+ ", exception function:" + function + ", exception:"
+ exception);
}
WXSDKInstance instance;
if (instanceId != null && (instance = WXSDKManager.getInstance().getSDKInstance(instanceId)) != null) {
// TODO add errCode
instance.onJSException(null, function, exception);
String err="function:"+function+"#exception:"+exception;
commitJSBridgeAlarmMonitor(instanceId,WXErrorCode.WX_ERR_JS_EXECUTE,err);
}
}
示例4: callNativeComponent
import com.taobao.weex.WXEnvironment; //导入方法依赖的package包/类
public Object callNativeComponent(String instanceId, String componentRef, String method, JSONArray arguments, Object options) {
if (WXEnvironment.isApkDebugable()) {
mLodBuilder.append("[WXBridgeManager] callNativeComponent >>>> instanceId:").append(instanceId)
.append(", componentRef:").append(componentRef).append(", method:").append(method).append(", arguments:").append(arguments);
WXLogUtils.d(mLodBuilder.substring(0));
mLodBuilder.setLength(0);
}
try {
WXDomModule dom = getDomModule(instanceId);
dom.invokeMethod(componentRef, method, arguments);
} catch (Exception e) {
WXLogUtils.e("[WXBridgeManager] callNative exception: ", e);
commitJSBridgeAlarmMonitor(instanceId, WXErrorCode.WX_ERR_INVOKE_NATIVE, "[WXBridgeManager] callNativeModule exception " + e.getCause());
}
return null;
}
示例5: remove
import com.taobao.weex.WXEnvironment; //导入方法依赖的package包/类
@Override
public void remove(WXComponent child, boolean destroy) {
int index = mChildren.indexOf(child);
if (destroy) {
child.detachViewAndClearPreInfo();
}
unBindViewType(child);
BounceRecyclerView view = getHostView();
if(view == null){
return;
}
view.getAdapter().notifyItemRemoved(index);
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.d(TAG, "removeChild child at " + index);
}
super.remove(child, destroy);
}
示例6: addPageView
import com.taobao.weex.WXEnvironment; //导入方法依赖的package包/类
public void addPageView(View view) {
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.d("onPageSelected >>>> addPageView");
}
views.add(view);
ensureShadow();
}
示例7: callCreateFinish
import com.taobao.weex.WXEnvironment; //导入方法依赖的package包/类
public int callCreateFinish(String instanceId, String callback) {
if (WXEnvironment.isApkDebugable()) {
mLodBuilder.append("[WXBridgeManager] callCreateFinish >>>> instanceId:").append(instanceId)
.append(", callback:").append(callback);
WXLogUtils.d(mLodBuilder.substring(0));
mLodBuilder.setLength(0);
}
if(mDestroyedInstanceId != null && mDestroyedInstanceId.contains(instanceId)) {
return IWXBridge.DESTROY_INSTANCE;
}
try {
if (WXSDKManager.getInstance().getSDKInstance(instanceId) != null) {
WXDomModule domModule = getDomModule(instanceId);
Action action = Actions.getCreateFinish();
domModule.postAction((DOMAction)action, false);
}
} catch (Exception e) {
WXLogUtils.e("[WXBridgeManager] callCreateFinish exception: ", e);
commitJSBridgeAlarmMonitor(instanceId, WXErrorCode.WX_ERROR_DOM_CREATEFINISH,"[WXBridgeManager] callCreateFinish exception " + e.getCause());
}
if (UNDEFINED.equals(callback) || NON_CALLBACK.equals(callback)) {
return IWXBridge.INSTANCE_RENDERING_ERROR;
}
// get next tick
getNextTick(instanceId, callback);
return IWXBridge.INSTANCE_RENDERING;
}
示例8: callMoveElement
import com.taobao.weex.WXEnvironment; //导入方法依赖的package包/类
public int callMoveElement(String instanceId, String ref, String parentref, String index, String callback) {
if (WXEnvironment.isApkDebugable()) {
mLodBuilder.append("[WXBridgeManager] callMoveElement >>>> instanceId:").append(instanceId)
.append(", parentref:").append(parentref)
.append(", index:").append(index)
.append(", ref:").append(ref);
WXLogUtils.d(mLodBuilder.substring(0));
mLodBuilder.setLength(0);
}
if(mDestroyedInstanceId != null && mDestroyedInstanceId.contains(instanceId)) {
return IWXBridge.DESTROY_INSTANCE;
}
try {
if (WXSDKManager.getInstance().getSDKInstance(instanceId) != null) {
WXDomModule domModule = getDomModule(instanceId);
Action action = Actions.getMoveElement(ref, parentref, Integer.parseInt(index));
domModule.postAction((DOMAction)action, false);
}
} catch (Exception e) {
WXLogUtils.e("[WXBridgeManager] callMoveElement exception: ", e);
commitJSBridgeAlarmMonitor(instanceId, WXErrorCode.WX_ERR_DOM_MOVEELEMENT,"[WXBridgeManager] callMoveElement exception " + e.getCause());
}
if (UNDEFINED.equals(callback) || NON_CALLBACK.equals(callback)) {
return IWXBridge.INSTANCE_RENDERING_ERROR;
}
// get next tick
getNextTick(instanceId, callback);
return IWXBridge.INSTANCE_RENDERING;
}
示例9: remove
import com.taobao.weex.WXEnvironment; //导入方法依赖的package包/类
/**
* Remove the child from list. This method will use {@link
* java.util.List#indexOf(Object)} to retrieve the component to be deleted. Like {@link
* #addChild(WXComponent)}, this method will not refresh the view immediately, the adapter will
* decide when to refresh.
*
* @param child the child to be removed
*/
@Override
public void remove(WXComponent child, boolean destroy) {
int index = mChildren.indexOf(child);
if (destroy) {
child.detachViewAndClearPreInfo();
}
unBindViewType(child);
T view = getHostView();
if (view == null) {
return;
}
boolean isRemoveAnimation = isRemoveAnimation(child);
if (isRemoveAnimation) {
view.getInnerView().setItemAnimator(mItemAnimator);
} else {
view.getInnerView().setItemAnimator(null);
}
view.getRecyclerViewBaseAdapter().notifyItemRemoved(index);
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.d(TAG, "removeChild child at " + index);
}
super.remove(child, destroy);
}
示例10: onDragEnd
import com.taobao.weex.WXEnvironment; //导入方法依赖的package包/类
@Override
public void onDragEnd(@NonNull WXComponent component, int from, int to) {
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.d(TAG, "list on drag end : " + "from index " + from + " to index " + to);
}
mEventTrigger.triggerEvent(EVENT_END_DRAG, buildEvent(component.getRef(), from, to));
}
示例11: generate
import com.taobao.weex.WXEnvironment; //导入方法依赖的package包/类
private synchronized void generate(){
if(WXEnvironment.isApkDebugable()) {
WXLogUtils.d(TAG, "Generate Component:" + mClz.getSimpleName());
}
mMethods = getMethods(mClz);
}
示例12: notifyAppearStateChange
import com.taobao.weex.WXEnvironment; //导入方法依赖的package包/类
@Override
public void notifyAppearStateChange(int firstVisible, int lastVisible, int directionX, int directionY) {
//notify appear state
Iterator<AppearanceHelper> it = mAppearComponents.values().iterator();
String direction = directionY > 0 ? "up" : "down";
if (getOrientation() == Constants.Orientation.HORIZONTAL) {
direction = directionX > 0 ? "left" : "right";
}
while (it.hasNext()) {
AppearanceHelper item = it.next();
WXComponent component = item.getAwareChild();
if (!item.isWatch()) {
continue;
}
boolean outOfVisibleRange = item.getCellPositionINScollable() < firstVisible || item.getCellPositionINScollable() > lastVisible;
View view = component.getHostView();
if (view == null) {
continue;
}
boolean visible = (!outOfVisibleRange) && item.isViewVisible();
int result = item.setAppearStatus(visible);
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.d("appear", "item " + item.getCellPositionINScollable() + " result " + result);
}
if (result == AppearanceHelper.RESULT_NO_CHANGE) {
continue;
}
component.notifyAppearStateChange(result == AppearanceHelper.RESULT_APPEAR ? Constants.Event.APPEAR : Constants.Event.DISAPPEAR, direction);
}
}
示例13: notifyAppearStateChange
import com.taobao.weex.WXEnvironment; //导入方法依赖的package包/类
@Override
public void notifyAppearStateChange(int firstVisible, int lastVisible, int directionX, int directionY) {
//notify appear state
Iterator<AppearanceHelper> it = mAppearComponents.values().iterator();
String direction = directionY > 0 ? Constants.Value.DIRECTION_UP :
directionY < 0 ? Constants.Value.DIRECTION_DOWN : null;
if (getOrientation() == Constants.Orientation.HORIZONTAL && directionX != 0) {
direction = directionX > 0 ? Constants.Value.DIRECTION_LEFT : Constants.Value.DIRECTION_RIGHT;
}
if (mColumnCount > 0)
visibleCellCount = (lastVisible - firstVisible) * mColumnCount;
while (it.hasNext()) {
AppearanceHelper item = it.next();
WXComponent component = item.getAwareChild();
if (!item.isWatch()) {
continue;
}
boolean outOfVisibleRange = item.getCellPositionINScollable() < firstVisible || item.getCellPositionINScollable() > lastVisible;
View view = component.getHostView();
if (view == null) {
continue;
}
boolean visible = (!outOfVisibleRange) && item.isViewVisible();
int result = item.setAppearStatus(visible);
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.d("appear", "item " + item.getCellPositionINScollable() + " result " + result);
}
if (result == AppearanceHelper.RESULT_NO_CHANGE) {
continue;
}
component.notifyAppearStateChange(result == AppearanceHelper.RESULT_APPEAR ? Constants.Event.APPEAR : Constants.Event.DISAPPEAR, direction);
}
}
示例14: addPageView
import com.taobao.weex.WXEnvironment; //导入方法依赖的package包/类
public void addPageView(View view) {
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.d("onPageSelected >>>> addPageView");
}
if (views == null) {
views = new ArrayList<>();
}
views.add(view);
this.realCount = views.size();
}
示例15: getScreenHeight
import com.taobao.weex.WXEnvironment; //导入方法依赖的package包/类
public static int getScreenHeight(Context cxt) {
if(cxt!=null){
mScreenHeight =cxt.getResources().getDisplayMetrics().heightPixels;
} else if (WXEnvironment.isApkDebugable()){
throw new WXRuntimeException("Error Context is null When getScreenHeight");
}
return mScreenHeight;
}