Search in sources :

Example 21 with SimpleDraweeView

use of com.facebook.drawee.view.SimpleDraweeView in project BigImageViewer by Piasy.

the class FrescoImageViewFactory method loadAnimatedContent.

@Override
public final void loadAnimatedContent(final View view, final int imageType, final File imageFile) {
    if (view instanceof SimpleDraweeView) {
        final DraweeController controller = Fresco.newDraweeControllerBuilder().setUri(Uri.parse("file://" + imageFile.getAbsolutePath())).setAutoPlayAnimations(true).build();
        ((SimpleDraweeView) view).setController(controller);
    }
}
Also used : SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) DraweeController(com.facebook.drawee.interfaces.DraweeController)

Example 22 with SimpleDraweeView

use of com.facebook.drawee.view.SimpleDraweeView in project BigImageViewer by Piasy.

the class FrescoImageViewFactory method loadThumbnailContent.

@Override
public void loadThumbnailContent(final View view, final Uri thumbnail) {
    if (view instanceof SimpleDraweeView) {
        final DraweeController controller = Fresco.newDraweeControllerBuilder().setUri(thumbnail).build();
        ((SimpleDraweeView) view).setController(controller);
    }
}
Also used : SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) DraweeController(com.facebook.drawee.interfaces.DraweeController)

Example 23 with SimpleDraweeView

use of com.facebook.drawee.view.SimpleDraweeView in project BigImageViewer by Piasy.

the class FrescoImageViewFactory method createAnimatedImageView.

@Override
protected final View createAnimatedImageView(final Context context, final int imageType, int initScaleType) {
    final SimpleDraweeView view = new SimpleDraweeView(context);
    view.getHierarchy().setActualImageScaleType(scaleType(initScaleType));
    return view;
}
Also used : SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView)

Example 24 with SimpleDraweeView

use of com.facebook.drawee.view.SimpleDraweeView in project ride-read-android by Ride-Read.

the class NineGridImgView method getImageView.

/**
 * 获得 ImageView
 * 保证了 ImageView 的重用
 *
 * @param position 位置
 */
private SimpleDraweeView getImageView(final int position) {
    if (position < mImageViewList.size()) {
        return mImageViewList.get(position);
    } else {
        if (mAdapter != null) {
            SimpleDraweeView imageView = mAdapter.generateImageView(getContext());
            mImageViewList.add(imageView);
            imageView.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    mAdapter.onItemImageClick(getContext(), imageView, position, mImgDataList);
                }
            });
            return imageView;
        } else {
            Log.e("NineGirdImageView", "Your must set a NineGridImageViewAdapter for NineGirdImageView");
            return null;
        }
    }
}
Also used : SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) View(android.view.View)

Example 25 with SimpleDraweeView

use of com.facebook.drawee.view.SimpleDraweeView in project ride-read-android by Ride-Read.

the class NineGridImgView method setImagesData.

/**
 * 设置图片数据
 *
 * @param lists 图片数据集合
 */
public void setImagesData(List lists) {
    if (lists == null || lists.isEmpty()) {
        this.setVisibility(GONE);
        return;
    } else {
        this.setVisibility(VISIBLE);
    }
    if (mMaxSize > 0 && lists.size() > mMaxSize) {
        lists = lists.subList(0, mMaxSize);
    }
    int[] gridParam = calculateGridParam(lists.size(), mShowStyle);
    mRowCount = gridParam[0];
    mColumnCount = gridParam[1];
    if (mImgDataList == null) {
        int i = 0;
        while (i < lists.size()) {
            SimpleDraweeView iv = getImageView(i);
            if (iv == null) {
                return;
            }
            addView(iv, generateDefaultLayoutParams());
            i++;
        }
    } else {
        int oldViewCount = mImgDataList.size();
        int newViewCount = lists.size();
        if (oldViewCount > newViewCount) {
            removeViews(newViewCount, oldViewCount - newViewCount);
        } else if (oldViewCount < newViewCount) {
            for (int i = oldViewCount; i < newViewCount; i++) {
                SimpleDraweeView iv = getImageView(i);
                if (iv == null) {
                    return;
                }
                addView(iv, generateDefaultLayoutParams());
            }
        }
    }
    mImgDataList = lists;
    requestLayout();
}
Also used : SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView)

Aggregations

SimpleDraweeView (com.facebook.drawee.view.SimpleDraweeView)58 View (android.view.View)30 TextView (android.widget.TextView)20 Uri (android.net.Uri)8 DraweeController (com.facebook.drawee.interfaces.DraweeController)8 Intent (android.content.Intent)6 ImageView (android.widget.ImageView)5 RecyclerView (android.support.v7.widget.RecyclerView)4 Button (android.widget.Button)4 TintImageView (com.bilibili.magicasakura.widgets.TintImageView)4 RoundingParams (com.facebook.drawee.generic.RoundingParams)4 Animatable (android.graphics.drawable.Animatable)3 ViewGroup (android.view.ViewGroup)3 AdapterView (android.widget.AdapterView)3 CompoundButton (android.widget.CompoundButton)3 LinearLayout (android.widget.LinearLayout)3 SwitchCompat (androidx.appcompat.widget.SwitchCompat)3 BaseControllerListener (com.facebook.drawee.controller.BaseControllerListener)3 ControllerListener (com.facebook.drawee.controller.ControllerListener)3 ProgressBarDrawable (com.facebook.drawee.drawable.ProgressBarDrawable)3