-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[camerax] Wrap methods necessary for preview implementation #7046
Changes from 22 commits
496ca83
c9593ba
8e8779e
6e5bc8e
268d9f5
2001c33
7552ad9
7ff2a94
dfc3071
4ba07e2
754939c
fb44db3
858815d
78edaa2
3527322
335372b
4dd9c4c
24b1bdb
e0efef2
e90f45c
73cb5f8
abf4e58
659c2e0
5f269c7
a6fe15c
78e0d0f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,8 +5,13 @@ | |
| package io.flutter.plugins.camerax; | ||
|
|
||
| import android.app.Activity; | ||
| import android.graphics.SurfaceTexture; | ||
| import android.view.Surface; | ||
| import androidx.camera.core.CameraSelector; | ||
| import androidx.camera.core.Preview; | ||
| import io.flutter.plugin.common.BinaryMessenger; | ||
|
|
||
| /** Utility class used to create CameraX-related objects primarily for testing purposes. */ | ||
| public class CameraXProxy { | ||
| public CameraSelector.Builder createCameraSelectorBuilder() { | ||
| return new CameraSelector.Builder(); | ||
|
|
@@ -23,4 +28,23 @@ public DeviceOrientationManager createDeviceOrientationManager( | |
| DeviceOrientationManager.DeviceOrientationChangeCallback callback) { | ||
| return new DeviceOrientationManager(activity, isFrontFacing, sensorOrientation, callback); | ||
| } | ||
|
|
||
| public Preview.Builder createPreviewBuilder() { | ||
| return new Preview.Builder(); | ||
| } | ||
|
|
||
| public Surface createSurface(SurfaceTexture surfaceTexture) { | ||
|
||
| return new Surface(surfaceTexture); | ||
| } | ||
|
|
||
| /** | ||
| * Creates an instance of the {@code SystemServicesFlutterApiImpl}. | ||
| * | ||
| * <p>Included in this class to utilize the callback methods it provides, e.g. {@code | ||
| * onCameraError(String)}. | ||
| */ | ||
| public SystemServicesFlutterApiImpl createSystemServicesFlutterApiImpl( | ||
| BinaryMessenger binaryMessenger) { | ||
| return new SystemServicesFlutterApiImpl(binaryMessenger); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.