3939 */
4040public 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