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


Java Crop.pickImage方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:VernonVan,项目名称:Face,代码行数:19,代码来源:FaceDetectFragment.java

示例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;
    }
}
 
开发者ID:VernonVan,项目名称:Face,代码行数:21,代码来源:SimilarFaceFragment.java

示例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);
}
 
开发者ID:MiracleWong,项目名称:MWZhiHuDaily,代码行数:10,代码来源:PickPhotoActivity.java

示例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);
}
 
开发者ID:androidertc,项目名称:iLocker,代码行数:16,代码来源:CropImageActivity.java

示例5: changeProfilePicture

import com.soundcloud.android.crop.Crop; //导入方法依赖的package包/类
public void changeProfilePicture(View v)
{
    Crop.pickImage(ProfileActivity.this);
}
 
开发者ID:mstfnacar,项目名称:foodfeed,代码行数:5,代码来源:ProfileActivity.java

示例6: selectImage

import com.soundcloud.android.crop.Crop; //导入方法依赖的package包/类
@NeedsPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)
public void selectImage() {
    Crop.pickImage(getActivity(), this);
    fam.collapse();
}
 
开发者ID:IgorGee,项目名称:Carbonizr,代码行数:6,代码来源:HomePageFragment.java

示例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;
    }
 
开发者ID:rRemix,项目名称:APlayer,代码行数:78,代码来源:AlbArtFolderPlaylistListener.java

示例8: chooseImage

import com.soundcloud.android.crop.Crop; //导入方法依赖的package包/类
@OnClick(R.id.resultView) void chooseImage() {
  Crop.pickImage(this);
}
 
开发者ID:MMAUG,项目名称:FloodInfo,代码行数:4,代码来源:ReportActivity.java


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