Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
罗孟伟 committed Feb 1, 2018
1 parent 3822e70 commit 60d3f05
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ protected void startCrop(String originalPath) {
options.setCircleDimmedLayer(config.circleDimmedLayer);
options.setShowCropFrame(config.showCropFrame);
options.setShowCropGrid(config.showCropGrid);
options.setDragFrameEnabled(config.isDragFrame);
options.setScaleEnabled(config.scaleEnabled);
options.setRotateEnabled(config.rotateEnabled);
options.setCompressionQuality(config.cropCompressQuality);
options.setHideBottomControls(config.hideBottomControls);
options.setFreeStyleCropEnabled(config.freeStyleCropEnabled);
Expand Down Expand Up @@ -291,6 +294,7 @@ protected void startCrop(ArrayList<String> list) {
options.setToolbarWidgetColor(titleColor);
options.setCircleDimmedLayer(config.circleDimmedLayer);
options.setShowCropFrame(config.showCropFrame);
options.setDragFrameEnabled(config.isDragFrame);
options.setShowCropGrid(config.showCropGrid);
options.setScaleEnabled(config.scaleEnabled);
options.setRotateEnabled(config.rotateEnabled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public PictureSelectionModel showCropGrid(boolean showCropGrid) {

/**
* @param hideBottomControls Whether is Clipping function bar
* 单选有效
* @return
*/
public PictureSelectionModel hideBottomControls(boolean hideBottomControls) {
Expand Down Expand Up @@ -295,7 +296,7 @@ public PictureSelectionModel synOrAsy(boolean synOrAsy) {
}

/**
* @param compress save path
* @param path save path
* @return
*/
public PictureSelectionModel compressSavePath(String path) {
Expand Down Expand Up @@ -375,6 +376,14 @@ public PictureSelectionModel openClickSound(boolean openClickSound) {
return this;
}

/**
* 是否可拖动裁剪框(setFreeStyleCropEnabled 为true 有效)
*/
public PictureSelectionModel isDragFrame(boolean isDragFrame) {
selectionConfig.isDragFrame = isDragFrame;
return this;
}

/**
* @param selectionMedia Select the selected picture set
* @return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public final class PictureSelectionConfig implements Parcelable {
public boolean scaleEnabled;
public boolean previewEggs;
public boolean synOrAsy;
public boolean isDragFrame;

public List<LocalMedia> selectionMedias;

Expand Down Expand Up @@ -105,6 +106,7 @@ private void reset() {
previewEggs = false;
synOrAsy = true;
zoomAnim = true;
isDragFrame = true;
outputCameraPath = "";
compressSavePath = "";
suffixType = PictureFileUtils.POSTFIX;
Expand Down Expand Up @@ -175,6 +177,7 @@ public void writeToParcel(Parcel dest, int flags) {
dest.writeByte(this.scaleEnabled ? (byte) 1 : (byte) 0);
dest.writeByte(this.previewEggs ? (byte) 1 : (byte) 0);
dest.writeByte(this.synOrAsy ? (byte) 1 : (byte) 0);
dest.writeByte(this.isDragFrame ? (byte) 1 : (byte) 0);
dest.writeTypedList(this.selectionMedias);
}

Expand Down Expand Up @@ -224,6 +227,7 @@ protected PictureSelectionConfig(Parcel in) {
this.scaleEnabled = in.readByte() != 0;
this.previewEggs = in.readByte() != 0;
this.synOrAsy = in.readByte() != 0;
this.isDragFrame = in.readByte() != 0;
this.selectionMedias = in.createTypedArrayList(LocalMedia.CREATOR);
}

Expand Down

0 comments on commit 60d3f05

Please sign in to comment.