mirror of
https://gitee.com/shuto/customCamera.git
synced 2024-10-06 10:22:07 +08:00
Ajout de la possibilité de désactivé la fonction miniature.
This commit is contained in:
parent
d5f63b4b74
commit
d2dcb181e0
@ -49,6 +49,8 @@ public class CameraLauncher extends CordovaPlugin {
|
||||
}
|
||||
TransferBigData.setImgBackgroundBase64(imgBackgroundBase64);
|
||||
|
||||
intent.putExtra("miniature", args.getBoolean(1));
|
||||
|
||||
cordova.startActivityForResult((CordovaPlugin) this, intent, CameraLauncher.REQUEST_CODE);
|
||||
|
||||
return true;
|
||||
|
@ -113,6 +113,11 @@ public class CameraActivity extends Activity {
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {}
|
||||
});
|
||||
|
||||
if (!this.getIntent().getBooleanExtra("miniature", true)) {
|
||||
Button miniature = (Button) findViewById(R.id.miniature);
|
||||
miniature.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
/** Method onStart. Handle the zoom level seekBar and the camera orientation. */
|
||||
|
@ -9,12 +9,23 @@ var customCameraExport = function() {
|
||||
|
||||
/**
|
||||
* Start custom camera.
|
||||
*
|
||||
* @param {string} imgBackgroundBase64 Base64 picture for the background.
|
||||
* @param {function} successFct Callback function to success action.
|
||||
* @param {function} failFct Callback function to fail action.
|
||||
*
|
||||
* @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(imgBackgroundBase64, successFct, failFct) {
|
||||
customCameraExport.prototype.startCamera = function(options, successFct, failFct) {
|
||||
var defaultOptions = {
|
||||
imgBackgroundBase64: null, // background picture in base64.
|
||||
miniature: true // active or disable the miniature function.
|
||||
};
|
||||
|
||||
for (var nameOption in defaultOptions) {
|
||||
if (options[nameOption] === undefined) {
|
||||
options[nameOption] = defaultOptions[nameOption];
|
||||
}
|
||||
}
|
||||
|
||||
var successFctCallback = function(data) {
|
||||
successFct(data);
|
||||
};
|
||||
@ -28,7 +39,10 @@ customCameraExport.prototype.startCamera = function(imgBackgroundBase64, success
|
||||
failFctCallback,
|
||||
"CustomCamera",
|
||||
"startCamera",
|
||||
[imgBackgroundBase64]
|
||||
[
|
||||
options.imgBackgroundBase64,
|
||||
options.miniature
|
||||
]
|
||||
);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user