当前位置: 首页>>代码示例>>Java>>正文


Java Rotate类代码示例

本文整理汇总了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;
}
 
开发者ID:andkulikov,项目名称:Transitions-Everywhere,代码行数:25,代码来源:RotateSample.java

示例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;
    }
}
 
开发者ID:abicelis,项目名称:Remindy,代码行数:42,代码来源:EditImageAttachmentActivity.java


注:本文中的com.transitionseverywhere.Rotate类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。