@Test public void testSetProperty() throws Exception { assertTrue(component.setProperty(Constants.Name.VISIBILITY,null)); assertTrue(component.setProperty(Constants.Name.VISIBILITY, Constants.Value.VISIBLE)); assertTrue(component.setProperty(Constants.Name.DISABLED,true)); assertTrue(component.setProperty(Constants.Name.POSITION, Constants.Value.FIXED)); assertTrue(component.setProperty(Constants.Name.BACKGROUND_COLOR, "#ffffff")); assertTrue(component.setProperty(Constants.Name.OPACITY, 0.5f)); assertTrue(component.setProperty(Constants.Name.BORDER_RADIUS,0.5f)); assertTrue(component.setProperty(Constants.Name.BORDER_RADIUS,null)); assertTrue(component.setProperty(Constants.Name.BORDER_WIDTH,null)); assertTrue(component.setProperty(Constants.Name.BORDER_WIDTH,10)); assertTrue(component.setProperty(Constants.Name.BORDER_STYLE,null)); assertTrue(component.setProperty(Constants.Name.BORDER_STYLE, "SOLID")); assertTrue(component.setProperty(Constants.Name.BORDER_COLOR,null)); assertTrue(component.setProperty(Constants.Name.BORDER_COLOR, "#ff0000")); assertTrue(component.setProperty(Constants.Name.BORDER_TOP_LEFT_RADIUS, 1)); assertTrue(component.setProperty(Constants.Name.BORDER_TOP_RIGHT_RADIUS, 1)); assertTrue(component.setProperty(Constants.Name.BORDER_BOTTOM_LEFT_RADIUS, 1)); assertTrue(component.setProperty(Constants.Name.BORDER_BOTTOM_RIGHT_RADIUS, 1)); assertTrue(component.setProperty(Constants.Name.BORDER_TOP_WIDTH, 1)); assertTrue(component.setProperty(Constants.Name.BORDER_LEFT_WIDTH, 1)); assertTrue(component.setProperty(Constants.Name.BORDER_BOTTOM_WIDTH, 1)); assertTrue(component.setProperty(Constants.Name.BORDER_RIGHT_WIDTH,1)); assertTrue(component.setProperty(Constants.Name.BORDER_TOP_COLOR, "#ff0000")); assertTrue(component.setProperty(Constants.Name.BORDER_BOTTOM_COLOR, "#ff0000")); assertTrue(component.setProperty(Constants.Name.BORDER_LEFT_COLOR, "#ff0000")); assertTrue(component.setProperty(Constants.Name.BORDER_RIGHT_COLOR, "#ff0000")); assertTrue(component.setProperty(Constants.Name.WIDTH, null)); assertTrue(component.setProperty(Constants.Name.MIN_WIDTH, null)); assertTrue(component.setProperty(Constants.Name.MAX_WIDTH, null)); assertTrue(component.setProperty(Constants.Name.HEIGHT, null)); assertTrue(component.setProperty(Constants.Name.MIN_HEIGHT, null)); assertTrue(component.setProperty(Constants.Name.MAX_HEIGHT, null)); assertTrue(component.setProperty(Constants.Name.ALIGN_ITEMS, null)); assertTrue(component.setProperty(Constants.Name.ALIGN_SELF, null)); assertTrue(component.setProperty(Constants.Name.FLEX, null)); assertTrue(component.setProperty(Constants.Name.FLEX_DIRECTION, null)); assertTrue(component.setProperty(Constants.Name.JUSTIFY_CONTENT, null)); assertTrue(component.setProperty(Constants.Name.FLEX_WRAP, null)); assertTrue(component.setProperty(Constants.Name.MARGIN, null)); assertTrue(component.setProperty(Constants.Name.MARGIN_TOP, null)); assertTrue(component.setProperty(Constants.Name.MARGIN_LEFT, null)); assertTrue(component.setProperty(Constants.Name.MARGIN_RIGHT, null)); assertTrue(component.setProperty(Constants.Name.MARGIN_BOTTOM, null)); assertTrue(component.setProperty(Constants.Name.PADDING, null)); assertTrue(component.setProperty(Constants.Name.PADDING_TOP, null)); assertTrue(component.setProperty(Constants.Name.PADDING_LEFT, null)); assertTrue(component.setProperty(Constants.Name.PADDING_RIGHT, null)); assertTrue(component.setProperty(Constants.Name.PADDING_BOTTOM, null)); }
protected boolean setProperty(String key, Object param) { if(key == null){ return true; } switch (key) { case Constants.Name.PREVENT_MOVE_EVENT: if (mGesture != null) { mGesture.setPreventMoveEvent(WXUtils.getBoolean(param, false)); } return true; case Constants.Name.DISABLED: Boolean disabled = WXUtils.getBoolean(param, null); if (disabled != null) { setDisabled(disabled); setPseudoClassStatus(Constants.PSEUDO.DISABLED, disabled); } return true; case Constants.Name.POSITION: String position = WXUtils.getString(param, null); if (position != null) setSticky(position); return true; case Constants.Name.BACKGROUND_COLOR: String bgColor = WXUtils.getString(param, null); if (bgColor != null) setBackgroundColor(bgColor); return true; case Constants.Name.BACKGROUND_IMAGE: String bgImage = WXUtils.getString(param, null); if (bgImage != null && mHost != null) { setBackgroundImage(bgImage); } return true; case Constants.Name.OPACITY: Float opacity = WXUtils.getFloat(param, null); if (opacity != null) setOpacity(opacity); return true; case Constants.Name.BORDER_RADIUS: case Constants.Name.BORDER_TOP_LEFT_RADIUS: case Constants.Name.BORDER_TOP_RIGHT_RADIUS: case Constants.Name.BORDER_BOTTOM_RIGHT_RADIUS: case Constants.Name.BORDER_BOTTOM_LEFT_RADIUS: Float radius = WXUtils.getFloat(param, null); if (radius != null) setBorderRadius(key, radius); return true; case Constants.Name.BORDER_STYLE: case Constants.Name.BORDER_RIGHT_STYLE: case Constants.Name.BORDER_BOTTOM_STYLE: case Constants.Name.BORDER_LEFT_STYLE: case Constants.Name.BORDER_TOP_STYLE: String border_style = WXUtils.getString(param, null); if (border_style != null) setBorderStyle(key, border_style); return true; case Constants.Name.BORDER_COLOR: case Constants.Name.BORDER_TOP_COLOR: case Constants.Name.BORDER_RIGHT_COLOR: case Constants.Name.BORDER_BOTTOM_COLOR: case Constants.Name.BORDER_LEFT_COLOR: String border_color = WXUtils.getString(param, null); if (border_color != null) setBorderColor(key, border_color); return true; case Constants.Name.VISIBILITY: String visibility = WXUtils.getString(param, null); if (visibility != null) setVisibility(visibility); return true; case Constants.Name.ELEVATION: if (param != null) { updateElevation(); } return true; case PROP_FIXED_SIZE: String fixedSize = WXUtils.getString(param, PROP_FS_MATCH_PARENT); setFixedSize(fixedSize); return true; case Constants.Name.ARIA_LABEL: String label = WXUtils.getString(param, ""); setAriaLabel(label); return true; case Constants.Name.ARIA_HIDDEN: boolean isHidden = WXUtils.getBoolean(param, false); setAriaHidden(isHidden); return true; case Constants.Name.WIDTH: case Constants.Name.MIN_WIDTH: case Constants.Name.MAX_WIDTH: case Constants.Name.HEIGHT: case Constants.Name.MIN_HEIGHT: case Constants.Name.MAX_HEIGHT: case Constants.Name.ALIGN_ITEMS: case Constants.Name.ALIGN_SELF: case Constants.Name.FLEX: case Constants.Name.FLEX_DIRECTION: case Constants.Name.JUSTIFY_CONTENT: case Constants.Name.FLEX_WRAP: case Constants.Name.MARGIN: case Constants.Name.MARGIN_TOP: case Constants.Name.MARGIN_LEFT: case Constants.Name.MARGIN_RIGHT: case Constants.Name.MARGIN_BOTTOM: case Constants.Name.PADDING: case Constants.Name.PADDING_TOP: case Constants.Name.PADDING_LEFT: case Constants.Name.PADDING_RIGHT: case Constants.Name.PADDING_BOTTOM: case Constants.Name.BORDER_WIDTH: case Constants.Name.BORDER_TOP_WIDTH: case Constants.Name.BORDER_RIGHT_WIDTH: case Constants.Name.BORDER_BOTTOM_WIDTH: case Constants.Name.BORDER_LEFT_WIDTH: case Constants.Name.LEFT: case Constants.Name.TOP: case Constants.Name.RIGHT: case Constants.Name.BOTTOM: return true; case Constants.Name.BOX_SHADOW: try { updateBoxShadow(); } catch (Throwable t) { t.printStackTrace(); } return true; case Constants.Name.ROLE: setRole(WXUtils.getString(param, "")); return true; default: return false; } }
WXComponent extends WXBasicComponent implements IWXObject, IWXActivityStateListener, OnActivePseudoListner { protected boolean setProperty(String key, Object param) { if(key == null){ return true; } switch (key) { case Constants.Name.PREVENT_MOVE_EVENT: if (mGesture != null) { mGesture.setPreventMoveEvent(WXUtils.getBoolean(param, false)); } return true; case Constants.Name.DISABLED: Boolean disabled = WXUtils.getBoolean(param, null); if (disabled != null) { setDisabled(disabled); setPseudoClassStatus(Constants.PSEUDO.DISABLED, disabled); } return true; case Constants.Name.POSITION: String position = WXUtils.getString(param, null); if (position != null) setSticky(position); return true; case Constants.Name.BACKGROUND_COLOR: String bgColor = WXUtils.getString(param, null); if (bgColor != null) setBackgroundColor(bgColor); return true; case Constants.Name.BACKGROUND_IMAGE: String bgImage = WXUtils.getString(param, null); if (bgImage != null && mHost != null) { setBackgroundImage(bgImage); } return true; case Constants.Name.OPACITY: Float opacity = WXUtils.getFloat(param, null); if (opacity != null) setOpacity(opacity); return true; case Constants.Name.BORDER_RADIUS: case Constants.Name.BORDER_TOP_LEFT_RADIUS: case Constants.Name.BORDER_TOP_RIGHT_RADIUS: case Constants.Name.BORDER_BOTTOM_RIGHT_RADIUS: case Constants.Name.BORDER_BOTTOM_LEFT_RADIUS: Float radius = WXUtils.getFloat(param, null); if (radius != null) setBorderRadius(key, radius); return true; case Constants.Name.BORDER_STYLE: case Constants.Name.BORDER_RIGHT_STYLE: case Constants.Name.BORDER_BOTTOM_STYLE: case Constants.Name.BORDER_LEFT_STYLE: case Constants.Name.BORDER_TOP_STYLE: String border_style = WXUtils.getString(param, null); if (border_style != null) setBorderStyle(key, border_style); return true; case Constants.Name.BORDER_COLOR: case Constants.Name.BORDER_TOP_COLOR: case Constants.Name.BORDER_RIGHT_COLOR: case Constants.Name.BORDER_BOTTOM_COLOR: case Constants.Name.BORDER_LEFT_COLOR: String border_color = WXUtils.getString(param, null); if (border_color != null) setBorderColor(key, border_color); return true; case Constants.Name.VISIBILITY: String visibility = WXUtils.getString(param, null); if (visibility != null) setVisibility(visibility); return true; case Constants.Name.ELEVATION: if (param != null) { updateElevation(); } return true; case PROP_FIXED_SIZE: String fixedSize = WXUtils.getString(param, PROP_FS_MATCH_PARENT); setFixedSize(fixedSize); return true; case Constants.Name.ARIA_LABEL: String label = WXUtils.getString(param, ""); setAriaLabel(label); return true; case Constants.Name.ARIA_HIDDEN: boolean isHidden = WXUtils.getBoolean(param, false); setAriaHidden(isHidden); return true; case Constants.Name.WIDTH: case Constants.Name.MIN_WIDTH: case Constants.Name.MAX_WIDTH: case Constants.Name.HEIGHT: case Constants.Name.MIN_HEIGHT: case Constants.Name.MAX_HEIGHT: case Constants.Name.ALIGN_ITEMS: case Constants.Name.ALIGN_SELF: case Constants.Name.FLEX: case Constants.Name.FLEX_DIRECTION: case Constants.Name.JUSTIFY_CONTENT: case Constants.Name.FLEX_WRAP: case Constants.Name.MARGIN: case Constants.Name.MARGIN_TOP: case Constants.Name.MARGIN_LEFT: case Constants.Name.MARGIN_RIGHT: case Constants.Name.MARGIN_BOTTOM: case Constants.Name.PADDING: case Constants.Name.PADDING_TOP: case Constants.Name.PADDING_LEFT: case Constants.Name.PADDING_RIGHT: case Constants.Name.PADDING_BOTTOM: case Constants.Name.BORDER_WIDTH: case Constants.Name.BORDER_TOP_WIDTH: case Constants.Name.BORDER_RIGHT_WIDTH: case Constants.Name.BORDER_BOTTOM_WIDTH: case Constants.Name.BORDER_LEFT_WIDTH: case Constants.Name.LEFT: case Constants.Name.TOP: case Constants.Name.RIGHT: case Constants.Name.BOTTOM: return true; case Constants.Name.BOX_SHADOW: try { updateBoxShadow(); } catch (Throwable t) { t.printStackTrace(); } return true; case Constants.Name.ROLE: setRole(WXUtils.getString(param, "")); return true; default: return false; } } }
WXComponent extends WXBasicComponent implements IWXObject, IWXActivityStateListener, OnActivePseudoListner { protected boolean setProperty(String key, Object param) { if(key == null){ return true; } switch (key) { case Constants.Name.PREVENT_MOVE_EVENT: if (mGesture != null) { mGesture.setPreventMoveEvent(WXUtils.getBoolean(param, false)); } return true; case Constants.Name.DISABLED: Boolean disabled = WXUtils.getBoolean(param, null); if (disabled != null) { setDisabled(disabled); setPseudoClassStatus(Constants.PSEUDO.DISABLED, disabled); } return true; case Constants.Name.POSITION: String position = WXUtils.getString(param, null); if (position != null) setSticky(position); return true; case Constants.Name.BACKGROUND_COLOR: String bgColor = WXUtils.getString(param, null); if (bgColor != null) setBackgroundColor(bgColor); return true; case Constants.Name.BACKGROUND_IMAGE: String bgImage = WXUtils.getString(param, null); if (bgImage != null && mHost != null) { setBackgroundImage(bgImage); } return true; case Constants.Name.OPACITY: Float opacity = WXUtils.getFloat(param, null); if (opacity != null) setOpacity(opacity); return true; case Constants.Name.BORDER_RADIUS: case Constants.Name.BORDER_TOP_LEFT_RADIUS: case Constants.Name.BORDER_TOP_RIGHT_RADIUS: case Constants.Name.BORDER_BOTTOM_RIGHT_RADIUS: case Constants.Name.BORDER_BOTTOM_LEFT_RADIUS: Float radius = WXUtils.getFloat(param, null); if (radius != null) setBorderRadius(key, radius); return true; case Constants.Name.BORDER_STYLE: case Constants.Name.BORDER_RIGHT_STYLE: case Constants.Name.BORDER_BOTTOM_STYLE: case Constants.Name.BORDER_LEFT_STYLE: case Constants.Name.BORDER_TOP_STYLE: String border_style = WXUtils.getString(param, null); if (border_style != null) setBorderStyle(key, border_style); return true; case Constants.Name.BORDER_COLOR: case Constants.Name.BORDER_TOP_COLOR: case Constants.Name.BORDER_RIGHT_COLOR: case Constants.Name.BORDER_BOTTOM_COLOR: case Constants.Name.BORDER_LEFT_COLOR: String border_color = WXUtils.getString(param, null); if (border_color != null) setBorderColor(key, border_color); return true; case Constants.Name.VISIBILITY: String visibility = WXUtils.getString(param, null); if (visibility != null) setVisibility(visibility); return true; case Constants.Name.ELEVATION: if (param != null) { updateElevation(); } return true; case PROP_FIXED_SIZE: String fixedSize = WXUtils.getString(param, PROP_FS_MATCH_PARENT); setFixedSize(fixedSize); return true; case Constants.Name.ARIA_LABEL: String label = WXUtils.getString(param, ""); setAriaLabel(label); return true; case Constants.Name.ARIA_HIDDEN: boolean isHidden = WXUtils.getBoolean(param, false); setAriaHidden(isHidden); return true; case Constants.Name.WIDTH: case Constants.Name.MIN_WIDTH: case Constants.Name.MAX_WIDTH: case Constants.Name.HEIGHT: case Constants.Name.MIN_HEIGHT: case Constants.Name.MAX_HEIGHT: case Constants.Name.ALIGN_ITEMS: case Constants.Name.ALIGN_SELF: case Constants.Name.FLEX: case Constants.Name.FLEX_DIRECTION: case Constants.Name.JUSTIFY_CONTENT: case Constants.Name.FLEX_WRAP: case Constants.Name.MARGIN: case Constants.Name.MARGIN_TOP: case Constants.Name.MARGIN_LEFT: case Constants.Name.MARGIN_RIGHT: case Constants.Name.MARGIN_BOTTOM: case Constants.Name.PADDING: case Constants.Name.PADDING_TOP: case Constants.Name.PADDING_LEFT: case Constants.Name.PADDING_RIGHT: case Constants.Name.PADDING_BOTTOM: case Constants.Name.BORDER_WIDTH: case Constants.Name.BORDER_TOP_WIDTH: case Constants.Name.BORDER_RIGHT_WIDTH: case Constants.Name.BORDER_BOTTOM_WIDTH: case Constants.Name.BORDER_LEFT_WIDTH: case Constants.Name.LEFT: case Constants.Name.TOP: case Constants.Name.RIGHT: case Constants.Name.BOTTOM: return true; case Constants.Name.BOX_SHADOW: try { updateBoxShadow(); } catch (Throwable t) { t.printStackTrace(); } return true; case Constants.Name.ROLE: setRole(WXUtils.getString(param, "")); return true; default: return false; } } @Deprecated  WXComponent(WXSDKInstance instance, WXVContainer parent, String instanceId, boolean isLazy, BasicComponentData basicComponentData); @Deprecated  WXComponent(WXSDKInstance instance, WXVContainer parent, boolean isLazy, BasicComponentData basicComponentData);  WXComponent(WXSDKInstance instance, WXVContainer parent, BasicComponentData basicComponentData);  WXComponent(WXSDKInstance instance, WXVContainer parent, int type, BasicComponentData basicComponentData); }
WXComponent extends WXBasicComponent implements IWXObject, IWXActivityStateListener, OnActivePseudoListner { protected boolean setProperty(String key, Object param) { if(key == null){ return true; } switch (key) { case Constants.Name.PREVENT_MOVE_EVENT: if (mGesture != null) { mGesture.setPreventMoveEvent(WXUtils.getBoolean(param, false)); } return true; case Constants.Name.DISABLED: Boolean disabled = WXUtils.getBoolean(param, null); if (disabled != null) { setDisabled(disabled); setPseudoClassStatus(Constants.PSEUDO.DISABLED, disabled); } return true; case Constants.Name.POSITION: String position = WXUtils.getString(param, null); if (position != null) setSticky(position); return true; case Constants.Name.BACKGROUND_COLOR: String bgColor = WXUtils.getString(param, null); if (bgColor != null) setBackgroundColor(bgColor); return true; case Constants.Name.BACKGROUND_IMAGE: String bgImage = WXUtils.getString(param, null); if (bgImage != null && mHost != null) { setBackgroundImage(bgImage); } return true; case Constants.Name.OPACITY: Float opacity = WXUtils.getFloat(param, null); if (opacity != null) setOpacity(opacity); return true; case Constants.Name.BORDER_RADIUS: case Constants.Name.BORDER_TOP_LEFT_RADIUS: case Constants.Name.BORDER_TOP_RIGHT_RADIUS: case Constants.Name.BORDER_BOTTOM_RIGHT_RADIUS: case Constants.Name.BORDER_BOTTOM_LEFT_RADIUS: Float radius = WXUtils.getFloat(param, null); if (radius != null) setBorderRadius(key, radius); return true; case Constants.Name.BORDER_STYLE: case Constants.Name.BORDER_RIGHT_STYLE: case Constants.Name.BORDER_BOTTOM_STYLE: case Constants.Name.BORDER_LEFT_STYLE: case Constants.Name.BORDER_TOP_STYLE: String border_style = WXUtils.getString(param, null); if (border_style != null) setBorderStyle(key, border_style); return true; case Constants.Name.BORDER_COLOR: case Constants.Name.BORDER_TOP_COLOR: case Constants.Name.BORDER_RIGHT_COLOR: case Constants.Name.BORDER_BOTTOM_COLOR: case Constants.Name.BORDER_LEFT_COLOR: String border_color = WXUtils.getString(param, null); if (border_color != null) setBorderColor(key, border_color); return true; case Constants.Name.VISIBILITY: String visibility = WXUtils.getString(param, null); if (visibility != null) setVisibility(visibility); return true; case Constants.Name.ELEVATION: if (param != null) { updateElevation(); } return true; case PROP_FIXED_SIZE: String fixedSize = WXUtils.getString(param, PROP_FS_MATCH_PARENT); setFixedSize(fixedSize); return true; case Constants.Name.ARIA_LABEL: String label = WXUtils.getString(param, ""); setAriaLabel(label); return true; case Constants.Name.ARIA_HIDDEN: boolean isHidden = WXUtils.getBoolean(param, false); setAriaHidden(isHidden); return true; case Constants.Name.WIDTH: case Constants.Name.MIN_WIDTH: case Constants.Name.MAX_WIDTH: case Constants.Name.HEIGHT: case Constants.Name.MIN_HEIGHT: case Constants.Name.MAX_HEIGHT: case Constants.Name.ALIGN_ITEMS: case Constants.Name.ALIGN_SELF: case Constants.Name.FLEX: case Constants.Name.FLEX_DIRECTION: case Constants.Name.JUSTIFY_CONTENT: case Constants.Name.FLEX_WRAP: case Constants.Name.MARGIN: case Constants.Name.MARGIN_TOP: case Constants.Name.MARGIN_LEFT: case Constants.Name.MARGIN_RIGHT: case Constants.Name.MARGIN_BOTTOM: case Constants.Name.PADDING: case Constants.Name.PADDING_TOP: case Constants.Name.PADDING_LEFT: case Constants.Name.PADDING_RIGHT: case Constants.Name.PADDING_BOTTOM: case Constants.Name.BORDER_WIDTH: case Constants.Name.BORDER_TOP_WIDTH: case Constants.Name.BORDER_RIGHT_WIDTH: case Constants.Name.BORDER_BOTTOM_WIDTH: case Constants.Name.BORDER_LEFT_WIDTH: case Constants.Name.LEFT: case Constants.Name.TOP: case Constants.Name.RIGHT: case Constants.Name.BOTTOM: return true; case Constants.Name.BOX_SHADOW: try { updateBoxShadow(); } catch (Throwable t) { t.printStackTrace(); } return true; case Constants.Name.ROLE: setRole(WXUtils.getString(param, "")); return true; default: return false; } } @Deprecated  WXComponent(WXSDKInstance instance, WXVContainer parent, String instanceId, boolean isLazy, BasicComponentData basicComponentData); @Deprecated  WXComponent(WXSDKInstance instance, WXVContainer parent, boolean isLazy, BasicComponentData basicComponentData);  WXComponent(WXSDKInstance instance, WXVContainer parent, BasicComponentData basicComponentData);  WXComponent(WXSDKInstance instance, WXVContainer parent, int type, BasicComponentData basicComponentData); void updateStyles(WXComponent component); void updateStyles(Map<String, Object> styles); void updateAttrs(WXComponent component); void updateAttrs(Map<String, Object> attrs); void setPadding(CSSShorthand padding, CSSShorthand border); void addEvent(final String type); void bindHolder(IFComponentHolder holder); WXSDKInstance getInstance(); Context getContext(); String getAttrByKey(String key); void postAnimation(WXAnimationModule.AnimationHolder holder); @RestrictTo(RestrictTo.Scope.LIBRARY) boolean isFlatUIEnabled(); String getInstanceId(); Rect getComponentSize(); final void invoke(String method, JSONArray args); final void fireEvent(String type); final void fireEvent(String type, Map<String, Object> params); final EventResult fireEventWait(String type, Map<String, Object> params); Object findTypeParent(WXComponent component, Class type); boolean isLazy(); void bindData(WXComponent component); void applyLayoutAndEvent(WXComponent component); void setDemission(GraphicSize size, GraphicPosition position); void updateDemission(float top, float bottom, float left, float right, float height, float width); void applyLayoutOnly(); void refreshData(WXComponent component); @Deprecated void updateProperties(Map<String, Object> props); final void setLayout(WXComponent component); int getLayoutTopOffsetForSibling(); View getRealView(); Scrollable getParentScroller(); @Nullable Scrollable getFirstScroller(); WXVContainer getParent(); final void createView(); T getHostView(); @Deprecated View getView(); int getAbsoluteY(); int getAbsoluteX(); void removeEvent(String type); void removeAllEvent(); final void removeStickyStyle(); boolean isSticky(); boolean isFixed(); void setDisabled(boolean disabled); boolean isDisabled(); void setSticky(String sticky); void setBackgroundColor(String color); void setBackgroundImage(@NonNull String bgImage); void setOpacity(float opacity); void setBorderRadius(String key, float borderRadius); void setBorderWidth(String key, float borderWidth); void setBorderStyle(String key, String borderStyle); void setBorderColor(String key, String borderColor); @Nullable String getVisibility(); void setVisibility(String visibility); @Deprecated void registerActivityStateListener(); void onActivityCreate(); void onActivityStart(); void onActivityPause(); void onActivityResume(); void onActivityStop(); void onActivityDestroy(); boolean onActivityBack(); void onActivityResult(int requestCode, int resultCode, Intent data); boolean onCreateOptionsMenu(Menu menu); void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults); void recycled(); void destroy(); boolean isDestoryed(); View detachViewAndClearPreInfo(); void clearPreLayout(); void computeVisiblePointInViewCoordinate(PointF pointF); boolean containsGesture(WXGestureType WXGestureType); boolean containsEvent(String event); void notifyAppearStateChange(String wxEventType, String direction); boolean isUsing(); void setUsing(boolean using); void readyToRender(); boolean isVirtualComponent(); void removeVirtualComponent(); int getType(); boolean hasScrollParent(WXComponent component); @Override void updateActivePseudo(boolean isSet); int getStickyOffset(); boolean canRecycled(); void setStickyOffset(int stickyOffset); boolean isLayerTypeEnabled(); void setNeedLayoutOnAnimation(boolean need); void notifyNativeSizeChanged(int w, int h); @CallSuper void onRenderFinish(@RenderState int state); boolean isWaste(); void setWaste(boolean waste); String getViewTreeKey(); WXTransition getTransition(); void setTransition(WXTransition transition); void addAnimationForElement(Map<String, Object> animMap); void lazy(boolean lazy); long getRenderObjectPtr(); void updateNativeAttr(String key, Object value); void nativeUpdateAttrs(Map<String, Object> dynamic); void updateNativeStyle(String key, Object value); void updateNativeStyles(Map<String, Object> dynamic); void addLayerOverFlowListener(String ref); void removeLayerOverFlowListener(String ref); }
WXComponent extends WXBasicComponent implements IWXObject, IWXActivityStateListener, OnActivePseudoListner { protected boolean setProperty(String key, Object param) { if(key == null){ return true; } switch (key) { case Constants.Name.PREVENT_MOVE_EVENT: if (mGesture != null) { mGesture.setPreventMoveEvent(WXUtils.getBoolean(param, false)); } return true; case Constants.Name.DISABLED: Boolean disabled = WXUtils.getBoolean(param, null); if (disabled != null) { setDisabled(disabled); setPseudoClassStatus(Constants.PSEUDO.DISABLED, disabled); } return true; case Constants.Name.POSITION: String position = WXUtils.getString(param, null); if (position != null) setSticky(position); return true; case Constants.Name.BACKGROUND_COLOR: String bgColor = WXUtils.getString(param, null); if (bgColor != null) setBackgroundColor(bgColor); return true; case Constants.Name.BACKGROUND_IMAGE: String bgImage = WXUtils.getString(param, null); if (bgImage != null && mHost != null) { setBackgroundImage(bgImage); } return true; case Constants.Name.OPACITY: Float opacity = WXUtils.getFloat(param, null); if (opacity != null) setOpacity(opacity); return true; case Constants.Name.BORDER_RADIUS: case Constants.Name.BORDER_TOP_LEFT_RADIUS: case Constants.Name.BORDER_TOP_RIGHT_RADIUS: case Constants.Name.BORDER_BOTTOM_RIGHT_RADIUS: case Constants.Name.BORDER_BOTTOM_LEFT_RADIUS: Float radius = WXUtils.getFloat(param, null); if (radius != null) setBorderRadius(key, radius); return true; case Constants.Name.BORDER_STYLE: case Constants.Name.BORDER_RIGHT_STYLE: case Constants.Name.BORDER_BOTTOM_STYLE: case Constants.Name.BORDER_LEFT_STYLE: case Constants.Name.BORDER_TOP_STYLE: String border_style = WXUtils.getString(param, null); if (border_style != null) setBorderStyle(key, border_style); return true; case Constants.Name.BORDER_COLOR: case Constants.Name.BORDER_TOP_COLOR: case Constants.Name.BORDER_RIGHT_COLOR: case Constants.Name.BORDER_BOTTOM_COLOR: case Constants.Name.BORDER_LEFT_COLOR: String border_color = WXUtils.getString(param, null); if (border_color != null) setBorderColor(key, border_color); return true; case Constants.Name.VISIBILITY: String visibility = WXUtils.getString(param, null); if (visibility != null) setVisibility(visibility); return true; case Constants.Name.ELEVATION: if (param != null) { updateElevation(); } return true; case PROP_FIXED_SIZE: String fixedSize = WXUtils.getString(param, PROP_FS_MATCH_PARENT); setFixedSize(fixedSize); return true; case Constants.Name.ARIA_LABEL: String label = WXUtils.getString(param, ""); setAriaLabel(label); return true; case Constants.Name.ARIA_HIDDEN: boolean isHidden = WXUtils.getBoolean(param, false); setAriaHidden(isHidden); return true; case Constants.Name.WIDTH: case Constants.Name.MIN_WIDTH: case Constants.Name.MAX_WIDTH: case Constants.Name.HEIGHT: case Constants.Name.MIN_HEIGHT: case Constants.Name.MAX_HEIGHT: case Constants.Name.ALIGN_ITEMS: case Constants.Name.ALIGN_SELF: case Constants.Name.FLEX: case Constants.Name.FLEX_DIRECTION: case Constants.Name.JUSTIFY_CONTENT: case Constants.Name.FLEX_WRAP: case Constants.Name.MARGIN: case Constants.Name.MARGIN_TOP: case Constants.Name.MARGIN_LEFT: case Constants.Name.MARGIN_RIGHT: case Constants.Name.MARGIN_BOTTOM: case Constants.Name.PADDING: case Constants.Name.PADDING_TOP: case Constants.Name.PADDING_LEFT: case Constants.Name.PADDING_RIGHT: case Constants.Name.PADDING_BOTTOM: case Constants.Name.BORDER_WIDTH: case Constants.Name.BORDER_TOP_WIDTH: case Constants.Name.BORDER_RIGHT_WIDTH: case Constants.Name.BORDER_BOTTOM_WIDTH: case Constants.Name.BORDER_LEFT_WIDTH: case Constants.Name.LEFT: case Constants.Name.TOP: case Constants.Name.RIGHT: case Constants.Name.BOTTOM: return true; case Constants.Name.BOX_SHADOW: try { updateBoxShadow(); } catch (Throwable t) { t.printStackTrace(); } return true; case Constants.Name.ROLE: setRole(WXUtils.getString(param, "")); return true; default: return false; } } @Deprecated  WXComponent(WXSDKInstance instance, WXVContainer parent, String instanceId, boolean isLazy, BasicComponentData basicComponentData); @Deprecated  WXComponent(WXSDKInstance instance, WXVContainer parent, boolean isLazy, BasicComponentData basicComponentData);  WXComponent(WXSDKInstance instance, WXVContainer parent, BasicComponentData basicComponentData);  WXComponent(WXSDKInstance instance, WXVContainer parent, int type, BasicComponentData basicComponentData); void updateStyles(WXComponent component); void updateStyles(Map<String, Object> styles); void updateAttrs(WXComponent component); void updateAttrs(Map<String, Object> attrs); void setPadding(CSSShorthand padding, CSSShorthand border); void addEvent(final String type); void bindHolder(IFComponentHolder holder); WXSDKInstance getInstance(); Context getContext(); String getAttrByKey(String key); void postAnimation(WXAnimationModule.AnimationHolder holder); @RestrictTo(RestrictTo.Scope.LIBRARY) boolean isFlatUIEnabled(); String getInstanceId(); Rect getComponentSize(); final void invoke(String method, JSONArray args); final void fireEvent(String type); final void fireEvent(String type, Map<String, Object> params); final EventResult fireEventWait(String type, Map<String, Object> params); Object findTypeParent(WXComponent component, Class type); boolean isLazy(); void bindData(WXComponent component); void applyLayoutAndEvent(WXComponent component); void setDemission(GraphicSize size, GraphicPosition position); void updateDemission(float top, float bottom, float left, float right, float height, float width); void applyLayoutOnly(); void refreshData(WXComponent component); @Deprecated void updateProperties(Map<String, Object> props); final void setLayout(WXComponent component); int getLayoutTopOffsetForSibling(); View getRealView(); Scrollable getParentScroller(); @Nullable Scrollable getFirstScroller(); WXVContainer getParent(); final void createView(); T getHostView(); @Deprecated View getView(); int getAbsoluteY(); int getAbsoluteX(); void removeEvent(String type); void removeAllEvent(); final void removeStickyStyle(); boolean isSticky(); boolean isFixed(); void setDisabled(boolean disabled); boolean isDisabled(); void setSticky(String sticky); void setBackgroundColor(String color); void setBackgroundImage(@NonNull String bgImage); void setOpacity(float opacity); void setBorderRadius(String key, float borderRadius); void setBorderWidth(String key, float borderWidth); void setBorderStyle(String key, String borderStyle); void setBorderColor(String key, String borderColor); @Nullable String getVisibility(); void setVisibility(String visibility); @Deprecated void registerActivityStateListener(); void onActivityCreate(); void onActivityStart(); void onActivityPause(); void onActivityResume(); void onActivityStop(); void onActivityDestroy(); boolean onActivityBack(); void onActivityResult(int requestCode, int resultCode, Intent data); boolean onCreateOptionsMenu(Menu menu); void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults); void recycled(); void destroy(); boolean isDestoryed(); View detachViewAndClearPreInfo(); void clearPreLayout(); void computeVisiblePointInViewCoordinate(PointF pointF); boolean containsGesture(WXGestureType WXGestureType); boolean containsEvent(String event); void notifyAppearStateChange(String wxEventType, String direction); boolean isUsing(); void setUsing(boolean using); void readyToRender(); boolean isVirtualComponent(); void removeVirtualComponent(); int getType(); boolean hasScrollParent(WXComponent component); @Override void updateActivePseudo(boolean isSet); int getStickyOffset(); boolean canRecycled(); void setStickyOffset(int stickyOffset); boolean isLayerTypeEnabled(); void setNeedLayoutOnAnimation(boolean need); void notifyNativeSizeChanged(int w, int h); @CallSuper void onRenderFinish(@RenderState int state); boolean isWaste(); void setWaste(boolean waste); String getViewTreeKey(); WXTransition getTransition(); void setTransition(WXTransition transition); void addAnimationForElement(Map<String, Object> animMap); void lazy(boolean lazy); long getRenderObjectPtr(); void updateNativeAttr(String key, Object value); void nativeUpdateAttrs(Map<String, Object> dynamic); void updateNativeStyle(String key, Object value); void updateNativeStyles(Map<String, Object> dynamic); void addLayerOverFlowListener(String ref); void removeLayerOverFlowListener(String ref); static final String PROP_FIXED_SIZE; static final String PROP_FS_MATCH_PARENT; static final String PROP_FS_WRAP_CONTENT; static final String TYPE; static final String ROOT; public WXTracing.TraceInfo mTraceInfo; static final int TYPE_COMMON; static final int TYPE_VIRTUAL; static final int STATE_DOM_FINISH; static final int STATE_UI_FINISH; static final int STATE_ALL_FINISH; }