本文整理汇总了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
}
});
}