8
0
mirror of https://gitee.com/shuto/customCamera.git synced 2026-05-21 00:00:01 +08:00

Ajout d'une option pour changer l'image en surimpression en fonction de l'orientation de l'écran.

This commit is contained in:
Christophe Boucaut
2015-01-29 18:58:52 +01:00
parent 9e0b9348f5
commit c785aed2b1
5 changed files with 58 additions and 9 deletions
+22 -7
View File
@@ -60,14 +60,29 @@ public class CameraLauncher extends CordovaPlugin {
TransferBigData.setImgBackgroundBase64(imgBackgroundBase64);
}
intent.putExtra("miniature", args.getBoolean(1));
intent.putExtra("saveInGallery", args.getBoolean(2));
intent.putExtra("cameraBackgroundColor", args.getString(3));
intent.putExtra("cameraBackgroundColorPressed", args.getString(4));
if (args.getInt(5) >= 0 && args.getInt(5) <= 100) {
intent.putExtra("quality", args.getInt(5));
if (args.getString(1) != "null") {
byte[] imgBackgroundBase64OtherOrientation;
try {
imgBackgroundBase64OtherOrientation = Base64
.decode(args.getString(1), Base64.NO_WRAP);
} catch (IllegalArgumentException e) {
this.callbackContext.error(generateError(CameraLauncher.RESULT_ERROR,
"Error decode base64 picture."));
return false;
}
TransferBigData.setImgBackgroundBase64OtherOrientation(imgBackgroundBase64OtherOrientation);
}
intent.putExtra("opacity", args.getBoolean(6));
intent.putExtra("miniature", args.getBoolean(2));
intent.putExtra("saveInGallery", args.getBoolean(3));
intent.putExtra("cameraBackgroundColor", args.getString(4));
intent.putExtra("cameraBackgroundColorPressed", args.getString(5));
if (args.getInt(6) >= 0 && args.getInt(6) <= 100) {
intent.putExtra("quality", args.getInt(6));
}
intent.putExtra("opacity", args.getBoolean(7));
intent.putExtra("startOrientation", this.cordova.getActivity().getResources().getConfiguration().orientation);
cordova.startActivityForResult((CordovaPlugin) this, intent,
CameraLauncher.REQUEST_CODE);