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


Java PhotoViewAttacher.update方法代码示例

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


在下文中一共展示了PhotoViewAttacher.update方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
public Object instantiateItem(ViewGroup container, int position) {
    PhotoView photoView = new PhotoView(container.getContext());
    photoView.setImageResource(sDrawables[position]);
    PhotoViewAttacher attacher = new PhotoViewAttacher(photoView);
    attacher.setRotatable(true);
    attacher.setToRightAngle(true);
    attacher.setOnRotateListener(new PhotoViewAttacher.OnRotateListener() {
        @Override
        public void onRotate(int degree) {
            //do something
        }
    });
    attacher.update();
    // Now just add PhotoView to ViewPager and return it
    container.addView(photoView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);

    return photoView;
}
 
开发者ID:ChenSiLiang,项目名称:RotatePhotoView,代码行数:20,代码来源:ViewPagerPhotoViewFragment.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) {
            if (pageClickListener != null) {
                pageClickListener.onPageTap(view, x, y);
            }
        }
    });
    attacher.update();
    container.addView(v, 0);

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

示例4: instantiateItem

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public Object instantiateItem(ViewGroup container, int position) {

	View view = View.inflate(UIUtils.getContext(), R.layout.item_image_scale, null);
	ImageView image = (ImageView) view.findViewById(R.id.image);
	Glide.with(UIUtils.getContext()).load(HttpHelper.URL + "image?name=" + mDatas.get(position)).into(image);
	PhotoViewAttacher photoViewAttacher = new PhotoViewAttacher(image);
	photoViewAttacher.update();
	container.addView(image);
	
	return view;
}
 
开发者ID:cuilitang,项目名称:CuiMarket,代码行数:13,代码来源:ImageScaleActivity.java

示例5: onCreateView

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.image_fragment_layout,container,false);

    ImageView imageView = (ImageView) view;

    ImageLoader.load(getActivity(),mUrl,imageView);

    PhotoViewAttacher attacher = new PhotoViewAttacher(imageView);
    attacher.update();
    attacher.setScaleType(ImageView.ScaleType.FIT_CENTER);

    return view;
}
 
开发者ID:aollio,项目名称:weixzz-app,代码行数:16,代码来源:ImageDetailActivity.java

示例6: 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

示例7: initSubViews

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void initSubViews(View view) {
    super.initSubViews(view);
    ImageLoader.loadImage(getArguments().getString("url"),
            meiziImageView, getContext());
    mAttacher = new PhotoViewAttacher(meiziImageView);
    mAttacher.update();
}
 
开发者ID:SparkYuan,项目名称:Meizi,代码行数:9,代码来源:DetailFragment.java

示例8: onViewCreated

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    mImageView = (ImageView) view;

    mAttacher = new PhotoViewAttacher(mImageView);
    mAttacher.update();

    PicassoProvider.getInstance(getActivity().getApplicationContext(), false)
            .load(getImageUrl())
            .networkPolicy(NetworkPolicy.NO_STORE, NetworkPolicy.OFFLINE)
            .memoryPolicy(MemoryPolicy.NO_STORE)
            .placeholder(R.mipmap.ic_stub_dashboard_item)
            .into(mImageView);
}
 
开发者ID:dhis2,项目名称:dhis2-android-dashboard,代码行数:15,代码来源:ImageViewFragment.java

示例9: load

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
private void load() {
    progressWheel.setVisibility(View.VISIBLE);
    reloadView.setVisibility(View.GONE);
    pictureView.setVisibility(View.GONE);

    ImageRequest imageRequest = new ImageRequest(
            pictureURL,
            new Response.Listener<Bitmap>() {
                @Override
                public void onResponse(Bitmap bitmap) {
                    originBitmap = bitmap;

                    pictureView.setImageBitmap(bitmap);
                    PhotoViewAttacher photoViewAttacher = new PhotoViewAttacher(pictureView);
                    photoViewAttacher.setZoomable(true);
                    photoViewAttacher.update();

                    progressWheel.setVisibility(View.GONE);
                    reloadView.setVisibility(View.GONE);
                    pictureView.setVisibility(View.VISIBLE);
                }
            },
            0,
            0,
            Bitmap.Config.ARGB_8888,
            new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError volleyError) {
                    progressWheel.setVisibility(View.GONE);
                    reloadView.setVisibility(View.VISIBLE);
                    pictureView.setVisibility(View.GONE);
                }
            }
    );
    requestQueue.add(imageRequest);
}
 
开发者ID:mthli,项目名称:Tweetin,代码行数:37,代码来源:PictureFragment.java

示例10: onStart

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
protected void onStart() {
    super.onStart();
    this.findViewById(R.id.fullscreen_content).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            view.setSystemUiVisibility(UI_HIDE_OPTIONS);
        }
    });

    fullscreenImage = (ImageView)findViewById(R.id.fullscreen_content);
    fullscreenImage.setOnSystemUiVisibilityChangeListener(new SysUiVisibilityListener());
    photoAttacher = new PhotoViewAttacher(fullscreenImage);
    photoAttacher.setOnPhotoTapListener(new PhotoTapListener());

    if (retained == null) {
        retained = new DataFragment();
        fragmentManager.beginTransaction().add(retained, "data").commit();

        Bundle b = getIntent().getExtras();
        url = b.getString("image_url_" + b.getInt("position") + "_" + pickLoadSize(PreferenceManager.getDefaultSharedPreferences(this)));
        networkRequest();
    } else {
        image = retained.image;
        fullscreenImage.setImageBitmap(image);
        photoAttacher.update();
    }

    this.getWindow().getDecorView().setSystemUiVisibility(UI_HIDE_OPTIONS);
}
 
开发者ID:gina-alaska,项目名称:gina-puffinfeeder-android-viewer,代码行数:31,代码来源:FullscreenImageViewerActivity.java

示例11: onAfterViews

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onAfterViews() {
    photo_view.setImageResource(R.mipmap.warehouse_location);
    PhotoViewAttacher photoViewAttacher = new PhotoViewAttacher(photo_view);
    photoViewAttacher.update();
}
 
开发者ID:jpaijh,项目名称:TYT,代码行数:7,代码来源:CB_DisplayLargeImageActivity.java

示例12: initView

import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
protected void initView() {
    ImageLoader.load(mActivity, mUrl, mImageView);
    PhotoViewAttacher attacher = new PhotoViewAttacher(mImageView);
    attacher.update();
}
 
开发者ID:Othershe,项目名称:NiceRead,代码行数:7,代码来源:GirlDetailFragment.java


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