本文整理汇总了Java中com.transitionseverywhere.Rotate类的典型用法代码示例。如果您正苦于以下问题:Java Rotate类的具体用法?Java Rotate怎么用?Java Rotate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Rotate类属于com.transitionseverywhere包,在下文中一共展示了Rotate类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import com.transitionseverywhere.Rotate; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_rotate, container, false);
final ViewGroup transitionsContainer = (ViewGroup) view.findViewById(R.id.transitions_container);
final View icon = transitionsContainer.findViewById(R.id.icon);
icon.setOnClickListener(new View.OnClickListener() {
boolean mRotated;
@Override
public void onClick(View v) {
TransitionManager.beginDelayedTransition(transitionsContainer, new Rotate());
mRotated = !mRotated;
icon.setRotation(mRotated ? 135 : 0);
}
});
return view;
}
示例2: onClick
import com.transitionseverywhere.Rotate; //导入依赖的package包/类
@Override
public void onClick(View v) {
int id = v.getId();
switch (id) {
case R.id.activity_edit_image_attachment_crop:
applyPendingRotation();
File imageFile = new File(FileUtil.getImageAttachmentDir(this), mImageAttachment.getImageFilename());
Uri imageUri = FileProvider.getUriForFile(this, "ve.com.abicelis.remindy.fileprovider", imageFile);
CropImage.activity(imageUri).setAllowFlipping(false).setAllowRotation(false).start(this);
break;
case R.id.activity_edit_image_attachment_rotate:
mRotation += 90;
TransitionManager.beginDelayedTransition(mContainer, new Rotate());
mImage.setRotation(mRotation);
break;
case R.id.activity_edit_image_attachment_camera:
handleShowCameraGalleryDialog();
break;
case R.id.activity_edit_image_attachment_ok:
applyPendingRotation();
updateImageAttachmentThumbnail();
Intent returnData = new Intent();
returnData.putExtra(HOLDER_POSITION_EXTRA, mHolderPosition);
returnData.putExtra(IMAGE_ATTACHMENT_EXTRA, mImageAttachment);
setResult(RESULT_OK, returnData);
finish();
break;
case R.id.activity_edit_image_attachment_cancel:
if(mEditingExistingImageAttachment)
restoreImageFromBackup();
setResult(RESULT_CANCELED);
finish();
break;
}
}