當前位置: 首頁>>代碼示例>>Java>>正文


Java PhotoView類代碼示例

本文整理匯總了Java中uk.co.senab.photoview.PhotoView的典型用法代碼示例。如果您正苦於以下問題:Java PhotoView類的具體用法?Java PhotoView怎麽用?Java PhotoView使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PhotoView類屬於uk.co.senab.photoview包,在下文中一共展示了PhotoView類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: instantiateItem

import uk.co.senab.photoview.PhotoView; //導入依賴的package包/類
@Override
public Object instantiateItem(ViewGroup container, final int position) {
    PhotoView photoView = new PhotoView(container.getContext());
    ImageDetail imageDetail = mImageDetails.get(position);
    ImageLoader.loadImage(container.getContext(),imageDetail.img,photoView);
    photoView.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
        @Override
        public void onPhotoTap(View view, float x, float y) {
            if(mListener!=null) {
                mListener.onClick();
            }
        }
    });
    container.addView(photoView);
    return photoView;
}
 
開發者ID:Jay-Ping,項目名稱:newIPlay,代碼行數:17,代碼來源:ImageDetailAdapter.java

示例2: instantiateItem

import uk.co.senab.photoview.PhotoView; //導入依賴的package包/類
@Override public Object instantiateItem(ViewGroup container, int position) {
  if (position == getCount() - 1) {
    View inflate = View.inflate(context, R.layout.add_more_view, null);
    container.addView(inflate);
    if (onClickListener != null) {
      inflate.findViewById(R.id.btn_add).setOnClickListener(onClickListener);
    }
    return inflate;
  } else {
    PhotoView photoView = new PhotoView(context);
    //ViewGroup.LayoutParams layoutParams = photoView.getLayoutParams();
    container.addView(photoView);
    Glide.with(context).load(gankioDatas.get(position).getUrl()).into(photoView);
    return photoView;
  }
}
 
開發者ID:Lingzh0ng,項目名稱:BrotherWeather,代碼行數:17,代碼來源:PhotoAdapter.java

示例3: instantiateItem

import uk.co.senab.photoview.PhotoView; //導入依賴的package包/類
@RequiresApi(api = Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@Override
public View instantiateItem(ViewGroup container, int position) {
    PhotoView photoView = new PhotoView(container.getContext());
    photoView.setOnViewTapListener(new PhotoViewAttacher.OnViewTapListener() {
        @Override
        public void onViewTap(View view, float x, float y) {
            playZoomOutAnim();
        }
    });
    PicInfo picInfo = picUrls.get(position);
    sceneHelp.showExpandedView(photoView, picInfo);
    container.addView(photoView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);

    return photoView;
}
 
開發者ID:Sherchen,項目名稱:LikeWechatPhotoViewer,代碼行數:17,代碼來源:MainActivity.java

示例4: getView

import uk.co.senab.photoview.PhotoView; //導入依賴的package包/類
@Override
public View getView(int position, View convertView, ViewGroup container) {
    MediaBean mediaBean = mMediaList.get(position);
    if (convertView == null) {
        convertView = View.inflate(container.getContext(), R.layout.gallery_media_image_preview_item, null);
    }
    PhotoView ivImage = (PhotoView) convertView.findViewById(R.id.iv_media_image);
    String path = null;
    if (mediaBean.getWidth() > 1200 || mediaBean.getHeight() > 1200) {
        path = mediaBean.getThumbnailBigPath();
    }
    if (TextUtils.isEmpty(path)) {
        path = mediaBean.getOriginalPath();
    }
    ivImage.setBackgroundColor(mPageColor);
    mConfiguration.getImageLoader().displayImage(container.getContext(), path, ivImage, mDefaultImage, mConfiguration.getImageConfig(),
            false, mConfiguration.isPlayGif(), mScreenWidth, mScreenHeight, mediaBean.getOrientation());
    return convertView;
}
 
開發者ID:Loofer,項目名稱:Watermark,代碼行數:20,代碼來源:MediaPreviewAdapter.java

示例5: initView

import uk.co.senab.photoview.PhotoView; //導入依賴的package包/類
private void initView() {
  showChartInfos = new ArrayList<>();
  pointItemAdapter = new PointItemAdapter(this, showChartInfos);
  rvPoint.setLayoutManager(new LinearLayoutManager(getActivity()));
  pointItemAdapter.setOnItemOnClickListener(new PointItemAdapter.OnItemOnClickListener() {
    @Override public void onItemClick(int position, BChartInfo countIncident) {
      if (countIncident != null) {
        Bundle bundle = new Bundle();
        bundle.putSerializable("BChartInfo", countIncident);
        bundle.putString("title", countIncident.getAppDisplay());
        ActivityUtils.startFragment(getActivity(), LConsts.FragmentType.PhotoView, bundle);
      }
    }
  });
  rvPoint.setAdapter(pointItemAdapter);
}
 
開發者ID:Lingzh0ng,項目名稱:ITSM,代碼行數:17,代碼來源:PointFragment.java

示例6: inject

import uk.co.senab.photoview.PhotoView; //導入依賴的package包/類
public void inject(Finder finder, final T target, Object source) {
    target.toggle_bingo = (ToggleButton) finder.castView((View) finder.findRequiredView
            (source, R.id.toggle_bingo, "field 'toggle_bingo'"), R.id.toggle_bingo, "field " +
            "'toggle_bingo'");
    target.et_calory = (EditText) finder.castView((View) finder.findRequiredView(source, R.id
            .et_calory, "field 'et_calory'"), R.id.et_calory, "field 'et_calory'");
    target.et_name = (EditText) finder.castView((View) finder.findRequiredView(source, R.id
            .et_name, "field 'et_name'"), R.id.et_name, "field 'et_name'");
    target.iv_photo = (PhotoView) finder.castView((View) finder.findRequiredView(source, R.id
            .iv_photo, "field 'iv_photo'"), R.id.iv_photo, "field 'iv_photo'");
    ((View) finder.findRequiredView(source, R.id.ll_invite_bingo, "method 'onClick'"))
            .setOnClickListener(new DebouncingOnClickListener() {
        public void doClick(View p0) {
            target.onClick(p0);
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:18,代碼來源:AddCameraRecordActivity$$ViewInjector.java

示例7: instantiateItem

import uk.co.senab.photoview.PhotoView; //導入依賴的package包/類
@Override
public View instantiateItem(ViewGroup container, final int position) {
    PhotoView photoView = new PhotoView(container.getContext());
    //load full size image with Picasso lib into the photoView
    Picasso.with(container.getContext())
            .load(sDrawables.get(position).getPhoto().getOriginalSize().getUrl())
            .placeholder(R.drawable.ic_sync)
            .error(R.drawable.ic_warning)
            .into(photoView);
    container.addView(photoView, ViewPager.LayoutParams.MATCH_PARENT, ViewPager.LayoutParams.MATCH_PARENT);

    photoView.setOnViewTapListener(new PhotoViewAttacher.OnViewTapListener() {
        @Override
        public void onViewTap(final View view, float x, float y) {
            //on photo click, display or hide data section
            View photoDataView = findViewById(R.id.photo_data);
            if (photoDataView.getVisibility() == View.VISIBLE) {
                photoDataView.setVisibility(View.GONE);
            } else {
                photoDataView.setVisibility(View.VISIBLE);
            }
        }
    });

    return photoView;
}
 
開發者ID:nioc,項目名稱:tumblr-photo-browse,代碼行數:27,代碼來源:BlogActivity.java

示例8: onCreate

import uk.co.senab.photoview.PhotoView; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.dialog_photo_show_layout);
    photoView = (PhotoView) findViewById(R.id.photoview);
    Glide.with(context).load(imgpath).into(photoView);
    mAttacher = new PhotoViewAttacher(photoView);
    mAttacher.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {

        @Override
        public void onPhotoTap(View view, float x, float y) {

        }

        @Override
        public void onOutsidePhotoTap() {

        }
    });
}
 
開發者ID:wanliyang1990,項目名稱:AndroidPickPhotoDialog,代碼行數:21,代碼來源:ImgShowDialog.java

示例9: onCreate

import uk.co.senab.photoview.PhotoView; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_cover);

    // Get PhotoView.
    PhotoView coverImage = (PhotoView) findViewById(R.id.full_cover_image);
    if (coverImage == null) throw new IllegalStateException("Couldn't get PhotoView.");

    // Get cover image file.
    File coverImageFile = DataUtils.getCoverImageFile(getIntent().getStringExtra(C.REL_PATH));
    if (coverImageFile == null) throw new IllegalStateException("Couldn't get cover image file.");

    // Load image into PhotoView.
    Glide.with(this)
         .load(coverImageFile)
         .into(coverImage);
}
 
開發者ID:bkromhout,項目名稱:Minerva,代碼行數:19,代碼來源:CoverActivity.java

示例10: newView

import uk.co.senab.photoview.PhotoView; //導入依賴的package包/類
@Override
public PhotoView newView(int position) {
    PhotoView imageView = new PhotoView(mContext);
    imageView.setTag(get(position));
    imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
    int w = imageView.getMeasuredWidth() > 0 ? imageView.getMeasuredWidth() : 400;
    int h = imageView.getMeasuredHeight() > 0 ? imageView.getMeasuredHeight() : 400;
    Picasso.with(mContext)
            .load(get(position))
            .resize(w, h)
            .placeholder(R.drawable.pic_load)
            .error(R.drawable.pic_load_error)
            .centerInside()
            .into(imageView);
    return imageView;
}
 
開發者ID:Jay-Y,項目名稱:yApp,代碼行數:17,代碼來源:ImageDetailAdapter.java

示例11: instantiateItem

import uk.co.senab.photoview.PhotoView; //導入依賴的package包/類
@Override
    public View instantiateItem(ViewGroup container, int position) {
//        View convertView = View.inflate(context,
//                R.layout.item_imageslooker_photoview, null);

        PhotoView photoView =new PhotoView(context);
        String path = mPhotos.get(position % mPhotos.size()).path;
        if (path.startsWith("http://") || path.startsWith("https://")) {
            // 這裏進行圖片的緩存操作
            Glide.with(context).load(path).into(photoView);
        } else {
            Glide.with(context).load(new File(path)).into(photoView);
        }
        container.addView(photoView, LayoutParams.MATCH_PARENT,
                LayoutParams.MATCH_PARENT);
        return photoView;
    }
 
開發者ID:BigAppOS,項目名稱:BigApp_Discuz_Android,代碼行數:18,代碼來源:ImageBrowserAdapter.java

示例12: initView

import uk.co.senab.photoview.PhotoView; //導入依賴的package包/類
private void initView() {
    largeImageView = (PhotoView) findViewById(R.id.large_image);

    attacher = new PhotoViewAttacher(largeImageView);

    String imagePath = getIntent().getStringExtra(IMAGE_PATH);
    Log.e("LargeImageViewActivity", "imagePath===>" + imagePath);

    File imageFile = new File(imagePath);
    Glide.with(this)
            .load(imageFile)
            .error(R.color.gray)
            .placeholder(R.color.gray)
            .crossFade(500)
            .listener(requestListener)
            .into(largeImageView);
}
 
開發者ID:QianFanYun,項目名稱:QF-Picture-Viewer,代碼行數:18,代碼來源:LargeImageViewActivity.java

示例13: onCreate

import uk.co.senab.photoview.PhotoView; //導入依賴的package包/類
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ZoomableImageActivityIntentBuilder.inject(getIntent(), this);
    PhotoView view = new PhotoView(this);

    @DrawableRes int drawableRes;
    @StringRes int titleRes;
    if (type.equals(TYPE_ROOMS)) {
        drawableRes = R.drawable.venue_rooms;
        titleRes = R.string.venue_see_rooms;
    } else {
        drawableRes = R.drawable.venue_exhibitors;
        titleRes = R.string.venue_see_exhibitors;
    }

    view.setImageDrawable(ContextCompat.getDrawable(this, drawableRes));
    getSupportActionBar().setTitle(titleRes);
    setContentView(view);
}
 
開發者ID:Nilhcem,項目名稱:devoxxfr-2016,代碼行數:21,代碼來源:ZoomableImageActivity.java

示例14: onCreate

import uk.co.senab.photoview.PhotoView; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_integration);
	PhotoView photoView = (PhotoView) findViewById(R.id.photoview);

	ImageLoader.getInstance().init(
			ImageLoaderConfiguration.createDefault(this));

	/**
	 * The Image URL is comes from my space. If it is invalid, you can
	 * change to any other picture url.
	 */
	ImageLoader.getInstance().displayImage(
			"http://dk-exp.qiniudn.com/saya.jpg", photoView);
}
 
開發者ID:xulailing,項目名稱:android-open-project-demo-master,代碼行數:17,代碼來源:ImageLoaderDemo.java

示例15: instantiateItem

import uk.co.senab.photoview.PhotoView; //導入依賴的package包/類
@Override
public Object instantiateItem(ViewGroup container, int position) {

    PhotoView photoView = new PhotoView(NewsPhotoDetailActivity.this);
    Glide.with(NewsPhotoDetailActivity.this).load(mPictureList.get(position).getImgPath())
            .placeholder(R.mipmap.ic_loading)
            .error(R.mipmap.ic_load_fail)
            .diskCacheStrategy(DiskCacheStrategy.ALL)
            .into(photoView);
    photoView.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
        @Override
        public void onPhotoTap(View view, float v, float v1) {
            hideToolBarAndTextView();
            hideOrShowStatusBar();
        }

        @Override
        public void onOutsidePhotoTap() {

        }
    });
    container.addView(photoView, ViewPager.LayoutParams.MATCH_PARENT, ViewPager.LayoutParams.MATCH_PARENT);
    return photoView;
}
 
開發者ID:LuoboDcom,項目名稱:ZZShow,代碼行數:25,代碼來源:NewsPhotoDetailActivity.java


注:本文中的uk.co.senab.photoview.PhotoView類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。