本文整理匯總了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;
}
示例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);
}
示例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
}
});
}