Skip to content

Commit

Permalink
set save image to true by default
Browse files Browse the repository at this point in the history
  • Loading branch information
esafirm committed Mar 18, 2021
1 parent 7a7b382 commit 04b6613
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void start() {
/* --------------------------------------------------- */

public void init(Context context) {
config = ImagePickerConfigFactory.createDefault(context);
config = ImagePickerConfigFactory.createDefault();
}

public static ImagePickerWithActivity create(Activity activity) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.esafirm.imagepicker.features;

import android.content.Context;

import com.esafirm.imagepicker.features.cameraonly.CameraOnlyConfig;

import java.util.ArrayList;
Expand All @@ -12,10 +10,11 @@ public static CameraOnlyConfig createCameraDefault() {
CameraOnlyConfig config = new CameraOnlyConfig();
config.setSavePath(ImagePickerSavePath.DEFAULT);
config.setReturnMode(ReturnMode.ALL);
config.setSaveImage(true);
return config;
}

public static ImagePickerConfig createDefault(Context context) {
public static ImagePickerConfig createDefault() {
ImagePickerConfig config = new ImagePickerConfig();
config.setMode(IpCons.MODE_MULTIPLE);
config.setLimit(IpCons.MAX_LIMIT);
Expand All @@ -24,6 +23,7 @@ public static ImagePickerConfig createDefault(Context context) {
config.setSelectedImages(new ArrayList<>());
config.setSavePath(ImagePickerSavePath.DEFAULT);
config.setReturnMode(ReturnMode.NONE);
config.setSaveImage(true);
return config;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class DefaultCameraModule : CameraModule, Serializable {
* Helper function to get camera Intent without config
*/
fun getCameraIntent(context: Context): Intent? {
return getCameraIntent(context, ImagePickerConfigFactory.createDefault(context))
return getCameraIntent(context, ImagePickerConfigFactory.createDefault())
}

override fun getCameraIntent(context: Context, config: BaseConfig): Intent? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class BaseConfig implements Parcelable {

private ImagePickerSavePath savePath;
private ReturnMode returnMode;
private boolean saveImage;
private boolean saveImage = true;

public ReturnMode getReturnMode() {
return returnMode;
Expand Down

0 comments on commit 04b6613

Please sign in to comment.