Java Code Examples for uk.co.senab.photoview.PhotoView#setEnabled()

The following examples show how to use uk.co.senab.photoview.PhotoView#setEnabled() . 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: ImagePickerPagerAdapter.java    From FamilyChat with Apache License 2.0 6 votes vote down vote up
@Override
public Object instantiateItem(ViewGroup container, int position)
{
    PhotoView photoView = new PhotoView(mActivity);
    photoView.setScaleType(ImageView.ScaleType.FIT_CENTER);
    photoView.setEnabled(true);
    ImageBean imageItem = mAllmageList.get(position);
    mImagePicker.getOptions().getDisplayer().display(mActivity, photoView, imageItem.getImagePath(), mScreenWidth, mScreenHeight);
    photoView.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener()
    {
        @Override
        public void onPhotoTap(View view, float x, float y)
        {
            if (mListener != null)
                mListener.OnPhotoTapListener(view, x, y);
        }
    });
    container.addView(photoView);
    return photoView;
}
 
Example 2
Source File: HxImageDetailAdapter.java    From FamilyChat with Apache License 2.0 5 votes vote down vote up
@Override
public Object instantiateItem(ViewGroup container, int position)
{
    PhotoView photoView = new PhotoView(mActivity);
    photoView.setBackgroundColor(Color.BLACK);
    photoView.setScaleType(ImageView.ScaleType.FIT_CENTER);
    photoView.setEnabled(true);
    EMImageMessageBody messageBody = (EMImageMessageBody) mDataList.get(position).getBody();
    String localUrl = messageBody.getLocalUrl();
    String remoteUrl = messageBody.getRemoteUrl();
    if (StringUtil.isNotEmpty(localUrl) && new File(localUrl).exists())
        CommonUtils.getInstance().getImageDisplayer().display(mActivity, photoView, localUrl, mScreenWidth, mScreenHeight
                , R.drawable.pic_image_detail_place_holder, R.drawable.pic_image_detail_fail);
    else
        CommonUtils.getInstance().getImageDisplayer().display(mActivity, photoView, remoteUrl, mScreenWidth, mScreenHeight
                , R.drawable.pic_image_detail_place_holder, R.drawable.pic_image_detail_fail);

    photoView.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener()
    {
        @Override
        public void onPhotoTap(View view, float x, float y)
        {
            if (mListener != null)
                mListener.OnPhotoTapListener(view, x, y);
        }
    });
    container.addView(photoView);
    return photoView;
}