当前位置: 首页>>代码示例>>Java>>正文


Java PhotoViewAttacher类代码示例

本文整理汇总了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() {
                    }
                });
    }
}
 
开发者ID:openfoodfacts,项目名称:openfoodfacts-androidapp,代码行数:27,代码来源:FullScreenImage.java

示例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());
}
 
开发者ID:danimahardhika,项目名称:wallpaperboard,代码行数:11,代码来源:WallpaperBoardPreviewActivity.java

示例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);
}
 
开发者ID:HugoGresse,项目名称:Anecdote,代码行数:10,代码来源:FullscreenImageFragment.java

示例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);
        }
    });


}
 
开发者ID:jjhesk,项目名称:LoyalNativeSlider,代码行数:38,代码来源:ZoomablePicassoSwippable.java

示例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();
    }
}
 
开发者ID:kriztan,项目名称:Pix-Art-Messenger,代码行数:30,代码来源:ShowFullscreenMessageActivity.java

示例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;
}
 
开发者ID:jjhesk,项目名称:LoyalNativeSlider,代码行数:6,代码来源:ZoomableView.java


注:本文中的com.github.chrisbanes.photoview.PhotoViewAttacher类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。