org.xutils.image.ImageOptions Java Examples

The following examples show how to use org.xutils.image.ImageOptions. 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: MainActivity.java    From RoundImageView with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    circleImageViewGlide = (CircleImageView) findViewById(R.id.circle_image_glide);
    roundImageViewPicasso = (RoundImageView) findViewById(R.id.round_image_picasso);
    roundImageViewXutils = (RoundImageView) findViewById(R.id.round_image_xutils);

    Glide.with(this).load("http://img2.imgtn.bdimg.com/it/u=1939271907,257307689&fm=21&gp=0.jpg").into(circleImageViewGlide);

    Picasso.with(this).load("http://img0.imgtn.bdimg.com/it/u=2263418180,3668836868&fm=206&gp=0.jpg").fit().into(roundImageViewPicasso);

    x.image().bind(roundImageViewXutils, "http://img0.imgtn.bdimg.com/it/u=2263418180,3668836868&fm=206&gp=0.jpg",
            new ImageOptions.Builder().setCrop(true).build());
}
 
Example #2
Source File: XUtils3ImageLoader.java    From ImagePicker with Apache License 2.0 5 votes vote down vote up
@Override
public void displayImage(Activity activity, String path, ImageView imageView, int width, int height) {
    ImageOptions options = new ImageOptions.Builder()//
            .setLoadingDrawableId(R.drawable.ic_default_image)//
            .setFailureDrawableId(R.drawable.ic_default_image)//
            .setConfig(Bitmap.Config.RGB_565)//
            .setSize(width, height)//
            .setCrop(false)//
            .setUseMemCache(true)//
            .build();
    x.image().bind(imageView, Uri.fromFile(new File(path)).toString(), options);
}
 
Example #3
Source File: XUtils3ImageLoader.java    From ImagePicker with Apache License 2.0 5 votes vote down vote up
@Override
public void displayImagePreview(Activity activity, String path, ImageView imageView, int width, int height) {
    ImageOptions options = new ImageOptions.Builder()//
            .setConfig(Bitmap.Config.RGB_565)//
            .setSize(width, height)//
            .setCrop(false)//
            .setUseMemCache(true)//
            .build();
    x.image().bind(imageView, Uri.fromFile(new File(path)).toString(), options);
}
 
Example #4
Source File: XUtilsImageLoader.java    From GalleryFinal with Apache License 2.0 5 votes vote down vote up
@Override
public void displayImage(Activity activity, String path, GFImageView imageView, Drawable defaultDrawable, int width, int height) {
    ImageOptions options = new ImageOptions.Builder()
            .setLoadingDrawable(defaultDrawable)
            .setFailureDrawable(defaultDrawable)
            .setConfig(mImageConfig)
            .setSize(width, height)
            .setCrop(true)
            .setUseMemCache(false)
            .build();
    x.image().bind(imageView, "file://" + path, options);

}