use of com.transitionseverywhere.Rotate in project Transitions-Everywhere by andkulikov.
the class RotateSample method onCreateView.
@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;
}
use of com.transitionseverywhere.Rotate in project Remindy by abicelis.
the class EditImageAttachmentActivity method onClick.
@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;
}
}