本文整理汇总了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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
});
}
示例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;
}
示例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() {
}
});
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}