本文整理汇总了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();
}
}
}
}
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:25,代码来源:WXImageView.java
示例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));
}
}
开发者ID:Laisly,项目名称:weex,代码行数:40,代码来源:WXSDKEngine.java
示例3: holdComponent
import com.taobao.weex.ui.component.WXImage; //导入依赖的package包/类
@Override
public void holdComponent(WXImage component) {
mWeakReference = new WeakReference<>(component);
}
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:5,代码来源:WXImageView.java
示例4: getComponent
import com.taobao.weex.ui.component.WXImage; //导入依赖的package包/类
@Nullable
@Override
public WXImage getComponent() {
return null != mWeakReference ? mWeakReference.get() : null;
}
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:6,代码来源:WXImageView.java
注:本文中的com.taobao.weex.ui.component.WXImage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论