本文整理汇总了Java中com.github.chrisbanes.photoview.PhotoViewAttacher类的典型用法代码示例。如果您正苦于以下问题:Java PhotoViewAttacher类的具体用法?Java PhotoViewAttacher怎么用?Java PhotoViewAttacher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PhotoViewAttacher类属于com.github.chrisbanes.photoview包,在下文中一共展示了PhotoViewAttacher类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.github.chrisbanes.photoview.PhotoViewAttacher; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_full_screen_image);
Intent intent = getIntent();
String imageurl = intent.getExtras().getString("imageurl");
mAttacher = new PhotoViewAttacher(mImageView);
if (isNotEmpty(imageurl)) {
Picasso.with(this)
.load(imageurl)
.into(mImageView, new Callback() {
@Override
public void onSuccess() {
mAttacher.update();
}
@Override
public void onError() {
}
});
}
}
示例2: onWallpaperLoaded
import com.github.chrisbanes.photoview.PhotoViewAttacher; //导入依赖的package包/类
private void onWallpaperLoaded() {
mAttacher = new PhotoViewAttacher(mImageView);
mAttacher.setScaleType(ImageView.ScaleType.CENTER_CROP);
AnimationHelper.fade(mProgress).start();
mRunnable = null;
mHandler = null;
mIsResumed = false;
TapIntroHelper.showWallpaperPreviewIntro(this, mWallpaper.getColor());
}
示例3: createPhotoView
import com.github.chrisbanes.photoview.PhotoViewAttacher; //导入依赖的package包/类
/***************************
* Private methods
***************************/
private void createPhotoView(){
PhotoViewAttacher photoViewAttacher = new PhotoViewAttacher(mImageView);
photoViewAttacher.setOnPhotoTapListener(this);
photoViewAttacher.setOnLongClickListener(this);
}
示例4: onSetLayout
import com.github.chrisbanes.photoview.PhotoViewAttacher; //导入依赖的package包/类
protected void onSetLayout(final String image_url, final String cctv) {
mImage = (PhotoView) findViewById(R.id.ssz_uk_co_senab_photoview);
mCurrMatrixTv = (TextView) findViewById(R.id.ssz_debug_textview);
// mCurrMatrixTv.setText(cctv);
mCaptv = (TextView) findViewById(R.id.ssz_caption_textview);
setCaptionTextviewAdvance(mCaptv, cctv);
final ProgressBar circle = (ProgressBar) findViewById(R.id.ns_loading_progress);
Log.d(LOG_TAG, "load image with url : " + image_url + " title:" + cctv);
picasso.load(image_url).into(mImage, new Callback() {
@Override
public void onSuccess() {
mAttacher = new PhotoViewAttacher(mImage);
mAttacher.setOnMatrixChangeListener(new MatrixChangeListener());
mAttacher.setOnPhotoTapListener(new PhotoTapListener());
circle.setVisibility(View.GONE);
mImage.post(new Runnable() {
@Override
public void run() {
mAttacher.setScale(2f, mImage.getWidth() / 2, mImage.getHeight() / 2, true);
}
});
//slidrInf.unlock();
mAttacher.setScale(1.5f);
}
@Override
public void onError() {
circle.setVisibility(View.GONE);
}
});
}
示例5: DisplayImage
import com.github.chrisbanes.photoview.PhotoViewAttacher; //导入依赖的package包/类
private void DisplayImage(final File file) {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(new File(file.getPath()).getAbsolutePath(), options);
height = options.outHeight;
width = options.outWidth;
rotation = getRotation(Uri.parse("file://" + file.getAbsolutePath()));
Log.d(Config.LOGTAG, "Image height: " + height + ", width: " + width + ", rotation: " + rotation);
if (useAutoRotateScreen()) {
rotateScreen(width, height, rotation);
}
final PhotoViewAttacher mAttacher = new PhotoViewAttacher(mImage);
mImage.setVisibility(View.VISIBLE);
try {
Glide.with(this)
.load(file)
.dontAnimate()
.into(new GlideDrawableImageViewTarget(mImage) {
@Override
public void onResourceReady(GlideDrawable resource, GlideAnimation<? super GlideDrawable> animation) {
super.onResourceReady(resource, animation);
mAttacher.update();
}
});
} catch (Exception e) {
Toast.makeText(this, getString(R.string.error_file_corrupt), Toast.LENGTH_LONG).show();
e.printStackTrace();
}
}
示例6: MatrixChangeListener
import com.github.chrisbanes.photoview.PhotoViewAttacher; //导入依赖的package包/类
public MatrixChangeListener(PhotoViewAttacher mAttacher, LinearLayout cover, final ImageButton button_close) {
this.mAttacher = mAttacher;
button = button_close;
this.cover = cover;
}