com.taobao.weex.ui.view.WXImageView Java Examples
The following examples show how to use
com.taobao.weex.ui.view.WXImageView.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WXImage.java From ucar-weex-core with Apache License 2.0 | 5 votes |
@Override protected ImageView initComponentHostView(@NonNull Context context) { WXImageView view = new WXImageView(context); view.setScaleType(ScaleType.FIT_XY); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { view.setCropToPadding(true); } view.holdComponent(this); return view; }
Example #2
Source File: WXImageTest.java From ucar-weex-core with Apache License 2.0 | 5 votes |
@Test @PrepareForTest(WXImageView.class) public void testInitComponentHostView() throws Exception { ImageView imageView = mWXImage.initComponentHostView(Robolectric.setupActivity(TestActivity.class)); assertEquals(imageView.getClass(), WXImageView.class); }
Example #3
Source File: WXImageTest.java From ucar-weex-core with Apache License 2.0 | 5 votes |
@Test @PrepareForTest(WXImageView.class) public void testSetBackgroundColor() throws Exception { ImageView imageView = mWXImage.initComponentHostView(Robolectric.setupActivity(TestActivity.class)); mWXImage.mHost = imageView; mWXImage.setBackgroundColor("#FFFFFF"); Drawable drawable = mWXImage.getHostView().getBackground(); assertEquals(drawable instanceof BorderDrawable, true); }
Example #4
Source File: WXImage.java From weex-uikit with MIT License | 5 votes |
@Override protected ImageView initComponentHostView(@NonNull Context context) { WXImageView view = new WXImageView(context); view.setScaleType(ScaleType.FIT_XY); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { view.setCropToPadding(true); } view.holdComponent(this); return view; }
Example #5
Source File: WXImageTest.java From weex-uikit with MIT License | 5 votes |
@Test @PrepareForTest(WXImageView.class) public void testInitComponentHostView() throws Exception { ImageView imageView = mWXImage.initComponentHostView(Robolectric.setupActivity(TestActivity.class)); assertEquals(imageView.getClass(), WXImageView.class); }
Example #6
Source File: WXImageTest.java From weex-uikit with MIT License | 5 votes |
@Test @PrepareForTest(WXImageView.class) public void testSetBackgroundColor() throws Exception { ImageView imageView = mWXImage.initComponentHostView(Robolectric.setupActivity(TestActivity.class)); mWXImage.mHost = imageView; mWXImage.setBackgroundColor("#FFFFFF"); Drawable drawable = mWXImage.getHostView().getBackground(); assertEquals(drawable instanceof BorderDrawable, true); }
Example #7
Source File: WXImage.java From weex with Apache License 2.0 | 4 votes |
@Override protected void initView() { mHost = new WXImageView(mContext, mDomObj); ((ImageView) getView()).setScaleType(ScaleType.FIT_XY); }