mirror of
https://gitee.com/shuto/customCamera.git
synced 2026-04-14 00:00:03 +08:00
Merge pull request #41 from ChristopheBoucaut/issue#38
On donne la possibilié de lancer le plugin sans background. On masque la...
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user