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


Java PhotoViewAttacher.setScale方法代码示例

本文整理汇总了Java中uk.co.senab.photoview.PhotoViewAttacher.setScale方法的典型用法代码示例。如果您正苦于以下问题:Java PhotoViewAttacher.setScale方法的具体用法?Java PhotoViewAttacher.setScale怎么用?Java PhotoViewAttacher.setScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在uk.co.senab.photoview.PhotoViewAttacher的用法示例。


在下文中一共展示了PhotoViewAttacher.setScale方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onSuccess

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onSuccess() {
    if (mWr.get() == null || mWr.get().mImageView == null) {
        return;
    }
    mWr.get().dismissProgressDialog();
    Drawable drawable = mWr.get().mImageView.getDrawable();
    PhotoViewAttacher attacher = mWr.get().mAttacher;
    if (attacher != null) {
        if (drawable.getIntrinsicHeight() > (drawable.getIntrinsicWidth() << 2)) {
            // handle the super height image.
            int scale = drawable.getIntrinsicHeight() / drawable.getIntrinsicWidth();
            scale = Math.min(MAX_SCALE, scale);
            attacher.setMaximumScale(scale);
            attacher.setScale(scale, true);
        }
        attacher.update();
    }
    BoxingViewActivity activity = mWr.get().getThisActivity();
    if (activity != null && activity.mGallery != null) {
        activity.mGallery.setVisibility(View.VISIBLE);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:24,代码来源:BoxingRawImageFragment.java

示例2: instantiateItem

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
@SuppressWarnings("NewApi")
public Object instantiateItem(ViewGroup container, int position) {
    View v = inflater.inflate(R.layout.view_pdf_page, container, false);
    ImageView iv = (ImageView) v.findViewById(R.id.imageView);

    if (renderer == null || getCount() < position) {
        return v;
    }

    PdfRenderer.Page page = getPDFPage(renderer, position);

    Bitmap bitmap = bitmapContainer.get(position);
    page.render(bitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY);
    page.close();

    PhotoViewAttacher attacher = new PhotoViewAttacher(iv);
    attacher.setScale(scale.getScale(), scale.getCenterX(), scale.getCenterY(), true);
    attacher.setOnMatrixChangeListener(this);

    attachers.put(position, new WeakReference<PhotoViewAttacher>(attacher));

    iv.setImageBitmap(bitmap);
    attacher.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
        @Override
        public void onPhotoTap(View view, float x, float y) {
            if (pageClickListener != null) {
                pageClickListener.onPageTap(view, x, y);
            }
        }
    });
    attacher.update();
    container.addView(v, 0);

    return v;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:37,代码来源:PDFPagerAdapter.java

示例3: instantiateItem

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
@SuppressWarnings("NewApi")
public Object instantiateItem(ViewGroup container, int position) {
    View v = inflater.inflate(R.layout.view_pdf_page, container, false);
    ImageView iv = (ImageView) v.findViewById(R.id.imageView);

    if (renderer == null || getCount() < position) {
        return v;
    }

    PdfRenderer.Page page = getPDFPage(renderer, position);

    Bitmap bitmap = bitmapContainer.get(position);
    page.render(bitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY);
    page.close();

    PhotoViewAttacher attacher = new PhotoViewAttacher(iv);
    attacher.setScale(scale.getScale(), scale.getCenterX(), scale.getCenterY(), true);
    attacher.setOnMatrixChangeListener(this);

    attachers.put(position, new WeakReference<PhotoViewAttacher>(attacher));

    iv.setImageBitmap(bitmap);
    attacher.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
        @Override
        public void onPhotoTap(View view, float x, float y) {
            pageClickListener.onClick(view);
        }
    });
    attacher.update();
    ((ViewPager) container).addView(v, 0);

    return v;
}
 
开发者ID:voghDev,项目名称:PdfViewPager,代码行数:35,代码来源:PDFPagerAdapter.java


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