scoplan.camera 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +18 -0
- package/plugin.xml +119 -0
- package/src/android/AutoFitSurfaceView.java +66 -0
- package/src/android/CCropActivity.java +17 -0
- package/src/android/CDrawActivity.java +16 -0
- package/src/android/CTextActivity.java +17 -0
- package/src/android/CameraEventListener.java +8 -0
- package/src/android/CameraFragment.java +635 -0
- package/src/android/CameraSeekBarListener.java +105 -0
- package/src/android/CameraUtils.java +94 -0
- package/src/android/CustomI.java +37 -0
- package/src/android/FakeR.java +31 -0
- package/src/android/ImageCameraAvailableListener.java +65 -0
- package/src/android/OnImageCaptureListener.java +11 -0
- package/src/android/PhotoEditorActivity.java +128 -0
- package/src/android/PhotoEditorMenu.java +111 -0
- package/src/android/PhotoEditorMesureCustomActivity.java +218 -0
- package/src/android/PhotoEditorStore.java +50 -0
- package/src/android/ScoplanCamera.java +98 -0
- package/src/android/gradle/scoplanCamera.gradle +9 -0
- package/src/android/libs/ds-photo-editor-sdk-v9.aar +0 -0
- package/src/android/res/drawable/back_arrow.xml +5 -0
- package/src/android/res/drawable/camsicon.png +0 -0
- package/src/android/res/drawable/custom_spinner.xml +14 -0
- package/src/android/res/drawable/delete_img.png +0 -0
- package/src/android/res/drawable/draw_img.png +0 -0
- package/src/android/res/drawable/flash.png +0 -0
- package/src/android/res/drawable/flash_on.png +0 -0
- package/src/android/res/drawable/mesure.png +0 -0
- package/src/android/res/drawable/mesure_bar.xml +19 -0
- package/src/android/res/drawable/shape_back.xml +12 -0
- package/src/android/res/drawable/shape_cancel.xml +12 -0
- package/src/android/res/drawable/shape_rectangle.xml +4 -0
- package/src/android/res/layout/fragment_camera.xml +157 -0
- package/src/android/res/layout/fragment_photo_editor_menu.xml +122 -0
- package/src/ios/AVCamPhotoCaptureDelegate.h +20 -0
- package/src/ios/AVCamPhotoCaptureDelegate.m +244 -0
- package/src/ios/AVCamPreviewView.h +18 -0
- package/src/ios/AVCamPreviewView.m +33 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDK +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/Assets.car +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/Base.lproj/DSPhotoEditorSDK.storyboardc/0dZ-3o-Xdu-view-Uan-aZ-nTR.nib/objects-11.0+.nib +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/Base.lproj/DSPhotoEditorSDK.storyboardc/0dZ-3o-Xdu-view-Uan-aZ-nTR.nib/objects-13.0+.nib +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/Base.lproj/DSPhotoEditorSDK.storyboardc/0dZ-3o-Xdu-view-Uan-aZ-nTR.nib/runtime.nib +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/Base.lproj/DSPhotoEditorSDK.storyboardc/DSDrawViewController.nib/objects-11.0+.nib +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/Base.lproj/DSPhotoEditorSDK.storyboardc/DSDrawViewController.nib/objects-13.0+.nib +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/Base.lproj/DSPhotoEditorSDK.storyboardc/DSDrawViewController.nib/runtime.nib +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/Base.lproj/DSPhotoEditorSDK.storyboardc/DSPhotoEditor.nib/objects-11.0+.nib +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/Base.lproj/DSPhotoEditorSDK.storyboardc/DSPhotoEditor.nib/objects-13.0+.nib +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/Base.lproj/DSPhotoEditorSDK.storyboardc/DSPhotoEditor.nib/runtime.nib +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/Base.lproj/DSPhotoEditorSDK.storyboardc/Info.plist +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/Base.lproj/DSPhotoEditorSDK.storyboardc/Okc-Jl-tk5-view-siV-MN-Zgc.nib/objects-11.0+.nib +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/Base.lproj/DSPhotoEditorSDK.storyboardc/Okc-Jl-tk5-view-siV-MN-Zgc.nib/objects-13.0+.nib +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/Base.lproj/DSPhotoEditorSDK.storyboardc/Okc-Jl-tk5-view-siV-MN-Zgc.nib/runtime.nib +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/Base.lproj/DSPhotoEditorSDKLocalizable.strings +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/Info.plist +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/ar.lproj/DSPhotoEditorSDK.strings +57 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/ar.lproj/DSPhotoEditorSDKLocalizable.strings +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/de.lproj/DSPhotoEditorSDK.strings +57 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/de.lproj/DSPhotoEditorSDKLocalizable.strings +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/es.lproj/DSPhotoEditorSDK.strings +57 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/es.lproj/DSPhotoEditorSDKLocalizable.strings +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/fr.lproj/DSPhotoEditorSDK.strings +57 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/fr.lproj/DSPhotoEditorSDKLocalizable.strings +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/id.lproj/DSPhotoEditorSDK.strings +57 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/id.lproj/DSPhotoEditorSDKLocalizable.strings +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/it.lproj/DSPhotoEditorSDK.strings +57 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/it.lproj/DSPhotoEditorSDKLocalizable.strings +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/ja.lproj/DSPhotoEditorSDK.strings +57 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/ja.lproj/DSPhotoEditorSDKLocalizable.strings +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/ko.lproj/DSPhotoEditorSDK.strings +57 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/ko.lproj/DSPhotoEditorSDKLocalizable.strings +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/ms.lproj/DSPhotoEditorSDK.strings +57 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/ms.lproj/DSPhotoEditorSDKLocalizable.strings +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/pt-PT.lproj/DSPhotoEditorSDK.strings +57 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/pt-PT.lproj/DSPhotoEditorSDKLocalizable.strings +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/ru.lproj/DSPhotoEditorSDK.strings +57 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/ru.lproj/DSPhotoEditorSDKLocalizable.strings +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/th.lproj/DSPhotoEditorSDK.strings +57 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/th.lproj/DSPhotoEditorSDKLocalizable.strings +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/tr.lproj/DSPhotoEditorSDK.strings +57 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/tr.lproj/DSPhotoEditorSDKLocalizable.strings +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/vi.lproj/DSPhotoEditorSDK.strings +57 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/vi.lproj/DSPhotoEditorSDKLocalizable.strings +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/zh-Hans.lproj/DSPhotoEditorSDK.strings +57 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/zh-Hans.lproj/DSPhotoEditorSDKLocalizable.strings +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/zh-Hant.lproj/DSPhotoEditorSDK.strings +57 -0
- package/src/ios/DSPhotoEditorSDK.framework/DSPhotoEditorSDKResourceBundle.bundle/zh-Hant.lproj/DSPhotoEditorSDKLocalizable.strings +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/Headers/DSPhotoEditorSDK.h +18 -0
- package/src/ios/DSPhotoEditorSDK.framework/Headers/DSPhotoEditorViewController.h +112 -0
- package/src/ios/DSPhotoEditorSDK.framework/Info.plist +0 -0
- package/src/ios/DSPhotoEditorSDK.framework/License.md +70 -0
- package/src/ios/DSPhotoEditorSDK.framework/Modules/module.modulemap +6 -0
- package/src/ios/DSPhotoEditorSDK.framework/framework_version.txt +5 -0
- package/src/ios/DSPhotoEditorSDK.framework/strip-frameworks.sh +80 -0
- package/src/ios/Resources/Overlay.png +0 -0
- package/src/ios/Resources/Overlay@2x.png +0 -0
- package/src/ios/Resources/back_arrows.png +0 -0
- package/src/ios/Resources/ds_btn_calc.png +0 -0
- package/src/ios/Resources/ds_btn_crop.png +0 -0
- package/src/ios/Resources/ds_btn_del.png +0 -0
- package/src/ios/Resources/ds_btn_draw.png +0 -0
- package/src/ios/Resources/ds_btn_text.png +0 -0
- package/src/ios/Resources/measure_0.png +0 -0
- package/src/ios/Resources/measure_1.png +0 -0
- package/src/ios/Resources/measure_10.png +0 -0
- package/src/ios/Resources/measure_11.png +0 -0
- package/src/ios/Resources/measure_2.png +0 -0
- package/src/ios/Resources/measure_3.png +0 -0
- package/src/ios/Resources/measure_4.png +0 -0
- package/src/ios/Resources/measure_5.png +0 -0
- package/src/ios/Resources/measure_6.png +0 -0
- package/src/ios/Resources/measure_7.png +0 -0
- package/src/ios/Resources/measure_8.png +0 -0
- package/src/ios/Resources/measure_9.png +0 -0
- package/src/ios/Resources/no.png +0 -0
- package/src/ios/Resources/ok.png +0 -0
- package/src/ios/Resources/toward_arrows.png +0 -0
- package/src/ios/ScoplanCamera.h +18 -0
- package/src/ios/ScoplanCamera.m +179 -0
- package/src/ios/ScoplanCamera.storyboard +115 -0
- package/src/ios/UICustomPickerController.h +11 -0
- package/src/ios/UICustomPickerController.m +119 -0
- package/src/ios/UIImagePickerDelegate.h +11 -0
- package/src/ios/UIImagePickerDelegate.m +161 -0
- package/src/ios/UIScoplanCamera.h +20 -0
- package/src/ios/UIScoplanCamera.m +1098 -0
- package/src/ios/bottomPhotoEditor.xib +222 -0
- package/src/ios/camsicons.xcassets/Contents.json +6 -0
- package/src/ios/camsicons.xcassets/cameraicon.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/cameraicon.imageset/camsicon.png +0 -0
- package/src/ios/camsicons.xcassets/image000001.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image000001.imageset/image0000002.png +0 -0
- package/src/ios/camsicons.xcassets/image0000010.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image0000010.imageset/image0000010.png +0 -0
- package/src/ios/camsicons.xcassets/image0000011.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image0000011.imageset/image0000011.png +0 -0
- package/src/ios/camsicons.xcassets/image0000012.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image0000012.imageset/image0000012.png +0 -0
- package/src/ios/camsicons.xcassets/image0000013.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image0000013.imageset/image0000013.png +0 -0
- package/src/ios/camsicons.xcassets/image0000014.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image0000014.imageset/image0000014.png +0 -0
- package/src/ios/camsicons.xcassets/image0000015.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image0000015.imageset/image0000015.png +0 -0
- package/src/ios/camsicons.xcassets/image0000016.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image0000016.imageset/image0000016.png +0 -0
- package/src/ios/camsicons.xcassets/image0000017.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image0000017.imageset/image0000017.png +0 -0
- package/src/ios/camsicons.xcassets/image0000018.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image0000018.imageset/image0000018.png +0 -0
- package/src/ios/camsicons.xcassets/image0000019.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image0000019.imageset/image0000019.png +0 -0
- package/src/ios/camsicons.xcassets/image000002.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image000002.imageset/image0000001.png +0 -0
- package/src/ios/camsicons.xcassets/image000003.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image000003.imageset/image0000003.png +0 -0
- package/src/ios/camsicons.xcassets/image000004.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image000004.imageset/image0000004.png +0 -0
- package/src/ios/camsicons.xcassets/image000005.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image000005.imageset/image0000005.png +0 -0
- package/src/ios/camsicons.xcassets/image000006.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image000006.imageset/image0000006.png +0 -0
- package/src/ios/camsicons.xcassets/image000007.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image000007.imageset/image0000007.png +0 -0
- package/src/ios/camsicons.xcassets/image000008.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image000008.imageset/image0000008.png +0 -0
- package/src/ios/camsicons.xcassets/image000009.imageset/Contents.json +21 -0
- package/src/ios/camsicons.xcassets/image000009.imageset/image0000009.png +0 -0
- package/src/ios/multicam.xib +113 -0
- package/www/ScoplanCamera.js +5 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
package scoplan.camera;
|
|
2
|
+
|
|
3
|
+
import android.graphics.Rect;
|
|
4
|
+
import android.hardware.camera2.CameraAccessException;
|
|
5
|
+
import android.hardware.camera2.CameraCaptureSession;
|
|
6
|
+
import android.hardware.camera2.CameraCharacteristics;
|
|
7
|
+
import android.hardware.camera2.CameraManager;
|
|
8
|
+
import android.hardware.camera2.CaptureRequest;
|
|
9
|
+
import android.os.Handler;
|
|
10
|
+
import android.util.Log;
|
|
11
|
+
import android.widget.SeekBar;
|
|
12
|
+
|
|
13
|
+
public class CameraSeekBarListener implements SeekBar.OnSeekBarChangeListener {
|
|
14
|
+
private String currentCameraId;
|
|
15
|
+
private CameraManager cameraManager;
|
|
16
|
+
private SeekBar seekBar;
|
|
17
|
+
private CaptureRequest.Builder captureRequestBuilder;
|
|
18
|
+
private CameraCaptureSession cameraCaptureSessions;
|
|
19
|
+
private Handler mBackgroundHandler;
|
|
20
|
+
private float minZoom = 0;
|
|
21
|
+
private float maxZoom = 0;
|
|
22
|
+
int zoomStep = 1;
|
|
23
|
+
int zoomLevel = 0;
|
|
24
|
+
|
|
25
|
+
public CameraSeekBarListener(
|
|
26
|
+
String cameraId,
|
|
27
|
+
CameraManager cameraManager,
|
|
28
|
+
SeekBar seekBar,
|
|
29
|
+
CaptureRequest.Builder captureRequestBuilder,
|
|
30
|
+
CameraCaptureSession cameraCaptureSessions,
|
|
31
|
+
Handler mBackgroundHandler
|
|
32
|
+
) {
|
|
33
|
+
currentCameraId = cameraId;
|
|
34
|
+
this.cameraManager = cameraManager;
|
|
35
|
+
this.seekBar = seekBar;
|
|
36
|
+
this.captureRequestBuilder = captureRequestBuilder;
|
|
37
|
+
this.cameraCaptureSessions = cameraCaptureSessions;
|
|
38
|
+
this.mBackgroundHandler = mBackgroundHandler;
|
|
39
|
+
this.maxZoom = this.getMaxZoom();
|
|
40
|
+
seekBar.setMax((int) maxZoom);
|
|
41
|
+
seekBar.setOnSeekBarChangeListener(this);
|
|
42
|
+
}
|
|
43
|
+
@Override
|
|
44
|
+
public void onProgressChanged(SeekBar seekBar, int progress, boolean b) {
|
|
45
|
+
setCurrentZoom(Math.round(minZoom + (progress * zoomStep)));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@Override
|
|
49
|
+
public void onStartTrackingTouch(SeekBar seekBar) {
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@Override
|
|
54
|
+
public void onStopTrackingTouch(SeekBar seekBar) {
|
|
55
|
+
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
private Rect getZoomRect(float zoomLevel) {
|
|
59
|
+
try {
|
|
60
|
+
CameraCharacteristics characteristics = cameraManager.getCameraCharacteristics(this.currentCameraId);
|
|
61
|
+
Rect activeRect = characteristics.get(CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE);
|
|
62
|
+
if((zoomLevel <= maxZoom) && (zoomLevel > 1)) {
|
|
63
|
+
int minW = (int) (activeRect.width() / maxZoom);
|
|
64
|
+
int minH = (int) (activeRect.height() / maxZoom);
|
|
65
|
+
int difW = activeRect.width() - minW;
|
|
66
|
+
int difH = activeRect.height() - minH;
|
|
67
|
+
int cropW = difW / 100 * (int) zoomLevel;
|
|
68
|
+
int cropH = difH / 100 * (int) zoomLevel;
|
|
69
|
+
cropW -= cropW & 3;
|
|
70
|
+
cropH -= cropH & 3;
|
|
71
|
+
return new Rect(cropW, cropH, activeRect.width() - cropW, activeRect.height() - cropH);
|
|
72
|
+
} else if(zoomLevel == 0){
|
|
73
|
+
return new Rect(0, 0, activeRect.width(), activeRect.height());
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
} catch (Exception e) {
|
|
77
|
+
Log.e(scoplan.camera.CameraFragment.SCOPLAN_TAG, "Error during camera init");
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public float getMaxZoom() {
|
|
83
|
+
try {
|
|
84
|
+
CameraCharacteristics characteristics = cameraManager.getCameraCharacteristics(this.currentCameraId);
|
|
85
|
+
return characteristics.get(CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM) * 10;
|
|
86
|
+
} catch (CameraAccessException e) {
|
|
87
|
+
Log.e(scoplan.camera.CameraFragment.SCOPLAN_TAG, "Error during camera get zoom", e);
|
|
88
|
+
}
|
|
89
|
+
return 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
public void setCurrentZoom(float zoomLevel) {
|
|
93
|
+
Rect zoomRect = getZoomRect(zoomLevel);
|
|
94
|
+
if(zoomRect != null) {
|
|
95
|
+
try {
|
|
96
|
+
//you can try to add the synchronized object here
|
|
97
|
+
captureRequestBuilder.set(CaptureRequest.SCALER_CROP_REGION, zoomRect);
|
|
98
|
+
cameraCaptureSessions.setRepeatingRequest(captureRequestBuilder.build(), null, mBackgroundHandler);
|
|
99
|
+
} catch (Exception e) {
|
|
100
|
+
Log.e(scoplan.camera.CameraFragment.SCOPLAN_TAG, "Error updating preview: ", e);
|
|
101
|
+
}
|
|
102
|
+
this.zoomLevel = (int) zoomLevel;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
package scoplan.camera;
|
|
2
|
+
|
|
3
|
+
import android.graphics.Matrix;
|
|
4
|
+
import android.graphics.SurfaceTexture;
|
|
5
|
+
import android.hardware.camera2.CameraCharacteristics;
|
|
6
|
+
import android.os.Build;
|
|
7
|
+
import android.util.Size;
|
|
8
|
+
import android.view.TextureView;
|
|
9
|
+
|
|
10
|
+
import java.util.ArrayList;
|
|
11
|
+
import java.util.Comparator;
|
|
12
|
+
import java.util.List;
|
|
13
|
+
|
|
14
|
+
public class CameraUtils {
|
|
15
|
+
/** Return the biggest preview size available which is smaller than the window */
|
|
16
|
+
private static Size findBestPreviewSize(Size windowSize, CameraCharacteristics characteristics) {
|
|
17
|
+
List<Size> supportedPreviewSizes = new ArrayList<>();
|
|
18
|
+
Size[] sizes = characteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP)
|
|
19
|
+
.getOutputSizes(SurfaceTexture.class);
|
|
20
|
+
if(sizes != null) {
|
|
21
|
+
for(Size a : sizes) {
|
|
22
|
+
if(windowSize.getHeight() * windowSize.getWidth() - a.getWidth() * a.getHeight() > 0) {
|
|
23
|
+
supportedPreviewSizes.add(a);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
|
27
|
+
supportedPreviewSizes.sort(new SizeComparator());
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return supportedPreviewSizes.size() > 0 ? supportedPreviewSizes.get(0) : new Size(0, 0);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public static SurfaceTexture buildTargetTexture(TextureView textureView, CameraCharacteristics characteristics, int surfaceRotation) {
|
|
34
|
+
int surfaceRotationDegrees = surfaceRotation * 90;
|
|
35
|
+
Size windowSize = new Size(textureView.getWidth(), textureView.getHeight());
|
|
36
|
+
Size previewSize = CameraUtils.findBestPreviewSize(windowSize, characteristics);
|
|
37
|
+
int sensorOrientation = characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION);
|
|
38
|
+
boolean isRotationRequired = CameraUtils.computeRelativeRotation(characteristics, surfaceRotationDegrees) % 180 != 0;
|
|
39
|
+
float scaleX = 1f;
|
|
40
|
+
float scaleY = 1f;
|
|
41
|
+
if(sensorOrientation == 0) {
|
|
42
|
+
scaleX = isRotationRequired ? windowSize.getWidth() / previewSize.getWidth() : windowSize.getWidth() / previewSize.getHeight();
|
|
43
|
+
scaleY = isRotationRequired ? windowSize.getHeight() / previewSize.getHeight() : windowSize.getHeight() / previewSize.getWidth();
|
|
44
|
+
} else {
|
|
45
|
+
scaleX = isRotationRequired ? windowSize.getWidth() / previewSize.getHeight() : windowSize.getWidth() / previewSize.getWidth();
|
|
46
|
+
scaleY = isRotationRequired ? windowSize.getHeight() / previewSize.getWidth() : windowSize.getHeight() / previewSize.getHeight();
|
|
47
|
+
}
|
|
48
|
+
float finalScale = Math.max(scaleX, scaleY);
|
|
49
|
+
float halfWidth = windowSize.getWidth() / 2f;
|
|
50
|
+
float halfHeight = windowSize.getHeight() / 2f;
|
|
51
|
+
Matrix matrix = new Matrix();
|
|
52
|
+
if(isRotationRequired) {
|
|
53
|
+
matrix.setScale(
|
|
54
|
+
1/ scaleX * finalScale,
|
|
55
|
+
1/ scaleY * finalScale,
|
|
56
|
+
halfWidth,
|
|
57
|
+
halfHeight
|
|
58
|
+
);
|
|
59
|
+
} else {
|
|
60
|
+
matrix.setScale(
|
|
61
|
+
windowSize.getHeight() / windowSize.getWidth() / scaleY * finalScale,
|
|
62
|
+
windowSize.getWidth() / windowSize.getHeight() / scaleX * finalScale,
|
|
63
|
+
halfWidth,
|
|
64
|
+
halfHeight
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
// Rotate to compensate display rotation
|
|
68
|
+
matrix.postRotate(
|
|
69
|
+
-surfaceRotationDegrees,
|
|
70
|
+
halfWidth,
|
|
71
|
+
halfHeight
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
textureView.setTransform(matrix);
|
|
75
|
+
|
|
76
|
+
SurfaceTexture texture = textureView.getSurfaceTexture();
|
|
77
|
+
assert texture != null;
|
|
78
|
+
texture.setDefaultBufferSize(previewSize.getWidth(), previewSize.getHeight());
|
|
79
|
+
|
|
80
|
+
return texture;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public static int computeRelativeRotation(CameraCharacteristics cameraCharacteristics, int deviceOrientationDegrees) {
|
|
84
|
+
int sensorOrientationDegrees = cameraCharacteristics.get(CameraCharacteristics.SENSOR_ORIENTATION);
|
|
85
|
+
int sign = cameraCharacteristics.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT ? 1 : -1;
|
|
86
|
+
return (sensorOrientationDegrees - (deviceOrientationDegrees * sign) + 360) % 360;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
class SizeComparator implements Comparator<Size> {
|
|
90
|
+
@Override
|
|
91
|
+
public int compare(Size a, Size b) {
|
|
92
|
+
return b.getHeight() * b.getWidth() - a.getWidth() * a.getHeight();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
package scoplan.camera;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import android.graphics.drawable.Drawable;
|
|
5
|
+
import android.os.Build;
|
|
6
|
+
|
|
7
|
+
import androidx.annotation.ColorInt;
|
|
8
|
+
import androidx.annotation.NonNull;
|
|
9
|
+
|
|
10
|
+
import com.dsphotoeditor.sdk.ui.stickerview.i;
|
|
11
|
+
|
|
12
|
+
import java.util.ArrayList;
|
|
13
|
+
|
|
14
|
+
public class CustomI extends i {
|
|
15
|
+
public CustomI(@NonNull Context context) {
|
|
16
|
+
super(context);
|
|
17
|
+
}
|
|
18
|
+
public static ArrayList<Drawable> drawables;
|
|
19
|
+
private int index = 0;
|
|
20
|
+
@Override
|
|
21
|
+
@NonNull
|
|
22
|
+
public i a(@ColorInt int var1) {
|
|
23
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
24
|
+
drawables.get(this.index).setTint(var1);
|
|
25
|
+
}
|
|
26
|
+
return super.a(var1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Override
|
|
30
|
+
public i a(@NonNull Drawable var1) {
|
|
31
|
+
if(drawables == null)
|
|
32
|
+
drawables = new ArrayList<Drawable>();
|
|
33
|
+
this.drawables.add(var1);
|
|
34
|
+
this.index = this.drawables.size() - 1;
|
|
35
|
+
return super.a(var1);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
package scoplan.camera;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
|
|
5
|
+
public class FakeR {
|
|
6
|
+
private Context context;
|
|
7
|
+
|
|
8
|
+
public FakeR(Context context) {
|
|
9
|
+
this.context = context;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public int getId(String key) {
|
|
13
|
+
return getResourceId(context, "id", key);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public int getString(String key) {
|
|
17
|
+
return getResourceId(context, "string", key);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public int getDrawable(String key) {
|
|
21
|
+
return getResourceId(context, "drawable", key);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public int getLayout(String key) {
|
|
25
|
+
return getResourceId(context, "layout", key);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public static int getResourceId(Context context, String group, String key) {
|
|
29
|
+
return context.getResources().getIdentifier(key, group, context.getPackageName());
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
package scoplan.camera;
|
|
2
|
+
|
|
3
|
+
import android.graphics.Bitmap;
|
|
4
|
+
import android.graphics.BitmapFactory;
|
|
5
|
+
import android.graphics.Matrix;
|
|
6
|
+
import android.media.Image;
|
|
7
|
+
import android.media.ImageReader;
|
|
8
|
+
|
|
9
|
+
import java.io.File;
|
|
10
|
+
import java.io.FileOutputStream;
|
|
11
|
+
import java.io.IOException;
|
|
12
|
+
import java.io.OutputStream;
|
|
13
|
+
import java.nio.ByteBuffer;
|
|
14
|
+
|
|
15
|
+
public class ImageCameraAvailableListener implements ImageReader.OnImageAvailableListener {
|
|
16
|
+
private ImageReader reader;
|
|
17
|
+
private File file;
|
|
18
|
+
private scoplan.camera.OnImageCaptureListener imageCaptureListener;
|
|
19
|
+
private float rotation;
|
|
20
|
+
|
|
21
|
+
public ImageCameraAvailableListener(File file, ImageReader reader, scoplan.camera.OnImageCaptureListener onImageCaptureListener, float rotation) {
|
|
22
|
+
this.reader = reader;
|
|
23
|
+
this.file = file;
|
|
24
|
+
this.imageCaptureListener = onImageCaptureListener;
|
|
25
|
+
this.rotation = rotation;
|
|
26
|
+
}
|
|
27
|
+
@Override
|
|
28
|
+
public void onImageAvailable(ImageReader imageReader) {
|
|
29
|
+
Image image = null;
|
|
30
|
+
try{
|
|
31
|
+
image = reader.acquireLatestImage();
|
|
32
|
+
ByteBuffer buffer = image.getPlanes()[0].getBuffer();
|
|
33
|
+
byte[] bytes = new byte[buffer.capacity()];
|
|
34
|
+
buffer.get(bytes);
|
|
35
|
+
this.imageCaptureListener.onImageCapture(file, save(bytes));
|
|
36
|
+
}
|
|
37
|
+
catch (IOException e)
|
|
38
|
+
{
|
|
39
|
+
e.printStackTrace();
|
|
40
|
+
this.imageCaptureListener.onImageBuildFailed(e);
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
{
|
|
44
|
+
if(image != null)
|
|
45
|
+
image.close();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
private Bitmap save(byte[] bytes) throws IOException {
|
|
51
|
+
OutputStream outputStream = null;
|
|
52
|
+
try{
|
|
53
|
+
outputStream = new FileOutputStream(file);
|
|
54
|
+
Bitmap bmp = BitmapFactory.decodeByteArray(bytes,0, bytes.length);
|
|
55
|
+
Matrix matrix = new Matrix();
|
|
56
|
+
matrix.setRotate(this.rotation);
|
|
57
|
+
Bitmap rotatedBitmap = Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrix, true);
|
|
58
|
+
rotatedBitmap.compress(Bitmap.CompressFormat.JPEG, 65, outputStream);
|
|
59
|
+
return rotatedBitmap;
|
|
60
|
+
} finally {
|
|
61
|
+
if(outputStream != null)
|
|
62
|
+
outputStream.close();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
package scoplan.camera;
|
|
2
|
+
|
|
3
|
+
import android.annotation.SuppressLint;
|
|
4
|
+
import android.app.ProgressDialog;
|
|
5
|
+
import android.content.Context;
|
|
6
|
+
import android.content.Intent;
|
|
7
|
+
import android.graphics.Bitmap;
|
|
8
|
+
import android.net.Uri;
|
|
9
|
+
import android.os.AsyncTask;
|
|
10
|
+
import android.os.Bundle;
|
|
11
|
+
import android.view.View;
|
|
12
|
+
import android.widget.FrameLayout;
|
|
13
|
+
import android.widget.RelativeLayout;
|
|
14
|
+
import android.widget.Toast;
|
|
15
|
+
|
|
16
|
+
import com.dsphotoeditor.sdk.activity.DsPhotoEditorActivity;
|
|
17
|
+
|
|
18
|
+
import java.io.File;
|
|
19
|
+
|
|
20
|
+
public class PhotoEditorActivity extends DsPhotoEditorActivity {
|
|
21
|
+
private Uri e;
|
|
22
|
+
|
|
23
|
+
private FakeR fakeR;
|
|
24
|
+
|
|
25
|
+
@Override
|
|
26
|
+
protected void onCreate(Bundle savedInstanceState) {
|
|
27
|
+
Context context = getApplicationContext();
|
|
28
|
+
int themeId = context.getResources().getIdentifier("AppTheme.NoActionBar", "style", context.getPackageName());
|
|
29
|
+
setTheme(themeId);
|
|
30
|
+
super.onCreate(savedInstanceState);
|
|
31
|
+
this.fakeR = new FakeR(this);
|
|
32
|
+
this.e = this.getIntent().getData();
|
|
33
|
+
if (this.e == null) {
|
|
34
|
+
Toast.makeText(this, this.getString(com.dsphotoeditor.sdk.R.string.ds_photo_editor_error_no_uri), Toast.LENGTH_LONG).show();
|
|
35
|
+
this.finish();
|
|
36
|
+
} else {
|
|
37
|
+
this.createBottomBar(savedInstanceState);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@SuppressLint("ResourceType")
|
|
42
|
+
private void createBottomBar(Bundle var1) {
|
|
43
|
+
if (super.findViewById(fakeR.getId("ds_photo_editor_bottom_bar_fragment_container")) != null) {
|
|
44
|
+
View super_bottom_bar = super.findViewById(fakeR.getId("ds_photo_editor_bottom_bar_fragment_container"));
|
|
45
|
+
super_bottom_bar.setVisibility(View.INVISIBLE);
|
|
46
|
+
View custom_bottom_bar = new FrameLayout(this);
|
|
47
|
+
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, super_bottom_bar.getLayoutParams().height);
|
|
48
|
+
lp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
|
|
49
|
+
custom_bottom_bar.setLayoutParams(lp);
|
|
50
|
+
custom_bottom_bar.setId(12345678);
|
|
51
|
+
((RelativeLayout) super.findViewById(fakeR.getId("ds_photo_editor_root_layout"))).addView(custom_bottom_bar);
|
|
52
|
+
PhotoEditorMenu var2 = new PhotoEditorMenu();
|
|
53
|
+
var2.setArguments(super.getIntent().getExtras());
|
|
54
|
+
super.getFragmentManager().beginTransaction().add(custom_bottom_bar.getId(), var2, "custom_bottom_fragment_tag").commit();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public void onClick(View var1) {
|
|
59
|
+
int var2 = this.getFragmentManager().getBackStackEntryCount();
|
|
60
|
+
if (var1.getId() == com.dsphotoeditor.sdk.R.id.ds_photo_editor_top_button_apply) {
|
|
61
|
+
if (var2 == 0) {
|
|
62
|
+
if (this.getHdBitmap() != null && !this.isLoadingIndicatorShowing()) {
|
|
63
|
+
a var3 = new a();
|
|
64
|
+
var3.execute(new Bitmap[]{this.getHdBitmap()});
|
|
65
|
+
}
|
|
66
|
+
} else if (!this.isLoadingIndicatorShowing()) {
|
|
67
|
+
this.getFragmentManager().popBackStack();
|
|
68
|
+
this.updateTopbarTitle(this.getString(com.dsphotoeditor.sdk.R.string.ds_photo_editor_main_title));
|
|
69
|
+
if (this.toolType == 7) {
|
|
70
|
+
this.setHdBitmap(com.dsphotoeditor.sdk.b.d.a);
|
|
71
|
+
com.dsphotoeditor.sdk.b.d.a = null;
|
|
72
|
+
}
|
|
73
|
+
com.dsphotoeditor.sdk.a.a var4 = new com.dsphotoeditor.sdk.a.a(this, this.filterLutIdValue, this.frameIdValue, this.seekBarValue);
|
|
74
|
+
var4.execute(new Integer[]{this.toolType});
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
super.onClick(var1);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
private class a extends AsyncTask<Bitmap, Void, File> {
|
|
82
|
+
private ProgressDialog b;
|
|
83
|
+
|
|
84
|
+
private a() {
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@Override
|
|
88
|
+
protected File doInBackground(Bitmap... bitmaps) {
|
|
89
|
+
return a(bitmaps);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
protected void onPreExecute() {
|
|
93
|
+
super.onPreExecute();
|
|
94
|
+
this.b = com.dsphotoeditor.sdk.utils.c.a(PhotoEditorActivity.this, PhotoEditorActivity.this.getString(com.dsphotoeditor.sdk.R.string.ds_photo_editor_finish_up_loading_indicator), 1, false);
|
|
95
|
+
if (!this.b.isShowing()) {
|
|
96
|
+
this.b.show();
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
protected File a(Bitmap... var1) {
|
|
102
|
+
Bitmap var2 = var1[0];
|
|
103
|
+
File var3 = scoplan.camera.PhotoEditorStore.a(PhotoEditorActivity.this, var2);
|
|
104
|
+
return var3;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@Override
|
|
108
|
+
protected void onPostExecute(File file) {
|
|
109
|
+
a(file);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
protected void a(File var1) {
|
|
113
|
+
super.onPostExecute(var1);
|
|
114
|
+
if (this.b != null && this.b.isShowing()) {
|
|
115
|
+
this.b.dismiss();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (var1 != null) {
|
|
119
|
+
Uri var2 = Uri.fromFile(var1);
|
|
120
|
+
Intent var3 = new Intent();
|
|
121
|
+
var3.setData(var2);
|
|
122
|
+
PhotoEditorActivity.this.setResult(-1, var3);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
PhotoEditorActivity.this.finish();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
package scoplan.camera;
|
|
2
|
+
|
|
3
|
+
import static android.app.Activity.RESULT_OK;
|
|
4
|
+
|
|
5
|
+
import android.app.AlertDialog;
|
|
6
|
+
import android.app.Fragment;
|
|
7
|
+
import android.content.DialogInterface;
|
|
8
|
+
import android.content.Intent;
|
|
9
|
+
import android.net.Uri;
|
|
10
|
+
import android.os.Bundle;
|
|
11
|
+
|
|
12
|
+
import android.view.LayoutInflater;
|
|
13
|
+
import android.view.View;
|
|
14
|
+
import android.view.ViewGroup;
|
|
15
|
+
import android.widget.LinearLayout;
|
|
16
|
+
|
|
17
|
+
import androidx.annotation.Nullable;
|
|
18
|
+
|
|
19
|
+
import com.dsphotoeditor.sdk.activity.DsPhotoEditorActivity;
|
|
20
|
+
import com.dsphotoeditor.sdk.activity.DsPhotoEditorCropActivity;
|
|
21
|
+
import com.dsphotoeditor.sdk.activity.DsPhotoEditorDrawActivity;
|
|
22
|
+
import com.dsphotoeditor.sdk.activity.DsPhotoEditorTextActivity;
|
|
23
|
+
|
|
24
|
+
public class PhotoEditorMenu extends Fragment implements View.OnClickListener {
|
|
25
|
+
|
|
26
|
+
// TODO: Rename parameter arguments, choose names that match
|
|
27
|
+
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
|
28
|
+
private DsPhotoEditorActivity a;
|
|
29
|
+
private LinearLayout c;
|
|
30
|
+
int[] clickableButton;
|
|
31
|
+
private FakeR fakeR;
|
|
32
|
+
|
|
33
|
+
@Override
|
|
34
|
+
public void onCreate(@Nullable Bundle savedInstanceState) {
|
|
35
|
+
super.onCreate(savedInstanceState);
|
|
36
|
+
this.fakeR = new FakeR(getActivity());
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@Override
|
|
40
|
+
public View onCreateView(LayoutInflater var1, ViewGroup var2, Bundle var3) {
|
|
41
|
+
View var4 = var1.inflate(fakeR.getLayout("fragment_photo_editor_menu"), var2, false);
|
|
42
|
+
clickableButton = new int[] {
|
|
43
|
+
fakeR.getId("ds_photo_editor_btn_crop"),
|
|
44
|
+
fakeR.getId("ds_photo_editor_btn_sticker"),
|
|
45
|
+
fakeR.getId("ds_photo_editor_btn_text"),
|
|
46
|
+
fakeR.getId("ds_photo_editor_btn_draw"),
|
|
47
|
+
fakeR.getId("ds_photo_editor_btn_remove"),
|
|
48
|
+
};
|
|
49
|
+
this.a = (DsPhotoEditorActivity) this.getActivity();
|
|
50
|
+
this.c = var4.findViewById(fakeR.getId("custom_photo_editor_bar_bottom_container"));
|
|
51
|
+
int var6;
|
|
52
|
+
for(var6 = 0; var6 < clickableButton.length; ++var6) {
|
|
53
|
+
this.c.findViewById(clickableButton[var6]).setOnClickListener(this);
|
|
54
|
+
}
|
|
55
|
+
return var4;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public void onClick(View var1) {
|
|
59
|
+
int var2 = var1.getId();
|
|
60
|
+
DsPhotoEditorActivity var10000;
|
|
61
|
+
Intent var3;
|
|
62
|
+
if(var2 == fakeR.getId("ds_photo_editor_btn_crop")) {
|
|
63
|
+
DsPhotoEditorActivity.intentResult = null;
|
|
64
|
+
DsPhotoEditorCropActivity.original = this.a.getHdBitmap();
|
|
65
|
+
var3 = new Intent(this.a, CCropActivity.class);
|
|
66
|
+
var10000 = this.a;
|
|
67
|
+
this.a.getClass();
|
|
68
|
+
var10000.startActivityForResult(var3, 3);
|
|
69
|
+
this.a.toolType = 6;
|
|
70
|
+
} else if(var2 == fakeR.getId("ds_photo_editor_btn_sticker")) {
|
|
71
|
+
DsPhotoEditorActivity.intentResult = null;
|
|
72
|
+
PhotoEditorMesureCustomActivity.original = this.a.getHdBitmap();
|
|
73
|
+
var3 = new Intent(this.a, PhotoEditorMesureCustomActivity.class);
|
|
74
|
+
var10000 = this.a;
|
|
75
|
+
this.a.getClass();
|
|
76
|
+
var10000.startActivityForResult(var3, 2);
|
|
77
|
+
this.a.toolType = 14;
|
|
78
|
+
} else if(var2 == fakeR.getId("ds_photo_editor_btn_text")) {
|
|
79
|
+
DsPhotoEditorActivity.intentResult = null;
|
|
80
|
+
DsPhotoEditorTextActivity.original = this.a.getHdBitmap();
|
|
81
|
+
var3 = new Intent(this.a, CTextActivity.class);
|
|
82
|
+
var10000 = this.a;
|
|
83
|
+
this.a.getClass();
|
|
84
|
+
var10000.startActivityForResult(var3, 2);
|
|
85
|
+
this.a.toolType = 14;
|
|
86
|
+
} else if(var2 == fakeR.getId("ds_photo_editor_btn_draw")) {
|
|
87
|
+
DsPhotoEditorActivity.intentResult = null;
|
|
88
|
+
DsPhotoEditorDrawActivity.original = this.a.getHdBitmap();
|
|
89
|
+
var3 = new Intent(this.a, CDrawActivity.class);
|
|
90
|
+
var10000 = this.a;
|
|
91
|
+
this.a.getClass();
|
|
92
|
+
var10000.startActivityForResult(var3, 4);
|
|
93
|
+
this.a.toolType = 12;
|
|
94
|
+
} else if(var2 == fakeR.getId("ds_photo_editor_btn_remove")) {
|
|
95
|
+
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
|
96
|
+
builder.setMessage("Voulez vous vraiment supprimer l'image?").setPositiveButton("Oui", new android.content.DialogInterface.OnClickListener() {
|
|
97
|
+
public void onClick(DialogInterface var1, int var2) {
|
|
98
|
+
Intent data = new Intent();
|
|
99
|
+
String result = "remove";
|
|
100
|
+
data.setData(Uri.parse(result));
|
|
101
|
+
getActivity().setResult(RESULT_OK, data);
|
|
102
|
+
getActivity().finish();
|
|
103
|
+
}
|
|
104
|
+
}).setNegativeButton("Annuler", new android.content.DialogInterface.OnClickListener() {
|
|
105
|
+
public void onClick(DialogInterface var1, int var2) {
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
builder.create().show();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|