mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-06-27 09:02:59 +02:00
if in video mode, turning on the flash turns it into a flashlight
This commit is contained in:
@ -61,6 +61,7 @@ public class MainActivity extends AppCompatActivity implements SensorEventListen
|
||||
|
||||
@OnClick(R.id.toggle_camera)
|
||||
public void toggleCamera() {
|
||||
disableFlash();
|
||||
hideTimer();
|
||||
if (currCamera == Camera.CameraInfo.CAMERA_FACING_BACK) {
|
||||
currCamera = Camera.CameraInfo.CAMERA_FACING_FRONT;
|
||||
@ -123,20 +124,25 @@ public class MainActivity extends AppCompatActivity implements SensorEventListen
|
||||
|
||||
@OnClick(R.id.toggle_videocam)
|
||||
public void toggleVideo() {
|
||||
disableFlash();
|
||||
hideTimer();
|
||||
isPhoto = !isPhoto;
|
||||
toggleCameraBtn.setVisibility(View.VISIBLE);
|
||||
|
||||
if (isPhoto) {
|
||||
final Resources res = getResources();
|
||||
togglePhotoVideoBtn.setImageDrawable(res.getDrawable(R.mipmap.videocam));
|
||||
shutterBtn.setImageDrawable(res.getDrawable(R.mipmap.camera));
|
||||
preview.initPhotoMode();
|
||||
initPhoto();
|
||||
} else {
|
||||
initVideo();
|
||||
}
|
||||
}
|
||||
|
||||
private void initPhoto() {
|
||||
final Resources res = getResources();
|
||||
togglePhotoVideoBtn.setImageDrawable(res.getDrawable(R.mipmap.videocam));
|
||||
shutterBtn.setImageDrawable(res.getDrawable(R.mipmap.camera));
|
||||
preview.initPhotoMode();
|
||||
}
|
||||
|
||||
private void initVideo() {
|
||||
final Resources res = getResources();
|
||||
togglePhotoVideoBtn.setImageDrawable(res.getDrawable(R.mipmap.photo));
|
||||
|
Reference in New Issue
Block a user