1616public class SettingsActivity extends AppCompatActivity {
1717 @ BindView (R .id .settings_long_tap ) SwitchCompat mLongTapSwitch ;
1818 @ BindView (R .id .settings_focus_before_capture ) SwitchCompat mFocusBeforeCaptureSwitch ;
19+ @ BindView (R .id .settings_sound ) SwitchCompat mSoundSwitch ;
1920 @ BindView (R .id .settings_force_ratio ) SwitchCompat mForceRatioSwitch ;
2021 @ BindView (R .id .settings_max_resolution ) AppCompatSpinner mMaxResolutionSpinner ;
2122
@@ -30,6 +31,7 @@ protected void onCreate(Bundle savedInstanceState) {
3031
3132 setupLongTap ();
3233 setupFocusBeforeCapture ();
34+ setupSound ();
3335 setupForceRatio ();
3436 setupMaxResolution ();
3537 }
@@ -42,6 +44,10 @@ private void setupFocusBeforeCapture() {
4244 mFocusBeforeCaptureSwitch .setChecked (mConfig .getFocusBeforeCaptureEnabled ());
4345 }
4446
47+ private void setupSound () {
48+ mSoundSwitch .setChecked (mConfig .getIsSoundEnabled ());
49+ }
50+
4551 private void setupForceRatio () {
4652 mForceRatioSwitch .setChecked (mConfig .getForceRatioEnabled ());
4753 }
@@ -62,6 +68,12 @@ public void handleFocusBeforeCapture() {
6268 mConfig .setFocusBeforeCaptureEnabled (mFocusBeforeCaptureSwitch .isChecked ());
6369 }
6470
71+ @ OnClick (R .id .settings_sound_holder )
72+ public void handleSound () {
73+ mSoundSwitch .setChecked (!mSoundSwitch .isChecked ());
74+ mConfig .setIsSoundEnabled (mSoundSwitch .isChecked ());
75+ }
76+
6577 @ OnClick (R .id .settings_force_ratio_holder )
6678 public void handleForceRatio () {
6779 mForceRatioSwitch .setChecked (!mForceRatioSwitch .isChecked ());
0 commit comments