Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
6125eca
Recreating image capture impl from flutter/plugins
camsim99 Feb 23, 2023
5be1371
Merge remote-tracking branch 'upstream/main' into camx_imgcap
camsim99 Feb 23, 2023
b2fce3d
Fix integration tesT
camsim99 Feb 23, 2023
ed62a9a
Merge branch 'main' into camx_imgcap
camsim99 Feb 23, 2023
2e3027b
Analyzer pt 2
camsim99 Feb 23, 2023
fbd3fe5
Merge branch 'camx_imgcap' of github.com:camsim99/packages into camx_…
camsim99 Feb 23, 2023
dfa477e
Personal cleanup
camsim99 Feb 23, 2023
a651b92
Add initialization of controller
camsim99 Feb 24, 2023
884fd6c
Merge remote-tracking branch 'upstream/main' into camx_imgcap
camsim99 Feb 24, 2023
d5f8b91
Modify some docs
camsim99 Feb 24, 2023
060b7e5
Address review
camsim99 Mar 2, 2023
ff50c70
Merge remote-tracking branch 'upstream/main' into camx_imgcap
camsim99 Mar 2, 2023
fe6f1fc
Fix analyze
camsim99 Mar 2, 2023
e2643ae
Update packages/camera/camera_android_camerax/android/src/main/java/i…
camsim99 Mar 3, 2023
b7194f7
Update packages/camera/camera_android_camerax/lib/src/image_capture.dart
camsim99 Mar 3, 2023
dadc230
Start addressing review
camsim99 Mar 6, 2023
d15e1d4
Finish addressing review
camsim99 Mar 7, 2023
6dc2b77
Fix analyze
camsim99 Mar 7, 2023
f826b62
Generate mocks on stable
camsim99 Mar 7, 2023
0f7f29a
Fix/add tests
camsim99 Mar 7, 2023
1e9739b
Add isBound dart test
camsim99 Mar 7, 2023
9ba20d0
Merge remote-tracking branch 'upstream/main' into camx_imgcap
camsim99 Mar 13, 2023
5bf6b17
Start dev
camsim99 Mar 8, 2023
5e58b2c
Add cameraClosing impl
camsim99 Mar 8, 2023
4c8c94d
Add tests
camsim99 Mar 13, 2023
6a0de08
Implement occ with camera state
camsim99 Mar 14, 2023
d3ed3e7
Reimplement with live camera state
camsim99 Mar 15, 2023
d1c684f
Start adding tests
camsim99 Mar 22, 2023
c04d8c1
Add java tests
camsim99 Mar 22, 2023
b2322d2
Formatting
camsim99 Mar 22, 2023
3545aec
Merge remote-tracking branch 'upstream/main' into camx_occ
camsim99 Mar 22, 2023
e1f5bdb
Fix flutter analyze
camsim99 Mar 22, 2023
2d3409b
Fix analyze
camsim99 Mar 22, 2023
1f40f47
Review
camsim99 Mar 22, 2023
6c9b04e
Fix tests, review 2
camsim99 Mar 23, 2023
6c6cbb4
review 3
camsim99 Mar 23, 2023
a0ea3c5
Merge remote-tracking branch 'upstream/main' into camx_occ
camsim99 Mar 23, 2023
06c1545
fix analyze
camsim99 Mar 23, 2023
681a117
Fix cast
camsim99 Mar 23, 2023
1143a03
generate mocks on stable
camsim99 Mar 23, 2023
d431511
Formatting
camsim99 Mar 24, 2023
ab3c085
Add missing tests
camsim99 Mar 24, 2023
631f972
Merge remote-tracking branch 'upstream/main' into camx_occ
camsim99 Mar 24, 2023
70c817a
Fix analyze
camsim99 Mar 24, 2023
426b438
Bump camerax version
camsim99 Mar 27, 2023
2bc4877
Merge remote-tracking branch 'upstream/main' into camx_occ
camsim99 Mar 28, 2023
0fcf7c6
Merge remote-tracking branch 'upstream/main' into camx_occ
camsim99 Mar 29, 2023
6c49bd9
Formatting
camsim99 Mar 29, 2023
b9daeb1
pair programming w/maurice
camsim99 Apr 11, 2023
3345878
Fixing plugin
camsim99 Apr 12, 2023
9f6646f
Current status
camsim99 Apr 13, 2023
265eb1e
Remove print statements
camsim99 Apr 14, 2023
bfc4b5e
Add print
camsim99 Apr 14, 2023
4f3c342
remove comments
camsim99 Apr 14, 2023
e3c7a5b
Review 2
camsim99 Apr 17, 2023
f341f7f
Fixing tests
camsim99 Apr 18, 2023
0d4b021
Fix tests, format
camsim99 Apr 18, 2023
ca3bd9e
Merge remote-tracking branch 'upstream/main' into camx_occ
camsim99 Apr 18, 2023
540ee98
Fix test
camsim99 Apr 18, 2023
debcd3a
Fix camera test
camsim99 Apr 18, 2023
a79ee62
Start addressing review
camsim99 Apr 25, 2023
438f592
Merge remote-tracking branch 'upstream/main' into camx_occ
camsim99 May 1, 2023
c44fc06
Address review, remove cast
camsim99 May 1, 2023
83aea10
Fix java tests
camsim99 May 1, 2023
5f435e8
Fix dart tests
camsim99 May 1, 2023
581af94
Merge remote-tracking branch 'upstream/main' into camx_occ
camsim99 May 1, 2023
dec3d69
Merge remote-tracking branch 'upstream/main' into camx_occ
camsim99 May 1, 2023
02c039f
Merge branch 'camx_occ' into camx_occ_3
camsim99 May 1, 2023
ce463ba
Undo changes to other packages
camsim99 May 1, 2023
c525162
Undo non-camera changes
camsim99 May 1, 2023
86304c3
Add getValue
camsim99 May 2, 2023
b826c18
Fix tests
camsim99 May 2, 2023
2cebb18
Add log and formatting
camsim99 May 2, 2023
04976ec
Add period
camsim99 May 2, 2023
bca72ee
Fix android test errors
camsim99 May 2, 2023
2da0b8f
Merge remote-tracking branch 'upstream/main' into camx_occ_3
camsim99 May 2, 2023
ea78ab0
fix tests
camsim99 May 3, 2023
d0b160f
Formatting
camsim99 May 3, 2023
bc7ebee
Fix tests
camsim99 May 3, 2023
9014d3b
Add mock files
camsim99 May 3, 2023
f3d6a06
Addres test comments
camsim99 May 3, 2023
34cab98
Address rest of review
camsim99 May 3, 2023
6f701a5
Address maurice review
camsim99 May 3, 2023
a636525
Address reviews
camsim99 May 4, 2023
d5a21cb
Improve comments
camsim99 May 5, 2023
bc4ebc1
Update packages/camera/camera_android_camerax/lib/src/android_camera_…
camsim99 May 8, 2023
491ab2c
Apply patch + fix dispose
camsim99 May 8, 2023
bff96a9
Merge branch 'camx_occ_3' of github.com:camsim99/packages into camx_o…
camsim99 May 8, 2023
ad40999
Merge remote-tracking branch 'upstream/main' into camx_occ_3
camsim99 May 8, 2023
a3667dd
Merge remote-tracking branch 'upstream/main' into camx_occ_3
camsim99 May 9, 2023
c3732fe
Merge remote-tracking branch 'upstream/main' into camx_occ_3
camsim99 May 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address rest of review
  • Loading branch information
camsim99 committed May 3, 2023
commit 34cab98acb7a1df263ef191af64589699a5fefe4
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,32 @@ public Long getValue(@NonNull Long identifier, @NonNull LiveDataSupportedTypeDat
LiveDataSupportedType valueType = type.getValue();
switch (valueType) {
case CAMERA_STATE:
CameraState cameraState = (CameraState) value;
new CameraStateFlutterApiWrapper(binaryMessenger, instanceManager)
.create(
cameraState,
CameraStateFlutterApiWrapper.getCameraStateType(cameraState.getType()),
cameraState.getError(),
reply -> {});
return instanceManager.getIdentifierForStrongReference(cameraState);
return createCameraState((CameraState) value);
case ZOOM_STATE:
ZoomState zoomState = (ZoomState) value;
new ZoomStateFlutterApiImpl(binaryMessenger, instanceManager)
.create(zoomState, reply -> {});
return instanceManager.getIdentifierForStrongReference(zoomState);
return createZoomState((ZoomState) value);
default:
throw new IllegalArgumentException(
"The type of LiveData whose value was requested is not supported.");
}
}

/** Creates a {@link CameraState} on the Dart side and returns its identifier. */
private Long createCameraState(CameraState cameraState) {
new CameraStateFlutterApiWrapper(binaryMessenger, instanceManager)
.create(
cameraState,
CameraStateFlutterApiWrapper.getCameraStateType(cameraState.getType()),
cameraState.getError(),
reply -> {});
return instanceManager.getIdentifierForStrongReference(cameraState);
}

/** Creates a {@link ZoomState} on the Dart side and returns its identifiers. */
private Long createZoomState(ZoomState zoomState) {
new ZoomStateFlutterApiImpl(binaryMessenger, instanceManager).create(zoomState, reply -> {});
return instanceManager.getIdentifierForStrongReference(zoomState);
}

/** Retrieves the {@link LiveData} instance that has the specified identifier. */
private LiveData<?> getLiveDataInstance(@NonNull Long identifier) {
return Objects.requireNonNull(instanceManager.getInstance(identifier));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,21 @@ public ObserverFlutterApiWrapper(
* Sends a message to Dart to call {@link Observer.onChanged} on the Dart object representing
* {@code instance}.
*/
public void onChanged(
@NonNull Observer<?> instance,
@NonNull Object value,
public <T> void onChanged(
@NonNull Observer<T> instance,
@NonNull T value,
@NonNull ObserverFlutterApi.Reply<Void> callback) {

// Cast value to type of data that is being observed if supported by this plugin.
// Cast value to type of data that is being observed and create it on the Dart side
// if supported by this plugin.
//
// The supported types can be found in GeneratedCameraXLibrary.java as the
// LiveDataSupportedType enum. To add a new type, please follow the instructions
// found in pigeons/camerax_library.dart in the documentation for LiveDataSupportedType.
if (value instanceof CameraState) {
CameraState state = (CameraState) value;

if (cameraStateFlutterApiWrapper == null) {
cameraStateFlutterApiWrapper =
new CameraStateFlutterApiWrapper(binaryMessenger, instanceManager);
}
cameraStateFlutterApiWrapper.create(
state,
CameraStateFlutterApiWrapper.getCameraStateType(state.getType()),
state.getError(),
reply -> {});
createCameraState((CameraState) value);
} else if (value instanceof ZoomState) {
ZoomState state = (ZoomState) value;

if (zoomStateFlutterApiImpl == null) {
zoomStateFlutterApiImpl = new ZoomStateFlutterApiImpl(binaryMessenger, instanceManager);
}
zoomStateFlutterApiImpl.create(state, reply -> {});
createZoomState((ZoomState) value);
} else {
throw new UnsupportedOperationException(
"The type of value that was observed is not handled by this plugin.");
Expand All @@ -93,6 +83,27 @@ public void onChanged(
callback);
}

/** Creates a {@link CameraState} on the Dart side. */
private void createCameraState(CameraState cameraState) {
if (cameraStateFlutterApiWrapper == null) {
cameraStateFlutterApiWrapper =
new CameraStateFlutterApiWrapper(binaryMessenger, instanceManager);
}
cameraStateFlutterApiWrapper.create(
cameraState,
CameraStateFlutterApiWrapper.getCameraStateType(cameraState.getType()),
cameraState.getError(),
reply -> {});
}

/** Creates a {@link ZoomState} on the Dart side. */
private void createZoomState(ZoomState zoomState) {
if (zoomStateFlutterApiImpl == null) {
zoomStateFlutterApiImpl = new ZoomStateFlutterApiImpl(binaryMessenger, instanceManager);
}
zoomStateFlutterApiImpl.create(zoomState, reply -> {});
}

/** Sets the Flutter API used to send messages to Dart. */
@VisibleForTesting
void setApi(@NonNull ObserverFlutterApi api) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,10 @@ public void getValue_returnsExpectedValue() {
hostApi.getValue(mockLiveZoomStateIdentifier, typeData), mockZoomStateIdentifier);
break;
default:
// There is a LiveDataSupportedType untested by this method.
fail();
fail(
"The LiveDataSupportedType "
+ supportedType.toString()
+ "is unhandled by this test.");
}
}
}
Expand Down