當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。