-
Notifications
You must be signed in to change notification settings - Fork 54
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
Added camera switch mode: Front/Back #97
base: 2.x
Are you sure you want to change the base?
Conversation
I'll handle it today |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dimanych Thanks for your work!
I appreciate a lot your contribution 👏
Just I left some comments, let me know what do you think
|
||
|
||
### Camera mode | ||
Switching camera for front or back. By default back set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not very good with English 😓 , but maybe this sentence is clearer, wdyt?
Switching the front or back camera. By default the back one is set
And what about adding a reminder to put this lines in the manifest?:
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.front" android:required="false" />
@@ -3,6 +3,8 @@ | |||
package="com.miguelbcr.ui.rx_paparazzo2.sample"> | |||
|
|||
<uses-permission android:name="android.permission.CAMERA"/> | |||
<uses-feature android:name="android.hardware.camera" android:required="false" /> | |||
<uses-feature android:name="android.hardware.camera.front" android:required="false" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice :)
|
||
BACK | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] Maybe without spaces?
public enum CameraMode {
FRONT,
BACK
}
if (CameraMode.FRONT.equals(config.getCameraMode())) { | ||
intent.putExtra("android.intent.extras.CAMERA_FACING", android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT); | ||
intent.putExtra("android.intent.extras.LENS_FACING_FRONT", 1); | ||
intent.putExtra("android.intent.extra.USE_FRONT_CAMERA", true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that android.hardware.Camera.CameraInfo
is deprecated from API 21 (Build.VERSION_CODES.LOLLIPOP) -> https://developer.android.com/reference/android/hardware/Camera.CameraInfo
Instead, suggests to use android.hardware.camera2.
-> https://developer.android.com/reference/android/hardware/camera2/package-summary
I can see that LENS_FACING_FRONT
was added from API 21:
I wonder if you have tested it in several android versions just to make sure it works, for instance, API 18, 21, 22, 27
I'll try it too...
No description provided.