9
0
mirror of https://gitee.com/shuto/customCamera.git synced 2026-04-14 00:00:03 +08:00
On donne la possibilié de lancer le plugin sans background. On masque la...
This commit is contained in:
Thomas BOY
2015-01-12 10:36:33 +01:00
2 changed files with 20 additions and 13 deletions

View File

@@ -34,20 +34,22 @@ public class CameraLauncher extends CordovaPlugin {
Intent intent = new Intent(this.cordova.getActivity(), CameraActivity.class);
byte[] imgBackgroundBase64;
try {
imgBackgroundBase64 = Base64.decode(args.getString(0), Base64.NO_WRAP);
} catch (IllegalArgumentException e) {
this.callbackContext.error(
generateError(
CameraLauncher.RESULT_ERROR,
"Error decode base64 picture."
)
);
if (args.getString(0) != "null") {
byte[] imgBackgroundBase64;
try {
imgBackgroundBase64 = Base64.decode(args.getString(0), Base64.NO_WRAP);
} catch (IllegalArgumentException e) {
this.callbackContext.error(
generateError(
CameraLauncher.RESULT_ERROR,
"Error decode base64 picture."
)
);
return false;
return false;
}
TransferBigData.setImgBackgroundBase64(imgBackgroundBase64);
}
TransferBigData.setImgBackgroundBase64(imgBackgroundBase64);
intent.putExtra("miniature", args.getBoolean(1));

View File

@@ -342,6 +342,11 @@ public class CameraActivity extends Activity {
RelativeLayout.TRUE);
background.setLayoutParams(paramsMiniature);
} else {
Button miniature = (Button) findViewById(R.id.miniature);
miniature.setVisibility(View.INVISIBLE);
SeekBar switchOpacity = (SeekBar) findViewById(R.id.switchOpacity);
switchOpacity.setVisibility(View.INVISIBLE);
}
}
@@ -354,7 +359,7 @@ public class CameraActivity extends Activity {
// Set new size for miniature layout.
setParamsMiniature(background, true);
// Hide the miniature button.
miniature.setVisibility(View.INVISIBLE);
miniature.setVisibility(View.INVISIBLE);
// Add event on click action for the miniature picture.
background.setOnClickListener(new View.OnClickListener() {