Mise en place de la structure pour android + ajout de hook pour l'installation et le fonctionnement du plugin sous android.
@@ -1,5 +1,6 @@
|
||||
package org.geneanet.customcamera;
|
||||
|
||||
import XXX_NAME_CURRENT_PACKAGE_XXX.CameraView;
|
||||
import org.apache.cordova.CordovaPlugin;
|
||||
import org.apache.cordova.CallbackContext;
|
||||
import org.json.JSONArray;
|
||||
@@ -9,14 +10,9 @@ import android.content.Intent;
|
||||
|
||||
public class CameraLauncher extends CordovaPlugin {
|
||||
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
|
||||
Intent intent = new Intent("org.geneanet.customcamera.CameraView");
|
||||
cordova.startActivityForResult((CordovaPlugin) this, intent, 1111111);
|
||||
|
||||
Intent intent = new Intent(this.cordova.getActivity(), CameraView.class);
|
||||
cordova.getActivity().startActivity(intent);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void testAction()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.geneanet.testcustomcamera"
|
||||
package="org.geneanet.customcamera"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
@@ -11,4 +11,4 @@
|
||||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
||||
|
||||
# Project target.
|
||||
target=android-14
|
||||
target=android-16
|
||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
@@ -15,8 +15,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0.5"
|
||||
android:contentDescription="@string/sss"
|
||||
android:src="@drawable/labs" />
|
||||
android:contentDescription="@string/sss" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_capture"
|
||||
@@ -4,7 +4,7 @@
|
||||
<string name="app_name">TestCustomCamera</string>
|
||||
<string name="hello_world">Hello world!</string>
|
||||
<string name="action_settings">Settings</string>
|
||||
<string name="title_activity_camera_view">CameraView</string>
|
||||
<string name="title_activity_camera_view">CameraViewNative</string>
|
||||
<string name="start_custom_camera">Start Custom Camera</string>
|
||||
<string name="capture">Capture</string>
|
||||
<string name="todo">TODO</string>
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.geneanet.customcamera.utils;
|
||||
package org.geneanet.customcamera;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -1,23 +1,15 @@
|
||||
package org.geneanet.customcamera;
|
||||
|
||||
import org.geneanet.customcamera.R;
|
||||
import org.geneanet.customcamera.utils.CameraPreview;
|
||||
import org.geneanet.customcamera.utils.CustomCamera;
|
||||
import org.geneanet.customcamera.CameraPreview;
|
||||
import org.geneanet.customcamera.CustomCamera;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Point;
|
||||
import android.hardware.Camera;
|
||||
import android.os.Bundle;
|
||||
import android.view.Display;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ImageView.ScaleType;
|
||||
|
||||
public class CameraView extends Activity {
|
||||
|
||||
@@ -32,7 +24,7 @@ public class CameraView extends Activity {
|
||||
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
//Remove notification bar
|
||||
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
|
||||
|
||||
setContentView(R.layout.activity_camera_view);
|
||||
|
||||
// Récupère les infos sur le device.
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.geneanet.customcamera.utils;
|
||||
package org.geneanet.customcamera;
|
||||
|
||||
import android.hardware.Camera;
|
||||
|
||||
@@ -6,13 +6,10 @@ import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.hardware.Camera;
|
||||
import android.os.Bundle;
|
||||
import android.provider.MediaStore;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
|
||||
public class MainActivity extends Activity {
|
||||