本文整理汇总了Java中com.taobao.weex.ui.component.WXImage类的典型用法代码示例。如果您正苦于以下问题:Java WXImage类的具体用法?Java WXImage怎么用?Java WXImage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WXImage类属于com.taobao.weex.ui.component包,在下文中一共展示了WXImage类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setImageDrawable
import com.taobao.weex.ui.component.WXImage; //导入依赖的package包/类
public void setImageDrawable(@Nullable Drawable drawable, boolean isGif) {
this.gif = isGif;
ViewGroup.LayoutParams layoutParams;
if ((layoutParams = getLayoutParams()) != null) {
Drawable wrapDrawable = ImageDrawable.createImageDrawable(drawable,
getScaleType(), borderRadius,
layoutParams.width - getPaddingLeft() - getPaddingRight(),
layoutParams.height - getPaddingTop() - getPaddingBottom(),
isGif);
if (wrapDrawable instanceof ImageDrawable) {
ImageDrawable imageDrawable = (ImageDrawable) wrapDrawable;
if (!Arrays.equals(imageDrawable.getCornerRadii(), borderRadius)) {
imageDrawable.setCornerRadii(borderRadius);
}
}
super.setImageDrawable(wrapDrawable);
if (mWeakReference != null) {
WXImage component = mWeakReference.get();
if (component != null) {
component.readyToRender();
}
}
}
}
示例2: register
import com.taobao.weex.ui.component.WXImage; //导入依赖的package包/类
private static void register() {
try {
registerComponent(WXBasicComponentType.TEXT, WXText.class, false);
registerComponent(WXBasicComponentType.IMG, WXImage.class, false);
registerComponent(WXBasicComponentType.DIV, WXDiv.class, false);
registerComponent(WXBasicComponentType.IMAGE, WXImage.class, false);
registerComponent(WXBasicComponentType.CONTAINER, WXDiv.class, false);
registerComponent(WXBasicComponentType.SCROLLER, WXScroller.class, false);
registerComponent(WXBasicComponentType.SLIDER, WXSlider.class, true);
registerComponent(WXListComponent.class, false,WXBasicComponentType.LIST,WXBasicComponentType.VLIST);
registerComponent(HorizontalListComponent.class,false,WXBasicComponentType.HLIST);
registerComponent(WXBasicComponentType.CELL, WXCell.class, true);
registerComponent(WXBasicComponentType.INDICATOR, WXIndicator.class, true);
registerComponent(WXBasicComponentType.VIDEO, WXVideo.class, false);
registerComponent(WXBasicComponentType.INPUT, WXInput.class, false);
registerComponent(WXBasicComponentType.SWITCH, WXSwitch.class, false);
registerComponent(WXBasicComponentType.A, WXA.class, false);
registerComponent(WXBasicComponentType.EMBED, WXEmbed.class, true);
registerComponent(WXBasicComponentType.WEB, WXWeb.class);
registerComponent(WXBasicComponentType.REFRESH, WXRefresh.class);
registerComponent(WXBasicComponentType.LOADING, WXLoading.class);
registerComponent(WXBasicComponentType.LOADING_INDICATOR, WXLoadingIndicator.class);
registerModule("dom", WXDomModule.class, true);
registerModule("modal", WXModalUIModule.class, false);
registerModule("instanceWrap", WXInstanceWrap.class, true);
registerModule("animation", WXAnimationModule.class, true);
registerModule("webview", WXWebViewModule.class, true);
registerModule("navigator", WXNavigatorModule.class);
registerModule("stream", WXStreamModule.class);
registerDomObject(WXBasicComponentType.TEXT, WXTextDomObject.class);
registerDomObject(WXBasicComponentType.INPUT, WXTextDomObject.class);
registerDomObject(WXBasicComponentType.SWITCH, WXSwitchDomObject.class);
} catch (WXException e) {
WXLogUtils.e("[WXSDKEngine] register:" + WXLogUtils.getStackTrace(e));
}
}
示例3: holdComponent
import com.taobao.weex.ui.component.WXImage; //导入依赖的package包/类
@Override
public void holdComponent(WXImage component) {
mWeakReference = new WeakReference<>(component);
}
示例4: getComponent
import com.taobao.weex.ui.component.WXImage; //导入依赖的package包/类
@Nullable
@Override
public WXImage getComponent() {
return null != mWeakReference ? mWeakReference.get() : null;
}