I am getting strange issue while loading image using universal image loader. I want to display image with all corners rounded, but output image is not displaying as per requirement.
Below is my code in adapter item xml -
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:id="@+id/container_rl"
android:background="@color/transparent_color"
android:layout_height="300dp">
<ImageView
android:id="@+id/object_iv"
android:scaleType="fitXY"
android:adjustViewBounds="true"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<View
android:background="@drawable/rounded_corner_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<TextView
android:id="@+id/name_tv"
android:layout_centerInParent="true"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="@dimen/space_20"
android:layout_marginRight="@dimen/space_20"
android:text="@string/app_name"
android:textColor="@color/white"
android:textSize="@dimen/size_18"/>
</RelativeLayout>
Here is code in adapter -
ImageLoaderUniversal.ImageLoadWithRoundedCorners(mContext,ImageURI, mFeedIV);
and at last code for load image -
public static void ImageLoadWithRoundedCorners(Context mContext,final String URl, final ImageView imageView){
DisplayImageOptions options = new DisplayImageOptions.Builder()
.showImageOnLoading(R.mipmap.ic_default_media)
.showImageForEmptyUri(R.mipmap.ic_default_media)
.showImageOnFail(R.mipmap.ic_default_media)
.cacheOnDisk(true)
.displayer(new RoundedBitmapDisplayer(25))
.build();
ImageLoaderConfiguration.Builder builder = new ImageLoaderConfiguration.Builder(mContext).defaultDisplayImageOptions(
options).memoryCache(new WeakMemoryCache());
ImageLoaderConfiguration config = builder.build();
imageLoader = ImageLoader.getInstance();
if (!imageLoader.isInited()) {
imageLoader.init(config.createDefault(mContext));
}
imageLoader.displayImage(URl, imageView, options);
}
Add here is scrren shot attached of how images are displaying using above code.
Please provide your solution on my problem.
TIA