本文整理汇总了Java中com.soundcloud.android.crop.Crop.pickImage方法的典型用法代码示例。如果您正苦于以下问题:Java Crop.pickImage方法的具体用法?Java Crop.pickImage怎么用?Java Crop.pickImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.soundcloud.android.crop.Crop
的用法示例。
在下文中一共展示了Crop.pickImage方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onClick
import com.soundcloud.android.crop.Crop; //导入方法依赖的package包/类
@Override
public void onClick(View v)
{
if (v.getId() == R.id.photo_img) {
photoImageView.setClickable(false);
Crop.pickImage(getActivity(), this); // 选择图片
setDetectButtonState(DetectState.UnDetect);
} else if (v.getId() == R.id.detect_photo_button) {
Bitmap photoBmp = ((GlobalPhotoApplication) getActivity().getApplication()).getPhotoBmp();
if (photoBmp != null) {
detectPhoto(photoBmp); // 进行人脸检测
} else {
Toast.makeText(getActivity(), R.string.nullPhotoMessage, Toast.LENGTH_SHORT).show();
}
} else if (v.getId() == R.id.detect_result_img) {
showChangePhotoDialog();
}
}
示例2: onClick
import com.soundcloud.android.crop.Crop; //导入方法依赖的package包/类
@Override
public void onClick(View v)
{
similarResultTextView.animateText("");
setDetectButtonState(DetectState.UnDetect);
switch (v.getId()) {
case R.id.similar_index_button:
getSimilarIndexResult(); // 获取两张人脸的比对结果
break;
case R.id.similar_face_img1:
similarFace1ImageView.setClickable(false);
Crop.pickImage(getActivity(), this, PICK_FACE1_REQUEST); // 选择图片
break;
case R.id.similar_face_img2:
similarFace1ImageView.setClickable(false);
Crop.pickImage(getActivity(), this, PICK_FACE2_REQUEST); // 选择图片
break;
}
}
示例3: onOptionsItemSelected
import com.soundcloud.android.crop.Crop; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.action_select) {
resultView.setImageDrawable(null);
Crop.pickImage(this);
return true;
}
return super.onOptionsItemSelected(item);
}
示例4: onCreate
import com.soundcloud.android.crop.Crop; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if(savedInstanceState == null) {
path = getIntent().getStringExtra(Constants.StringConstant.PARAMS_DATA);
aspectX = getIntent().getIntExtra(Constants.StringConstant.PARAMS_DATA1, 1);
aspectY = getIntent().getIntExtra(Constants.StringConstant.PARAMS_DATA2, 1);
} else {
path = savedInstanceState.getString(Constants.StringConstant.PARAMS_DATA);
aspectX = savedInstanceState.getInt(Constants.StringConstant.PARAMS_DATA1, 1);
aspectY = savedInstanceState.getInt(Constants.StringConstant.PARAMS_DATA2, 1);
}
Crop.pickImage(this);
}
示例5: changeProfilePicture
import com.soundcloud.android.crop.Crop; //导入方法依赖的package包/类
public void changeProfilePicture(View v)
{
Crop.pickImage(ProfileActivity.this);
}
示例6: selectImage
import com.soundcloud.android.crop.Crop; //导入方法依赖的package包/类
@NeedsPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)
public void selectImage() {
Crop.pickImage(getActivity(), this);
fam.collapse();
}
示例7: onMenuItemClick
import com.soundcloud.android.crop.Crop; //导入方法依赖的package包/类
@Override
public boolean onMenuItemClick(MenuItem item) {
List<Integer> idList = MediaStoreUtil.getSongIdList(mId,mType);
//根据不同参数获得歌曲id列表
switch (item.getItemId()) {
//播放
case R.id.menu_play:
if((idList == null || idList.size() == 0)){
ToastUtil.show(mContext,R.string.list_is_empty);
return true;
}
Intent intent = new Intent(MusicService.ACTION_CMD);
Bundle arg = new Bundle();
arg.putInt("Control", Constants.PLAYSELECTEDSONG);
arg.putInt("Position", 0);
intent.putExtras(arg);
Global.setPlayQueue(idList,mContext,intent);
break;
//添加到播放队列
case R.id.menu_add:
if((idList == null || idList.size() == 0)){
ToastUtil.show(mContext,R.string.list_is_empty);
return true;
}
ToastUtil.show(mContext,mContext.getString(R.string.add_song_playqueue_success,Global.AddSongToPlayQueue(idList)));
break;
//删除
case R.id.menu_delete:
new MaterialDialog.Builder(mContext)
.content(mType == Constants.PLAYLIST ? R.string.confirm_delete_playlist : R.string.confirm_delete_from_library)
.buttonRippleColor(ThemeStore.getRippleColor())
.positiveText(R.string.confirm)
.negativeText(R.string.cancel)
.onPositive((dialog, which) -> {
MobclickAgent.onEvent(mContext,"Delete");
if(mId == Global.MyLoveID && mType == Constants.PLAYLIST){
ToastUtil.show(mContext, mContext.getString(R.string.mylove_cant_delete));
}
if(mType != Constants.PLAYLIST){
ToastUtil.show(mContext,MediaStoreUtil.delete(mId , mType) > 0 ? R.string.delete_success : R.string.delete_error);
} else {
ToastUtil.show(mContext,PlayListUtil.deletePlayList(mId) ? R.string.delete_success : R.string.delete_error);
}
})
.onNegative((dialog, which) -> {
})
.backgroundColorAttr(R.attr.background_color_3)
.positiveColorAttr(R.attr.text_color_primary)
.negativeColorAttr(R.attr.text_color_primary)
.contentColorAttr(R.attr.text_color_primary)
.show();
break;
//设置封面
case R.id.menu_album_thumb:
CustomThumb thumbBean = new CustomThumb(mId,mType,mKey);
Intent thumbIntent = ((Activity)mContext).getIntent();
thumbIntent.putExtra("thumb",thumbBean);
thumbIntent.putExtra("test",1234);
((Activity)mContext).setIntent(thumbIntent);
// try {
// Intent pickIntent = new Intent("android.intent.action.GET_CONTENT").setType("image/*");
// pickIntent.putExtra("test",1234);
// pickIntent.setExtrasClassLoader(CustomThumb.class.getClassLoader());
// pickIntent.putExtra("thumb",thumbBean);
//
// ((Activity)mContext).startActivityForResult(pickIntent, Crop.REQUEST_PICK);
// }catch (Exception e){
// Toast.makeText(mContext, com.soundcloud.android.crop.R.string.crop__pick_error, Toast.LENGTH_SHORT).show();
// }
Crop.pickImage((Activity) mContext, Crop.REQUEST_PICK);
break;
default:
ToastUtil.show(mContext,"click " + item.getTitle());
}
return true;
}
示例8: chooseImage
import com.soundcloud.android.crop.Crop; //导入方法依赖的package包/类
@OnClick(R.id.resultView) void chooseImage() {
Crop.pickImage(this);
}