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


Java CropImage.startPickImageActivity方法代码示例

本文整理汇总了Java中com.theartofdev.edmodo.cropper.CropImage.startPickImageActivity方法的典型用法代码示例。如果您正苦于以下问题:Java CropImage.startPickImageActivity方法的具体用法?Java CropImage.startPickImageActivity怎么用?Java CropImage.startPickImageActivity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.theartofdev.edmodo.cropper.CropImage的用法示例。


在下文中一共展示了CropImage.startPickImageActivity方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onRequestPermissionsResult

import com.theartofdev.edmodo.cropper.CropImage; //导入方法依赖的package包/类
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
    if (requestCode == CropImage.CAMERA_CAPTURE_PERMISSIONS_REQUEST_CODE) {
        if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
            CropImage.startPickImageActivity(this);
        } else {
            Toast.makeText(this, "Cancelling, required permissions are not granted", Toast.LENGTH_LONG).show();
        }
    }
    if (requestCode == CropImage.PICK_IMAGE_PERMISSIONS_REQUEST_CODE) {
        if (mCropImageUri != null && grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
            mCurrentFragment.setImageUri(mCropImageUri);
        } else {
            Toast.makeText(this, "Cancelling, required permissions are not granted", Toast.LENGTH_LONG).show();
        }
    }
}
 
开发者ID:chuch0805,项目名称:Android-Demo_ImageCroper,代码行数:18,代码来源:MainActivity.java

示例2: onRequestPermissionsResult

import com.theartofdev.edmodo.cropper.CropImage; //导入方法依赖的package包/类
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
    if (requestCode == CropImage.CAMERA_CAPTURE_PERMISSIONS_REQUEST_CODE) {
        if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
            CropImage.startPickImageActivity(this);
        } else {
            Toast.makeText(this, "Cancelling, required permissions are not granted", Toast.LENGTH_LONG).show();
        }
    }
    if (requestCode == CropImage.PICK_IMAGE_PERMISSIONS_REQUEST_CODE) {
        if (cropImageUri != null && grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
            // required permissions granted, start crop image activity
            startCropImageActivity(cropImageUri);
        } else {
            Toast.makeText(this, "Cancelling, required permissions are not granted", Toast.LENGTH_LONG).show();
        }
    }
}
 
开发者ID:piskula,项目名称:FuelUp,代码行数:19,代码来源:VehicleAbstractActivity.java

示例3: onRequestPermissionsResult

import com.theartofdev.edmodo.cropper.CropImage; //导入方法依赖的package包/类
@Override
    public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
        if (requestCode == CropImage.CAMERA_CAPTURE_PERMISSIONS_REQUEST_CODE) {
            if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                LogUtil.logDebug(TAG, "CAMERA_CAPTURE_PERMISSIONS granted");
                CropImage.startPickImageActivity(this);
            } else {
                showSnackBar(R.string.permissions_not_granted);
                LogUtil.logDebug(TAG, "CAMERA_CAPTURE_PERMISSIONS not granted");
            }
        }
        if (requestCode == CropImage.PICK_IMAGE_PERMISSIONS_REQUEST_CODE) {
            if (imageUri != null && grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                // required permissions granted, start crop image activity
                LogUtil.logDebug(TAG, "PICK_IMAGE_PERMISSIONS granted");
//                if (isImageFileValid(imageUri)) {
                onImagePikedAction();
//                }
            } else {
                showSnackBar(R.string.permissions_not_granted);
                LogUtil.logDebug(TAG, "PICK_IMAGE_PERMISSIONS not granted");
            }
        }
    }
 
开发者ID:rozdoum,项目名称:social-app-android,代码行数:25,代码来源:PickImageActivity.java

示例4: onRequestPermissionsResult

import com.theartofdev.edmodo.cropper.CropImage; //导入方法依赖的package包/类
@Override
public void onRequestPermissionsResult(
    int requestCode, String permissions[], int[] grantResults) {
  if (requestCode == CropImage.CAMERA_CAPTURE_PERMISSIONS_REQUEST_CODE) {
    if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
      CropImage.startPickImageActivity(this);
    } else {
      Toast.makeText(this, "Cancelling, required permissions are not granted", Toast.LENGTH_LONG)
          .show();
    }
  }
  if (requestCode == CropImage.PICK_IMAGE_PERMISSIONS_REQUEST_CODE) {
    if (mCropImageUri != null
        && grantResults.length > 0
        && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
      mCurrentFragment.setImageUri(mCropImageUri);
    } else {
      Toast.makeText(this, "Cancelling, required permissions are not granted", Toast.LENGTH_LONG)
          .show();
    }
  }
}
 
开发者ID:ArthurHub,项目名称:Android-Image-Cropper,代码行数:23,代码来源:MainActivity.java

示例5: onClickPhoto

import com.theartofdev.edmodo.cropper.CropImage; //导入方法依赖的package包/类
public void onClickPhoto(View w) {
    if (vehiclePicturePath != null && new File(vehiclePicturePath).exists()) {
        deletePhoto();
    } else {
        if (CropImage.isExplicitCameraPermissionRequired(this)) {
            ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, CropImage.CAMERA_CAPTURE_PERMISSIONS_REQUEST_CODE);
        } else {
            CropImage.startPickImageActivity(this);
        }
    }
}
 
开发者ID:piskula,项目名称:FuelUp,代码行数:12,代码来源:VehicleAbstractActivity.java

示例6: onSelectImageClick

import com.theartofdev.edmodo.cropper.CropImage; //导入方法依赖的package包/类
@SuppressLint("NewApi")
public void onSelectImageClick(View view) {
    if (CropImage.isExplicitCameraPermissionRequired(this)) {
        requestPermissions(new String[]{Manifest.permission.CAMERA}, CropImage.CAMERA_CAPTURE_PERMISSIONS_REQUEST_CODE);
    } else {
        CropImage.startPickImageActivity(this);
    }
}
 
开发者ID:rozdoum,项目名称:social-app-android,代码行数:9,代码来源:PickImageActivity.java

示例7: startPicker

import com.theartofdev.edmodo.cropper.CropImage; //导入方法依赖的package包/类
private void startPicker() {
    CropImage.startPickImageActivity(this);
}
 
开发者ID:lucasax,项目名称:Zero,代码行数:4,代码来源:MainActivity.java

示例8: onSelectImageClick

import com.theartofdev.edmodo.cropper.CropImage; //导入方法依赖的package包/类
/**
 * Start pick image activity with chooser.
 */
public void onSelectImageClick(View view) {
    CropImage.startPickImageActivity(this);
}
 
开发者ID:enjoyproduct,项目名称:ImageCroper,代码行数:7,代码来源:MainActivity.java


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