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


Java Crop.REQUEST_CROP属性代码示例

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


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

示例1: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == Crop.REQUEST_PICK) {
        photoImageView.setClickable(true);
        if (resultCode == Activity.RESULT_OK) {
            // 选择图片后
            beginCrop(data.getData());
        }

    } else if (requestCode == Crop.REQUEST_CROP) {
        // 图片编辑完后
        handleCrop(resultCode, data);
    }
}
 
开发者ID:VernonVan,项目名称:Face,代码行数:17,代码来源:FaceDetectFragment.java

示例2: onActivityResult

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    /*  Changed by Sharath Pandeshwar on 05/03/2014 */

    //Changed to CreateEditWallPostFragment
    if (requestCode == Crop.REQUEST_PICK) {
        ((CreateEditWallPostFragment) getSupportFragmentManager().findFragmentByTag(AppConstants.FragmentTags.POST_ON_WALL)).onActivityResult(requestCode, resultCode, data);
        Logger.d(TAG, "REQUEST PICK");
    } else if (requestCode == Crop.REQUEST_CROP) {
        ((CreateEditWallPostFragment) getSupportFragmentManager().findFragmentByTag(AppConstants.FragmentTags.POST_ON_WALL)).onActivityResult(requestCode, resultCode, data);
        Logger.d(TAG, "REQUEST CROP");
    }

    /*  End of modification by Sharath Pandeshwar on 05/03/2014 */
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:17,代码来源:EditWallPostActivity.java

示例3: onActivityResult

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == REQUEST_GALLERY && resultCode == Activity.RESULT_OK) {
        tempAvatarPath = Files.getInternalTempFile("avatar", "jpg");
        Crop.of(data.getData(), Uri.fromFile(new File(tempAvatarPath)))

                .asSquare()
                .start(this);
        return;
    } else if (requestCode == REQUEST_PHOTO && resultCode == Activity.RESULT_OK) {
        tempAvatarPath = Files.getInternalTempFile("avatar", "jpg");
        Crop.of(Uri.fromFile(new File(externalFile)), Uri.fromFile(new File(tempAvatarPath)))
                .asSquare()
                .start(this);
        return;
    } else if (requestCode == Crop.REQUEST_CROP && resultCode == Activity.RESULT_OK) {
        setResult(RESULT_OK, new Intent()
                .putExtra(Intents.EXTRA_RESULT, Intents.RESULT_IMAGE)
                .putExtra(Intents.EXTRA_IMAGE, tempAvatarPath));
        finish();
        return;
    }

    setResult(RESULT_CANCELED);
    finish();
}
 
开发者ID:actorapp,项目名称:actor-platform,代码行数:26,代码来源:TakePhotoActivity.java

示例4: onActivityResult

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == REQUEST_GALLERY && resultCode == Activity.RESULT_OK) {
        avatarPath = Files.getInternalTempFile("avatar", "jpg");
        Crop.of(data.getData(), Uri.fromFile(new File(avatarPath)))
                .asSquare()
                .start(this);
    } else if (requestCode == REQUEST_PHOTO && resultCode == Activity.RESULT_OK) {
        avatarPath = Files.getInternalTempFile("avatar", "jpg");
        Crop.of(Uri.fromFile(new File(externalFile)), Uri.fromFile(new File(avatarPath)))
                .asSquare()
                .start(this);
    } else if (requestCode == Crop.REQUEST_CROP && resultCode == Activity.RESULT_OK) {
        if (avatarPath == null) {
            return;
        }
        if (peer.getPeerType() == PeerType.PRIVATE) {
            if (peer.getPeerId() == myUid()) {
                messenger().changeMyAvatar(avatarPath);
            }
        } else if (peer.getPeerType() == PeerType.GROUP) {
            messenger().changeGroupAvatar(peer.getPeerId(), avatarPath);
        }
    }
}
 
开发者ID:actorapp,项目名称:actor-platform,代码行数:25,代码来源:ViewAvatarActivity.java

示例5: onActivityResult

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == REQUEST_GALLERY && resultCode == Activity.RESULT_OK) {
        avatarPath = AppContext.getInternalTempFile("avatar", "jpg");
        Crop.of(data.getData(), Uri.fromFile(new File(avatarPath)))
                .asSquare()
                .start(this);
    } else if (requestCode == REQUEST_PHOTO && resultCode == Activity.RESULT_OK) {
        avatarPath = AppContext.getInternalTempFile("avatar", "jpg");
        Crop.of(Uri.fromFile(new File(externalFile)), Uri.fromFile(new File(avatarPath)))
                .asSquare()
                .start(this);
    } else if (requestCode == Crop.REQUEST_CROP && resultCode == Activity.RESULT_OK) {
        if (peer.getPeerType() == PeerType.PRIVATE) {
            if (peer.getPeerId() == myUid()) {
                messenger().changeMyAvatar(avatarPath);
            }
        } else if (peer.getPeerType() == PeerType.GROUP) {
            messenger().changeGroupAvatar(peer.getPeerId(), avatarPath);
        }
    }
}
 
开发者ID:dsaved,项目名称:africhat-platform-0.1,代码行数:22,代码来源:ViewAvatarActivity.java

示例6: onActivityResult

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == REQUEST_GALLERY && resultCode == Activity.RESULT_OK) {
        tempAvatarPath = AppContext.getInternalTempFile("avatar", "jpg");
        Crop.of(data.getData(), Uri.fromFile(new File(tempAvatarPath)))

                .asSquare()
                .start(this);
        return;
    } else if (requestCode == REQUEST_PHOTO && resultCode == Activity.RESULT_OK) {
        tempAvatarPath = AppContext.getInternalTempFile("avatar", "jpg");
        Crop.of(Uri.fromFile(new File(externalFile)), Uri.fromFile(new File(tempAvatarPath)))
                .asSquare()
                .start(this);
        return;
    } else if (requestCode == Crop.REQUEST_CROP && resultCode == Activity.RESULT_OK) {
        setResult(RESULT_OK, new Intent()
                .putExtra(Intents.EXTRA_RESULT, Intents.RESULT_IMAGE)
                .putExtra(Intents.EXTRA_IMAGE, tempAvatarPath));
        finish();
        return;
    }

    setResult(RESULT_CANCELED);
    finish();
}
 
开发者ID:dsaved,项目名称:africhat-platform-0.1,代码行数:26,代码来源:TakePhotoActivity.java

示例7: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == Crop.REQUEST_CROP && resultCode == Activity.RESULT_OK) {
        Rect rect = Crop.getRect(data);
        Boundary b = new Boundary(rect.left, rect.top, rect.width(), rect.height());
        requestBounds(b);
    }
    else if (resultCode == Crop.RESULT_REFRESH)
    {
        takePhoto();
    }
    else {

        mListener.onSetupServerAborted();
    }
}
 
开发者ID:ludwigandersson,项目名称:thermospy,代码行数:17,代码来源:SetupBoundary.java

示例8: onActivityResult

@Override
public void onActivityResult(int reqCode, int resultCode, final Intent data) {
  super.onActivityResult(reqCode, resultCode, data);
  Uri outputFile = Uri.fromFile(new File(getCacheDir(), "cropped"));

  if (data == null || resultCode != Activity.RESULT_OK)
    return;

  switch (reqCode) {
    case PICK_CONTACT:
      List<String> selected = data.getStringArrayListExtra("contacts");
      for (String contact : selected) {
        final Recipient recipient = RecipientFactory.getRecipientsFromString(this, contact, false).getPrimaryRecipient();
        if (recipient != null) addSelectedContacts(recipient);
      }
      break;

    case Crop.REQUEST_PICK:
      new Crop(data.getData()).output(outputFile).asSquare().start(this);
      break;
    case Crop.REQUEST_CROP:
      Glide.with(this).load(Crop.getOutput(data)).asBitmap()
           .skipMemoryCache(true)
           .diskCacheStrategy(DiskCacheStrategy.NONE)
           .centerCrop().override(AVATAR_SIZE, AVATAR_SIZE)
           .into(new SimpleTarget<Bitmap>() {
             @Override
             public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
               setAvatar(Crop.getOutput(data), resource);
             }
           });
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:33,代码来源:GroupCreateActivity.java

示例9: processPickedPhoto

private void processPickedPhoto(int resultCode, Intent data){

        switch (resultCode)
        {
            case Activity.RESULT_OK:

                Uri uri = data.getData();
                mFileName = DaoCore.generateEntity();

                // If enabled we will save the image to the app
                // directory in gallery else we will save it in the cache dir.
                File dir;
                if (BDefines.Options.SaveImagesToDir)
                    dir = Utils.ImageSaver.getAlbumStorageDir(activity.get(), Utils.ImageSaver.IMAGE_DIR_NAME);
                else
                    dir = this.activity.get().getCacheDir();

                if (dir == null)
                {
                    uiHelper.dismissProgressCard();
                    uiHelper.showAlertToast(R.string.unable_to_fetch_image);
                    return;
                }

                Uri outputUri = Uri.fromFile(new File(dir, mFileName  + ".jpeg"));

                crop = new Cropper(uri);

                Intent cropIntent = crop.getAdjustIntent(this.activity.get(), outputUri);
                int request = Crop.REQUEST_CROP + PHOTO_PICKER_ID;

                activity.get().startActivityForResult(cropIntent, request);

                return;

            case Activity.RESULT_CANCELED:
                uiHelper.dismissProgressCard();
        }
    }
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:39,代码来源:ChatSDKChatHelper.java

示例10: onActivityResult

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {


   /* super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == GET_FROM_GALLERY && resultCode == Activity.RESULT_OK) {
         selectedImage = data.getData();
        String[] filePathColumn ={MediaStore.Images.Media.DATA};
        Cursor cursor=getContentResolver().query(selectedImage,filePathColumn,null,null,null);
        cursor.moveToFirst();
        int columnIndex =cursor.getColumnIndex(filePathColumn[0]);
        String picturePath =cursor.getString(columnIndex);
        cursor.close();
        user_img.setImageBitmap(BitmapFactory.decodeFile(picturePath));
    }*/


    if (requestCode == Crop.REQUEST_PICK && resultCode == RESULT_OK) {
        beginCrop(data.getData());
    } else if (requestCode == Crop.REQUEST_CROP) {
        handleCrop(resultCode, data);
    }
}
 
开发者ID:salRoid,项目名称:Clasick,代码行数:23,代码来源:ChangeProfile.java

示例11: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent result) {
    super.onActivityResult(requestCode, resultCode, result);
    if (resultCode != Activity.RESULT_OK)
        return;
    if (requestCode == CAMERA_REQUEST_CODE) {
        beginCrop(Uri.fromFile(new File(IMAGNAME)));
    } else if (requestCode == Crop.REQUEST_PICK) {
        beginCrop(result.getData());
    } else if (requestCode == Crop.REQUEST_CROP) {
        handleCrop(result);
    }
}
 
开发者ID:shegang,项目名称:meishiDemo,代码行数:13,代码来源:UserInfoEditFragment.java

示例12: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == Crop.REQUEST_PICK) {
        photoImageView.setClickable(true);
        if (resultCode == Activity.RESULT_OK){
            // 选择图片后
            beginCrop(data.getData());
        }
    } else if (requestCode == Crop.REQUEST_CROP) {
        // 图片编辑完后
        handleCrop(resultCode, data);
    }
}
 
开发者ID:VernonVan,项目名称:Face,代码行数:16,代码来源:FunnyCharletFragment.java

示例13: onActivityResult

@Override
protected void onActivityResult(int requestCode, int resultCode, final Intent data) {
	super.onActivityResult(requestCode, resultCode, data);
	if (resultCode == RESULT_OK) {
		switch (requestCode) {
			case REQUEST_CHOOSE_FILE:
				Uri source = data.getData();
				String original = FileUtils.getPath(this, source);
				if (original != null) {
					source = Uri.parse("file://"+original);
				}
				Uri destination = Uri.fromFile(new File(getCacheDir(), "croppedAvatar"));
				final int size = getPixel(192);
				Crop.of(source, destination).asSquare().withMaxSize(size, size).start(this);
				break;
			case Crop.REQUEST_CROP:
				this.avatarUri = Uri.fromFile(new File(getCacheDir(), "croppedAvatar"));
				loadImageIntoPreview(this.avatarUri);
				break;
		}
	}
}
 
开发者ID:xavierle,项目名称:messengerxmpp,代码行数:22,代码来源:PublishProfilePictureActivity.java

示例14: onActivityResult

@Override
protected void onActivityResult(final int requestCode, final int resultCode,
                                final Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if ((requestCode == GooglePlusManager.CONNECTION_UPDATE_ERROR)
            && (resultCode == RESULT_OK)) {
        mGooglePlusManager.onActivityResult();
    } else if (requestCode == Crop.REQUEST_CROP) {

        ((EditProfileFragment) getSupportFragmentManager().findFragmentByTag(AppConstants.FragmentTags.EDIT_PROFILE)).onActivityResult
                (requestCode, resultCode,
                        data);
        Logger.d(TAG, "REQUEST CROP");
    }

    else if (requestCode == Crop.REQUEST_PICK) {

        ((EditProfileFragment) getSupportFragmentManager().findFragmentByTag(AppConstants.FragmentTags.EDIT_PROFILE)).onActivityResult
                (requestCode, resultCode,
                        data);
        Logger.d(TAG, "REQUEST PICK");
    }
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:23,代码来源:EditProfileActivity.java

示例15: handleResult

public void handleResult(int requestCode, int resultCode, Intent data) {
    if (DEBUG) Timber.v("onActivityResult");

    if (!hasActivity()) return;

    /* Pick photo logic*/
    if (requestCode == PHOTO_PICKER_ID)
    {
        processPickedPhoto(resultCode, data);
    }
    else  if (requestCode == Crop.REQUEST_CROP + PHOTO_PICKER_ID) {
        processCroppedPhoto(resultCode, data);
    }
    /* Pick location logic*/
    else if (requestCode == PICK_LOCATION)
    {
        processPickedLocation(resultCode, data);
    }
    /* Capture image logic*/
    else if (requestCode == CAPTURE_IMAGE)
    {
        if (resultCode == Activity.RESULT_OK) {
            sendImageMessage(selectedFilePath);
        }
    }
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:26,代码来源:ChatSDKChatHelper.java


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