Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5de5fe6
[camera_android] Provides a default exposure point if null.
Mairramer Apr 29, 2023
42a0dfa
fix CHANGELOG.md
Mairramer Apr 29, 2023
f7d396c
[camera_android] fix shouldReset method
Mairramer Apr 29, 2023
b6eb659
remove unnecessary code duplication
Mairramer May 2, 2023
35d06b6
Merge branch 'main' into camera_exposure_fix
Mairramer May 2, 2023
f0b2a8e
fix tests
Mairramer May 3, 2023
47e29c0
Merge branch 'main' into camera_exposure_fix
Mairramer May 3, 2023
b54da73
Merge branch 'main' into camera_exposure_fix
Mairramer May 9, 2023
21be4a5
update shouldReset method
Mairramer May 9, 2023
bd23ce5
Merge branch 'main' into camera_exposure_fix
Mairramer May 10, 2023
a9ca844
Merge branch 'main' into camera_exposure_fix
Mairramer May 11, 2023
b531c28
[camera_android] added method to create default exposure
Mairramer May 30, 2023
09865ad
Merge branch 'main' into camera_exposure_fix
Mairramer May 30, 2023
ceec022
nullable annotation
Mairramer May 30, 2023
ede1627
Merge branch 'main' into camera_exposure_fix
Mairramer May 30, 2023
f0c3c20
added try catch
Mairramer May 30, 2023
a8e7f74
Merge branch 'main' into camera_exposure_fix
Mairramer Jun 5, 2023
f57a167
refactor unnecessary methods
Mairramer Jun 5, 2023
a27be59
added IllegalArgumentException
Mairramer Jun 5, 2023
9a78407
remove dead code
Mairramer Jun 5, 2023
9278364
fix version
Mairramer Jun 5, 2023
f4209a6
Merge branch 'main' into camera_exposure_fix
Mairramer Jun 5, 2023
8e3f2ee
Merge branch 'main' into camera_exposure_fix
Mairramer Jun 6, 2023
234981d
Merge branch 'main' into camera_exposure_fix
reidbaker Jul 13, 2023
49d5b33
[camera_android] set default exposure rectangle
Mairramer Jul 15, 2023
19a60e0
Merge branch 'main' into camera_exposure_fix
Mairramer Jul 15, 2023
fd74bf9
remove comment
Mairramer Jul 17, 2023
ee57798
refactor logic
Mairramer Jul 17, 2023
cb382e8
Merge branch 'main' into camera_exposure_fix
Mairramer Jul 18, 2023
ba19e89
added new logic
Mairramer Jul 18, 2023
2ad4c91
Merge branch 'main' into camera_exposure_fix
Mairramer Jul 18, 2023
88ecbf1
refactor logic
Mairramer Jul 19, 2023
583a0fd
rename test
Mairramer Jul 19, 2023
f16fab4
Merge branch 'main' into camera_exposure_fix
Mairramer Jul 19, 2023
40630f1
improve tests
Mairramer Jul 24, 2023
4ddad4c
improve mocks exposure tests
Mairramer Jul 26, 2023
e4c7e1e
Merge branch 'main' into camera_exposure_fix
Mairramer Jul 27, 2023
f84bf60
Update pubspec.yaml
Mairramer Jul 27, 2023
c1c3a8c
change version
Mairramer Jul 27, 2023
1ce574e
Merge branch 'main' into camera_exposure_fix
Mairramer Jul 27, 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
improve tests
  • Loading branch information
Mairramer committed Jul 24, 2023
commit 40630f147c5760bbda84e03544d40d0aec9dfdac
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.util.Size;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import io.flutter.embedding.engine.systemchannels.PlatformChannel;
import io.flutter.plugins.camera.CameraProperties;
import io.flutter.plugins.camera.CameraRegionUtils;
Expand All @@ -25,7 +26,7 @@ public class ExposurePointFeature extends CameraFeature<Point> {
private MeteringRectangle exposureRectangle;
@NonNull private final SensorOrientationFeature sensorOrientationFeature;
private boolean defaultRegionsHasBeenSet = false;
@Nullable private MeteringRectangle[] defaultRegions;
@VisibleForTesting @Nullable public MeteringRectangle[] defaultRegions;

/**
* Creates a new instance of the {@link ExposurePointFeature}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
Expand All @@ -28,7 +27,6 @@
import io.flutter.plugins.camera.features.sensororientation.SensorOrientationFeature;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.MockedStatic;
import org.mockito.Mockito;

Expand Down Expand Up @@ -310,7 +308,8 @@ public void updateBuilder_shouldSetDefaultMeteringRectangleWhenNoValidCoordsAreS
exposurePointFeature.updateBuilder(mockCaptureRequestBuilder);
exposurePointFeature.setValue(new Point(null, 0d));
exposurePointFeature.updateBuilder(mockCaptureRequestBuilder);
verify(mockCaptureRequestBuilder, times(3)).set(any(), any());

verify(mockCaptureRequestBuilder, times(3)).set(any(), eq(exposurePointFeature.defaultRegions));
}

@Test
Expand All @@ -327,11 +326,6 @@ public void updateBuilder_shouldSetNonNullMeteringRectangleWhenNullValueIsSuppli

exposurePointFeature.updateBuilder(mockCaptureRequestBuilder);

ArgumentCaptor<MeteringRectangle[]> meteringRectangleCaptor =
ArgumentCaptor.forClass(MeteringRectangle[].class);

verify(mockCaptureRequestBuilder, times(1))
.set(eq(CaptureRequest.CONTROL_AE_REGIONS), meteringRectangleCaptor.capture());

verify(mockCaptureRequestBuilder, times(1)).set(any(), eq(exposurePointFeature.defaultRegions));
}
}