diff --git a/hooks/before_build/generateActivity.js b/hooks/before_build/generateActivity.js
index de5f0dc..d43d251 100644
--- a/hooks/before_build/generateActivity.js
+++ b/hooks/before_build/generateActivity.js
@@ -166,7 +166,7 @@ var updateConfig = function() {
var contentResAndroidPlugin = fs.readdirSync(pathResAndroidPlugin);
for (var i = contentResAndroidPlugin.length - 1; i >= 0; i--) {
var nameDirDrawable = contentResAndroidPlugin[i];
- if (nameDirDrawable.match(/^drawable-.*$/) || nameDirDrawable.match(/^values-?.*$/)) {
+ if (nameDirDrawable.match(/^drawable-?.*$/) || nameDirDrawable.match(/^values-?.*$/)) {
var contentDrawableDir = fs.readdirSync(pathResAndroidPlugin+nameDirDrawable);
for (var j = contentDrawableDir.length - 1; j >= 0; j--) {
var nameFileInDrawable = contentDrawableDir[j];
diff --git a/plugin.xml b/plugin.xml
index dccb0a6..2d57c06 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -5,12 +5,12 @@
id="org.geneanet.customCamera"
version="0.0.1"
>
- customCamera
+ GeneanetCustomCamera
customCamera by Geneanet
undefined
custom,camera,geneanet
-
-
+
+
diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java
index f995f9d..5db8d89 100644
--- a/src/android/CameraLauncher.java
+++ b/src/android/CameraLauncher.java
@@ -52,6 +52,8 @@ public class CameraLauncher extends CordovaPlugin {
}
intent.putExtra("miniature", args.getBoolean(1));
+ intent.putExtra("cameraBackgroundColor", args.getString(2));
+ intent.putExtra("cameraBackgroundColorPressed", args.getString(3));
cordova.startActivityForResult((CordovaPlugin) this, intent, CameraLauncher.REQUEST_CODE);
diff --git a/src/android/customCamera/res/drawable-hdpi/accept.png b/src/android/customCamera/res/drawable-hdpi/accept.png
new file mode 100644
index 0000000..2132a9b
Binary files /dev/null and b/src/android/customCamera/res/drawable-hdpi/accept.png differ
diff --git a/src/android/customCamera/res/drawable-hdpi/capture.png b/src/android/customCamera/res/drawable-hdpi/capture.png
new file mode 100644
index 0000000..f79bed6
Binary files /dev/null and b/src/android/customCamera/res/drawable-hdpi/capture.png differ
diff --git a/src/android/customCamera/res/drawable-hdpi/colorise.jpg b/src/android/customCamera/res/drawable-hdpi/colorise.jpg
deleted file mode 100644
index 6002eaf..0000000
Binary files a/src/android/customCamera/res/drawable-hdpi/colorise.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-hdpi/couthenans.jpg b/src/android/customCamera/res/drawable-hdpi/couthenans.jpg
deleted file mode 100644
index 6f297aa..0000000
Binary files a/src/android/customCamera/res/drawable-hdpi/couthenans.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-hdpi/delete.png b/src/android/customCamera/res/drawable-hdpi/delete.png
new file mode 100644
index 0000000..cea182e
Binary files /dev/null and b/src/android/customCamera/res/drawable-hdpi/delete.png differ
diff --git a/src/android/customCamera/res/drawable-hdpi/hericourt.jpg b/src/android/customCamera/res/drawable-hdpi/hericourt.jpg
deleted file mode 100644
index d8cd591..0000000
Binary files a/src/android/customCamera/res/drawable-hdpi/hericourt.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-hdpi/ic_launcher.png b/src/android/customCamera/res/drawable-hdpi/ic_launcher.png
deleted file mode 100644
index 288b665..0000000
Binary files a/src/android/customCamera/res/drawable-hdpi/ic_launcher.png and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-hdpi/labs.png b/src/android/customCamera/res/drawable-hdpi/labs.png
deleted file mode 100644
index e4fada3..0000000
Binary files a/src/android/customCamera/res/drawable-hdpi/labs.png and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-hdpi/normal.jpg b/src/android/customCamera/res/drawable-hdpi/normal.jpg
deleted file mode 100644
index 8e97385..0000000
Binary files a/src/android/customCamera/res/drawable-hdpi/normal.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-hdpi/paysage.jpg b/src/android/customCamera/res/drawable-hdpi/paysage.jpg
deleted file mode 100644
index 1b9ff16..0000000
Binary files a/src/android/customCamera/res/drawable-hdpi/paysage.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-ldpi/capture.png b/src/android/customCamera/res/drawable-ldpi/capture.png
new file mode 100644
index 0000000..f489d86
Binary files /dev/null and b/src/android/customCamera/res/drawable-ldpi/capture.png differ
diff --git a/src/android/customCamera/res/drawable-ldpi/custom_opacity_bar.xml b/src/android/customCamera/res/drawable-ldpi/custom_opacity_bar.xml
deleted file mode 100644
index 6a987fc..0000000
--- a/src/android/customCamera/res/drawable-ldpi/custom_opacity_bar.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
- -
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/android/customCamera/res/drawable-mdpi/capture.png b/src/android/customCamera/res/drawable-mdpi/capture.png
new file mode 100644
index 0000000..5e16088
Binary files /dev/null and b/src/android/customCamera/res/drawable-mdpi/capture.png differ
diff --git a/src/android/customCamera/res/drawable-mdpi/colorise.jpg b/src/android/customCamera/res/drawable-mdpi/colorise.jpg
deleted file mode 100644
index 6002eaf..0000000
Binary files a/src/android/customCamera/res/drawable-mdpi/colorise.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-mdpi/couthenans.jpg b/src/android/customCamera/res/drawable-mdpi/couthenans.jpg
deleted file mode 100644
index 6f297aa..0000000
Binary files a/src/android/customCamera/res/drawable-mdpi/couthenans.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-mdpi/custom_opacity_bar.xml b/src/android/customCamera/res/drawable-mdpi/custom_opacity_bar.xml
deleted file mode 100644
index 4a86a09..0000000
--- a/src/android/customCamera/res/drawable-mdpi/custom_opacity_bar.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/android/customCamera/res/drawable-mdpi/hericourt.jpg b/src/android/customCamera/res/drawable-mdpi/hericourt.jpg
deleted file mode 100644
index d8cd591..0000000
Binary files a/src/android/customCamera/res/drawable-mdpi/hericourt.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-mdpi/ic_launcher.png b/src/android/customCamera/res/drawable-mdpi/ic_launcher.png
deleted file mode 100644
index 6ae570b..0000000
Binary files a/src/android/customCamera/res/drawable-mdpi/ic_launcher.png and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-mdpi/labs.png b/src/android/customCamera/res/drawable-mdpi/labs.png
deleted file mode 100644
index e4fada3..0000000
Binary files a/src/android/customCamera/res/drawable-mdpi/labs.png and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-mdpi/normal.jpg b/src/android/customCamera/res/drawable-mdpi/normal.jpg
deleted file mode 100644
index 8e97385..0000000
Binary files a/src/android/customCamera/res/drawable-mdpi/normal.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-mdpi/paysage.jpg b/src/android/customCamera/res/drawable-mdpi/paysage.jpg
deleted file mode 100644
index 1b9ff16..0000000
Binary files a/src/android/customCamera/res/drawable-mdpi/paysage.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-mdpi/thumb.xml b/src/android/customCamera/res/drawable-mdpi/thumb.xml
deleted file mode 100644
index 5c01649..0000000
--- a/src/android/customCamera/res/drawable-mdpi/thumb.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/android/customCamera/res/drawable-xhdpi/capture.png b/src/android/customCamera/res/drawable-xhdpi/capture.png
new file mode 100644
index 0000000..8af281c
Binary files /dev/null and b/src/android/customCamera/res/drawable-xhdpi/capture.png differ
diff --git a/src/android/customCamera/res/drawable-xhdpi/colorise.jpg b/src/android/customCamera/res/drawable-xhdpi/colorise.jpg
deleted file mode 100644
index 6002eaf..0000000
Binary files a/src/android/customCamera/res/drawable-xhdpi/colorise.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-xhdpi/couthenans.jpg b/src/android/customCamera/res/drawable-xhdpi/couthenans.jpg
deleted file mode 100644
index 6f297aa..0000000
Binary files a/src/android/customCamera/res/drawable-xhdpi/couthenans.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-xhdpi/custom_opacity_bar.xml b/src/android/customCamera/res/drawable-xhdpi/custom_opacity_bar.xml
deleted file mode 100644
index 4a86a09..0000000
--- a/src/android/customCamera/res/drawable-xhdpi/custom_opacity_bar.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/android/customCamera/res/drawable-xhdpi/hericourt.jpg b/src/android/customCamera/res/drawable-xhdpi/hericourt.jpg
deleted file mode 100644
index d8cd591..0000000
Binary files a/src/android/customCamera/res/drawable-xhdpi/hericourt.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-xhdpi/ic_launcher.png b/src/android/customCamera/res/drawable-xhdpi/ic_launcher.png
deleted file mode 100644
index d4fb7cd..0000000
Binary files a/src/android/customCamera/res/drawable-xhdpi/ic_launcher.png and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-xhdpi/labs.png b/src/android/customCamera/res/drawable-xhdpi/labs.png
deleted file mode 100644
index e4fada3..0000000
Binary files a/src/android/customCamera/res/drawable-xhdpi/labs.png and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-xhdpi/normal.jpg b/src/android/customCamera/res/drawable-xhdpi/normal.jpg
deleted file mode 100644
index 8e97385..0000000
Binary files a/src/android/customCamera/res/drawable-xhdpi/normal.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-xhdpi/paysage.jpg b/src/android/customCamera/res/drawable-xhdpi/paysage.jpg
deleted file mode 100644
index 1b9ff16..0000000
Binary files a/src/android/customCamera/res/drawable-xhdpi/paysage.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-xhdpi/thumb.xml b/src/android/customCamera/res/drawable-xhdpi/thumb.xml
deleted file mode 100644
index 5c01649..0000000
--- a/src/android/customCamera/res/drawable-xhdpi/thumb.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/android/customCamera/res/drawable-xxhdpi/capture.png b/src/android/customCamera/res/drawable-xxhdpi/capture.png
new file mode 100644
index 0000000..7bf527d
Binary files /dev/null and b/src/android/customCamera/res/drawable-xxhdpi/capture.png differ
diff --git a/src/android/customCamera/res/drawable-xxhdpi/colorise.jpg b/src/android/customCamera/res/drawable-xxhdpi/colorise.jpg
deleted file mode 100644
index 6002eaf..0000000
Binary files a/src/android/customCamera/res/drawable-xxhdpi/colorise.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-xxhdpi/couthenans.jpg b/src/android/customCamera/res/drawable-xxhdpi/couthenans.jpg
deleted file mode 100644
index 6f297aa..0000000
Binary files a/src/android/customCamera/res/drawable-xxhdpi/couthenans.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-xxhdpi/custom_opacity_bar.xml b/src/android/customCamera/res/drawable-xxhdpi/custom_opacity_bar.xml
deleted file mode 100644
index 4a86a09..0000000
--- a/src/android/customCamera/res/drawable-xxhdpi/custom_opacity_bar.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/android/customCamera/res/drawable-xxhdpi/hericourt.jpg b/src/android/customCamera/res/drawable-xxhdpi/hericourt.jpg
deleted file mode 100644
index d8cd591..0000000
Binary files a/src/android/customCamera/res/drawable-xxhdpi/hericourt.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-xxhdpi/ic_launcher.png b/src/android/customCamera/res/drawable-xxhdpi/ic_launcher.png
deleted file mode 100644
index 85a6081..0000000
Binary files a/src/android/customCamera/res/drawable-xxhdpi/ic_launcher.png and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-xxhdpi/labs.png b/src/android/customCamera/res/drawable-xxhdpi/labs.png
deleted file mode 100644
index e4fada3..0000000
Binary files a/src/android/customCamera/res/drawable-xxhdpi/labs.png and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-xxhdpi/normal.jpg b/src/android/customCamera/res/drawable-xxhdpi/normal.jpg
deleted file mode 100644
index 8e97385..0000000
Binary files a/src/android/customCamera/res/drawable-xxhdpi/normal.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-xxhdpi/paysage.jpg b/src/android/customCamera/res/drawable-xxhdpi/paysage.jpg
deleted file mode 100644
index 1b9ff16..0000000
Binary files a/src/android/customCamera/res/drawable-xxhdpi/paysage.jpg and /dev/null differ
diff --git a/src/android/customCamera/res/drawable-xxhdpi/thumb.xml b/src/android/customCamera/res/drawable-xxhdpi/thumb.xml
deleted file mode 100644
index 5c01649..0000000
--- a/src/android/customCamera/res/drawable-xxhdpi/thumb.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/android/customCamera/res/drawable-xxxhdpi/capture.png b/src/android/customCamera/res/drawable-xxxhdpi/capture.png
new file mode 100644
index 0000000..23cff10
Binary files /dev/null and b/src/android/customCamera/res/drawable-xxxhdpi/capture.png differ
diff --git a/src/android/customCamera/res/drawable-hdpi/custom_opacity_bar.xml b/src/android/customCamera/res/drawable/custom_opacity_bar.xml
similarity index 100%
rename from src/android/customCamera/res/drawable-hdpi/custom_opacity_bar.xml
rename to src/android/customCamera/res/drawable/custom_opacity_bar.xml
diff --git a/src/android/customCamera/res/drawable/round_button.xml b/src/android/customCamera/res/drawable/round_button.xml
new file mode 100644
index 0000000..7b02ec2
--- /dev/null
+++ b/src/android/customCamera/res/drawable/round_button.xml
@@ -0,0 +1,5 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/android/customCamera/res/drawable-hdpi/thumb.xml b/src/android/customCamera/res/drawable/thumb.xml
similarity index 100%
rename from src/android/customCamera/res/drawable-hdpi/thumb.xml
rename to src/android/customCamera/res/drawable/thumb.xml
diff --git a/src/android/customCamera/res/layout/activity_camera_view.xml b/src/android/customCamera/res/layout/activity_camera_view.xml
index 92cd692..b0b9605 100644
--- a/src/android/customCamera/res/layout/activity_camera_view.xml
+++ b/src/android/customCamera/res/layout/activity_camera_view.xml
@@ -38,14 +38,13 @@
android:layout_weight="0.2"
android:onClick="buttonMiniature"
android:text="@string/miniature" />
-
-
+ android:background="@drawable/round_button"
+ android:src="@drawable/capture" />
-
+ android:src="@drawable/accept"
+ android:background="@android:color/transparent" />
-
+ android:src="@drawable/delete"
+ android:background="@android:color/transparent" />
+
diff --git a/src/android/customCamera/res/values/strings.xml b/src/android/customCamera/res/values/strings.xml
index b9fad09..c6947f0 100644
--- a/src/android/customCamera/res/values/strings.xml
+++ b/src/android/customCamera/res/values/strings.xml
@@ -1,6 +1,5 @@
-
TestCustomCamera
Hello world!
Settings
@@ -11,7 +10,7 @@
Miniature
Photo
Ceci est le bouton permettant d\'afficher une miniature
- Il s\'agit de l\'image de fond de l\'appareil photo
- Accepter Photo
- Refuser Photo
+ Il s\'agit de l\'image de fond de l\'appareil photo
+ Accepter Photo
+ Refuser Photo
diff --git a/src/android/customCamera/src/org/geneanet/customcamera/CameraActivity.java b/src/android/customCamera/src/org/geneanet/customcamera/CameraActivity.java
index dd6993e..4bc2761 100644
--- a/src/android/customCamera/src/org/geneanet/customcamera/CameraActivity.java
+++ b/src/android/customCamera/src/org/geneanet/customcamera/CameraActivity.java
@@ -7,7 +7,9 @@ import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.BitmapFactory;
+import android.graphics.Color;
import android.graphics.Matrix;
+import android.graphics.drawable.GradientDrawable;
import android.hardware.Camera;
import android.hardware.Camera.CameraInfo;
import android.hardware.Camera.PictureCallback;
@@ -26,6 +28,7 @@ import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.FrameLayout;
+import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
@@ -118,6 +121,51 @@ public class CameraActivity extends Activity {
Button miniature = (Button) findViewById(R.id.miniature);
miniature.setVisibility(View.INVISIBLE);
}
+
+ ImageButton imgIcon = (ImageButton)findViewById(R.id.capture);
+ final Activity currentActivity = this;
+
+ this.setCameraBackgroundColor(this.getIntent().getStringExtra("cameraBackgroundColor"));
+
+ imgIcon.setOnTouchListener(new View.OnTouchListener() {
+ @Override
+ public boolean onTouch(View view, MotionEvent event) {
+ switch (event.getAction()) {
+ case MotionEvent.ACTION_DOWN:
+ ((CameraActivity) currentActivity).setCameraBackgroundColor(
+ currentActivity.getIntent().getStringExtra("cameraBackgroundColorPressed"));
+ break;
+ case MotionEvent.ACTION_UP:
+ view.performClick();
+ ((CameraActivity) currentActivity).setCameraBackgroundColor(
+ currentActivity.getIntent().getStringExtra("cameraBackgroundColor"));
+ ((CameraActivity) currentActivity).takePhoto();
+ break;
+ default:
+ break;
+ }
+ return true;
+ }
+ });
+ }
+
+ /**
+ * Set the background color of the camera button.
+ * @param color The color of the background.
+ */
+ protected void setCameraBackgroundColor(String color) {
+ ImageButton imgIcon = (ImageButton)findViewById(R.id.capture);
+ GradientDrawable backgroundGradient = (GradientDrawable)imgIcon.getBackground();
+ if (color.length() > 0) {
+ try {
+ int cameraBackgroundColor = Color.parseColor(color);
+ backgroundGradient.setColor(cameraBackgroundColor);
+ } catch (IllegalArgumentException e) {
+ backgroundGradient.setColor(Color.TRANSPARENT);
+ }
+ } else {
+ backgroundGradient.setColor(Color.TRANSPARENT);
+ }
}
/** Method onStart. Handle the zoom level seekBar and the camera orientation. */
@@ -415,7 +463,7 @@ public class CameraActivity extends Activity {
*/
public void displayAcceptDeclineButtons() {
LinearLayout keepPhoto = (LinearLayout) findViewById(R.id.keepPhoto);
- Button photo = (Button) findViewById(R.id.capture);
+ ImageButton photo = (ImageButton) findViewById(R.id.capture);
SeekBar zoomLevel = (SeekBar) findViewById(R.id.zoomLevel);
Button miniature = (Button) findViewById(R.id.miniature);
ImageView background = (ImageView) findViewById(R.id.background);
@@ -477,9 +525,8 @@ public class CameraActivity extends Activity {
/**
* Method to take picture.
- * @param view Current view.
*/
- public void takePhoto(View view) {
+ public void takePhoto() {
// Handles the moment where picture is taken
ShutterCallback shutterCallback = new ShutterCallback() {
public void onShutter() {
@@ -504,7 +551,7 @@ public class CameraActivity extends Activity {
BitmapFactory.Options opt;
opt = new BitmapFactory.Options();
- // Temp storage to use for decoding
+ // Temporarily storage to use for decoding
opt.inTempStorage = new byte[16 * 1024];
Camera.Parameters paramsCamera = customCamera.getParameters();
Size size = paramsCamera.getPictureSize();
diff --git a/www/customCamera.js b/www/customCamera.js
index 12a4ee1..2b7dc08 100644
--- a/www/customCamera.js
+++ b/www/customCamera.js
@@ -1,49 +1,55 @@
"use strict";
-// Get cordova plugin.
-var exec = require("cordova/exec");
+(function(require, module) {
+ // Get cordova plugin.
+ var exec = require("cordova/exec");
-// constructor.
-var customCameraExport = function() {
-};
+ // constructor.
+ function CustomCameraExport() {}
-/**
- * Start custom camera.
- *
- * @param {object} options Options to plugin.
- * @param {function} successFct Callback function to success action.
- * @param {function} failFct Callback function to fail action.
- */
-customCameraExport.prototype.startCamera = function(options, successFct, failFct) {
- var defaultOptions = {
- imgBackgroundBase64: null, // background picture in base64.
- miniature: true // active or disable the miniature function.
- };
+ /**
+ * Start custom camera.
+ *
+ * @param {object} options Options to plugin.
+ * @param {function} successFct Callback function to success action.
+ * @param {function} failFct Callback function to fail action.
+ */
+ CustomCameraExport.prototype.startCamera = function(options, successFct, failFct) {
+ var defaultOptions = {
+ imgBackgroundBase64: null, // background picture in base64.
+ miniature: true, // active or disable the miniature function.
+ cameraBackgroundColor: "#e26760", // color of the camera button.
+ cameraBackgroundColorPressed: "#dc453d" // color of the pressed camera button.
+ // To get supported color formats, go to see method parseColor : http://developer.android.com/reference/android/graphics/Color.html#parseColor(java.lang.String)
+ };
- for (var nameOption in defaultOptions) {
- if (options[nameOption] === undefined) {
- options[nameOption] = defaultOptions[nameOption];
+ for (var nameOption in defaultOptions) {
+ if (options[nameOption] === undefined) {
+ options[nameOption] = defaultOptions[nameOption];
+ }
}
- }
- var successFctCallback = function(data) {
- successFct(data);
+ var successFctCallback = function(data) {
+ successFct(data);
+ };
+
+ var failFctCallback = function(data) {
+ failFct(data.code, data.message);
+ };
+
+ exec(
+ successFctCallback,
+ failFctCallback,
+ "CustomCamera",
+ "startCamera",
+ [
+ options.imgBackgroundBase64,
+ options.miniature,
+ options.cameraBackgroundColor,
+ options.cameraBackgroundColorPressed
+ ]
+ );
};
- var failFctCallback = function(data) {
- failFct(data.code, data.message);
- };
-
- exec(
- successFctCallback,
- failFctCallback,
- "CustomCamera",
- "startCamera",
- [
- options.imgBackgroundBase64,
- options.miniature
- ]
- );
-};
-
-module.exports = new customCameraExport();
\ No newline at end of file
+ module.exports = new CustomCameraExport();
+})(require, module);
\ No newline at end of file