當前位置: 首頁>>代碼示例>>Java>>正文


Java PhotoViewAttacher.setToRightAngle方法代碼示例

本文整理匯總了Java中uk.co.senab.photoview.PhotoViewAttacher.setToRightAngle方法的典型用法代碼示例。如果您正苦於以下問題:Java PhotoViewAttacher.setToRightAngle方法的具體用法?Java PhotoViewAttacher.setToRightAngle怎麽用?Java PhotoViewAttacher.setToRightAngle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在uk.co.senab.photoview.PhotoViewAttacher的用法示例。


在下文中一共展示了PhotoViewAttacher.setToRightAngle方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

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

示例2: onViewCreated

import uk.co.senab.photoview.PhotoViewAttacher; //導入方法依賴的package包/類
@Override
public void onViewCreated(final View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    mProgress = (ProgressBar) view.findViewById(R.id.loading);
    mImageView = (PhotoView) view.findViewById(R.id.photo_view);
    mAttacher = new PhotoViewAttacher(mImageView);
    mAttacher.setRotatable(true);
    mAttacher.setToRightAngle(true);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:10,代碼來源:BoxingRawImageFragment.java

示例3: onViewCreated

import uk.co.senab.photoview.PhotoViewAttacher; //導入方法依賴的package包/類
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    mPhotoView = (PhotoView) view.findViewById(R.id.photoview);
    mAttacher = new PhotoViewAttacher(mPhotoView);
    mAttacher.setRotatable(true);
    mAttacher.setToRightAngle(true);
    mPhotoView.setOnRotateListener(new PhotoViewAttacher.OnRotateListener() {
        @Override
        public void onRotate(int degree) {
            //do something
        }
    });
}
 
開發者ID:ChenSiLiang,項目名稱:RotatePhotoView,代碼行數:14,代碼來源:SinglePhotoViewFragment.java


注:本文中的uk.co.senab.photoview.PhotoViewAttacher.setToRightAngle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。