Skip to content

Commit ee9f59b

Browse files
committed
拍照旋转角度功能改为可选
1 parent 1451f38 commit ee9f59b

File tree

5 files changed

+393
-308
lines changed

5 files changed

+393
-308
lines changed

simple/src/main/java/com/jph/simple/CustomHelper.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
*/
4040
public class CustomHelper{
4141
private View rootView;
42-
private RadioGroup rgCrop,rgCompress,rgFrom,rgCropSize,rgCropTool,rgShowProgressBar,rgPickTool,rgCompressTool;
42+
private RadioGroup rgCrop,rgCompress,rgFrom,rgCropSize,rgCropTool,rgShowProgressBar,rgPickTool,rgCompressTool,rgCorrectTool;
4343
private EditText etCropHeight,etCropWidth,etLimit,etSize,etHeightPx,etWidthPx;
4444
public static CustomHelper of(View rootView){
4545
return new CustomHelper(rootView);
@@ -55,6 +55,7 @@ private void init(){
5555
rgCropSize= (RadioGroup) rootView.findViewById(R.id.rgCropSize);
5656
rgFrom= (RadioGroup) rootView.findViewById(R.id.rgFrom);
5757
rgPickTool= (RadioGroup) rootView.findViewById(R.id.rgPickTool);
58+
rgCorrectTool= (RadioGroup) rootView.findViewById(R.id.rgCorrectTool);
5859
rgShowProgressBar= (RadioGroup) rootView.findViewById(R.id.rgShowProgressBar);
5960
rgCropTool= (RadioGroup) rootView.findViewById(R.id.rgCropTool);
6061
etCropHeight= (EditText) rootView.findViewById(R.id.etCropHeight);
@@ -74,7 +75,7 @@ public void onClick(View view,TakePhoto takePhoto) {
7475
Uri imageUri = Uri.fromFile(file);
7576

7677
configCompress(takePhoto);
77-
configTakePhotoOpthion(takePhoto);
78+
configTakePhotoOption(takePhoto);
7879
switch (view.getId()){
7980
case R.id.btnPickBySelect:
8081
int limit= Integer.parseInt(etLimit.getText().toString());
@@ -112,10 +113,16 @@ public void onClick(View view,TakePhoto takePhoto) {
112113
break;
113114
}
114115
}
115-
private void configTakePhotoOpthion(TakePhoto takePhoto){
116+
private void configTakePhotoOption(TakePhoto takePhoto){
117+
TakePhotoOptions.Builder builder=new TakePhotoOptions.Builder();
116118
if(rgPickTool.getCheckedRadioButtonId()==R.id.rbPickWithOwn){
117-
takePhoto.setTakePhotoOptions(new TakePhotoOptions.Builder().setWithOwnGallery(true).create());
119+
builder.setWithOwnGallery(true);
118120
}
121+
if(rgCorrectTool.getCheckedRadioButtonId()==R.id.rbCorrectYes){
122+
builder.setCorrectImage(true);
123+
}
124+
takePhoto.setTakePhotoOptions(builder.create());
125+
119126
}
120127
private void configCompress(TakePhoto takePhoto){
121128
if(rgCompress.getCheckedRadioButtonId()!=R.id.rbCompressYes){

0 commit comments

Comments
 (0)