remove one more toast on resume

This commit is contained in:
tibbi 2016-06-17 23:11:02 +02:00
parent 98c4ed72e4
commit 56c05cb737
1 changed files with 4 additions and 4 deletions

View File

@ -288,7 +288,7 @@ public class MainActivity extends AppCompatActivity implements SensorEventListen
if (isInPhotoMode) { if (isInPhotoMode) {
initPhotoButtons(); initPhotoButtons();
} else { } else {
initVideoButtons(); initVideoButtons(true);
} }
} }
@ -299,14 +299,14 @@ public class MainActivity extends AppCompatActivity implements SensorEventListen
preview.initPhotoMode(); preview.initPhotoMode();
} }
private void initVideoButtons() { private void initVideoButtons(boolean warnOnError) {
if (preview.initRecorder()) { if (preview.initRecorder()) {
final Resources res = getResources(); final Resources res = getResources();
togglePhotoVideoBtn.setImageDrawable(res.getDrawable(R.mipmap.photo)); togglePhotoVideoBtn.setImageDrawable(res.getDrawable(R.mipmap.photo));
shutterBtn.setImageDrawable(res.getDrawable(R.mipmap.video_rec)); shutterBtn.setImageDrawable(res.getDrawable(R.mipmap.video_rec));
toggleCameraBtn.setVisibility(View.VISIBLE); toggleCameraBtn.setVisibility(View.VISIBLE);
} else { } else {
if (!isVideoCaptureIntent) { if (!isVideoCaptureIntent && warnOnError) {
Utils.showToast(getApplicationContext(), R.string.video_mode_error); Utils.showToast(getApplicationContext(), R.string.video_mode_error);
} }
} }
@ -366,7 +366,7 @@ public class MainActivity extends AppCompatActivity implements SensorEventListen
} }
if (!isInPhotoMode) { if (!isInPhotoMode) {
initVideoButtons(); initVideoButtons(false);
} }
} else { } else {
Utils.showToast(getApplicationContext(), R.string.camera_switch_error); Utils.showToast(getApplicationContext(), R.string.camera_switch_error);