-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[camera_android_camerax] Java style improvements #9234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
14c2965
first half java style
camsim99 1027120
second half java style
camsim99 8987e2b
error prone
camsim99 ab85b64
java, kotlin lint
camsim99 c90d457
java code clarity
camsim99 28d1884
lint + format
camsim99 e4e65f5
Add linter required return statement
camsim99 05f765d
version bump
camsim99 11c9c71
fix test
camsim99 0564cac
fix test + add new
camsim99 f45a25b
increase memory for robolectric
camsim99 2becbc5
Merge remote-tracking branch 'upstream/main' into camx_import
camsim99 a912611
correct method name from merge
camsim99 e2b5d9d
forgot the tests :/
camsim99 7309230
bump minor version
camsim99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
|
|
||
| package io.flutter.plugins.camerax; | ||
|
|
||
| import android.annotation.SuppressLint; | ||
| import android.content.BroadcastReceiver; | ||
| import android.content.Context; | ||
| import android.content.Intent; | ||
|
|
@@ -47,6 +48,8 @@ Context getContext() { | |
| * <p>When orientation information is updated, the callback method of the {@link | ||
| * DeviceOrientationManagerProxyApi} is called with the new orientation. | ||
| */ | ||
| @SuppressLint( | ||
| "UnprotectedReceiver") // orientationIntentFilter only listens to protected broadcast | ||
| public void start() { | ||
| stop(); | ||
|
|
||
|
|
@@ -68,7 +71,7 @@ protected OrientationEventListener createOrientationEventListener() { | |
| return new OrientationEventListener(getContext()) { | ||
| @Override | ||
| public void onOrientationChanged(int orientation) { | ||
| handleUIOrientationChange(); | ||
| handleUiOrientationChange(); | ||
| } | ||
| }; | ||
| } | ||
|
|
@@ -91,8 +94,8 @@ public void stop() { | |
| * class. | ||
| */ | ||
| @VisibleForTesting | ||
| void handleUIOrientationChange() { | ||
| PlatformChannel.DeviceOrientation orientation = getUIOrientation(); | ||
| void handleUiOrientationChange() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Calling out that this is a possible braking change since it was technically public but because we annotated it @VisibleForTesing then we are ok with it breaking anyone that relied on it. |
||
| PlatformChannel.DeviceOrientation orientation = getUiOrientation(); | ||
| handleOrientationChange(this, orientation, lastOrientation, api); | ||
| lastOrientation = orientation; | ||
| } | ||
|
|
@@ -143,7 +146,7 @@ public void run() { | |
| // Configuration.ORIENTATION_SQUARE is deprecated. | ||
| @SuppressWarnings("deprecation") | ||
| @NonNull | ||
| PlatformChannel.DeviceOrientation getUIOrientation() { | ||
| PlatformChannel.DeviceOrientation getUiOrientation() { | ||
| final int rotation = getDefaultRotation(); | ||
| final int orientation = getContext().getResources().getConfiguration().orientation; | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.