@@ -44,6 +44,8 @@ public class MainActivity extends AppCompatActivity implements SurfaceHolder.Cal
4444 private static volatile boolean sMainVisible = false ;
4545 private static volatile boolean sSettingsDialogOpen = false ;
4646 private final SettingsAppearanceController appearanceController = new SettingsAppearanceController (this );
47+ private final SignalCameraSettingsController signalCameraSettingsController =
48+ new SignalCameraSettingsController (this );
4749
4850 private final OtaController otaController = new OtaController (this );
4951
@@ -192,74 +194,86 @@ private void showSettingsDialog() {
192194 SharedPreferences avmPrefs = getSharedPreferences (AVM_PREFS_NAME , MODE_PRIVATE );
193195
194196 Switch swOverlay = dialog .findViewById (R .id .switchOverlayOnSignal );
195- swOverlay .setChecked (prefs .getBoolean ("overlayOnSignal" , false ));
196- swOverlay .setOnCheckedChangeListener ((btn , checked ) -> {
197- prefs .edit ().putBoolean ("overlayOnSignal" , checked ).apply ();
198- if (!checked ) OverlayService .hideOverlay (this );
199- });
200-
201197 Switch swSafetyWarning = dialog .findViewById (R .id .switchSafetyWarning );
202198 swSafetyWarning .setChecked (avmPrefs .getBoolean (KEY_SAFETY_WARNING , true ));
203199 swSafetyWarning .setOnCheckedChangeListener ((btn , checked ) -> {
204200 avmPrefs .edit ().putBoolean (KEY_SAFETY_WARNING , checked ).apply ();
205201 applyWarningVisibility ();
206202 });
207203 Switch swAllowBetaUpdates = dialog .findViewById (R .id .switchAllowBetaUpdates );
204+ SeekBar seekOverlayHideDelay = dialog .findViewById (R .id .seekOverlayHideDelay );
205+ EditText etOverlayHideDelayValue = dialog .findViewById (R .id .etOverlayHideDelayValue );
208206
209207 SeekBar seekCorner = dialog .findViewById (R .id .seekCornerRadius );
210208 EditText etCorner = dialog .findViewById (R .id .etCornerRadius );
211209 ImageButton dialogClose = dialog .findViewById (R .id .btnClose );
212210 TextView tabUpdate = dialog .findViewById (R .id .tabUpdate );
213211 TextView tabSettings = dialog .findViewById (R .id .tabSettings );
212+ TextView tabSignalCamera = dialog .findViewById (R .id .tabSignalCamera );
214213 TextView tabOptik = dialog .findViewById (R .id .tabOptik );
215214 TextView tabCredits = dialog .findViewById (R .id .tabCredits );
216215 View sectionUpdate = dialog .findViewById (R .id .sectionUpdate );
217216 View sectionSettings = dialog .findViewById (R .id .sectionSettings );
217+ View sectionSignalCamera = dialog .findViewById (R .id .sectionSignalCamera );
218218 View sectionOptik = dialog .findViewById (R .id .sectionOptik );
219219 View sectionCredits = dialog .findViewById (R .id .sectionCredits );
220220 View accentRow = dialog .findViewById (R .id .rowAccentColor );
221221 View accentPreview = dialog .findViewById (R .id .viewAccentPreview );
222222 EditText etAccentColor = dialog .findViewById (R .id .etAccentColor );
223+ signalCameraSettingsController .bind (
224+ prefs ,
225+ swOverlay ,
226+ seekOverlayHideDelay ,
227+ etOverlayHideDelayValue
228+ );
229+
223230 appearanceController .bindSettingsAppearance (
224231 prefs ,
225232 swOverlay ,
226233 swSafetyWarning ,
227234 swAllowBetaUpdates ,
228235 dialogClose ,
236+ seekOverlayHideDelay ,
229237 seekCorner ,
230238 etCorner ,
231239 accentRow ,
232240 accentPreview ,
233241 etAccentColor ,
234242 tabUpdate ,
235243 tabSettings ,
244+ tabSignalCamera ,
236245 tabOptik ,
237246 tabCredits
238247 );
239248
240- bindSettingsTab (tabUpdate , tabSettings , tabOptik , tabCredits ,
241- sectionUpdate , sectionSettings , sectionOptik , sectionCredits , 1 );
249+ bindSettingsTab (tabUpdate , tabSettings , tabSignalCamera , tabOptik , tabCredits ,
250+ sectionUpdate , sectionSettings , sectionSignalCamera , sectionOptik , sectionCredits , 1 );
242251 appearanceController .reapplyForActiveTab (1 );
243252 tabUpdate .setOnClickListener (v -> {
244- bindSettingsTab (tabUpdate , tabSettings , tabOptik , tabCredits ,
245- sectionUpdate , sectionSettings , sectionOptik , sectionCredits , 0 );
253+ bindSettingsTab (tabUpdate , tabSettings , tabSignalCamera , tabOptik , tabCredits ,
254+ sectionUpdate , sectionSettings , sectionSignalCamera , sectionOptik , sectionCredits , 0 );
246255 appearanceController .reapplyForActiveTab (0 );
247256 });
248257 tabSettings .setOnClickListener (v -> {
249- bindSettingsTab (tabUpdate , tabSettings , tabOptik , tabCredits ,
250- sectionUpdate , sectionSettings , sectionOptik , sectionCredits , 1 );
258+ bindSettingsTab (tabUpdate , tabSettings , tabSignalCamera , tabOptik , tabCredits ,
259+ sectionUpdate , sectionSettings , sectionSignalCamera , sectionOptik , sectionCredits , 1 );
251260 appearanceController .reapplyForActiveTab (1 );
252261 });
253- tabOptik .setOnClickListener (v -> {
254- bindSettingsTab (tabUpdate , tabSettings , tabOptik , tabCredits ,
255- sectionUpdate , sectionSettings , sectionOptik , sectionCredits , 2 );
262+ tabSignalCamera .setOnClickListener (v -> {
263+ bindSettingsTab (tabUpdate , tabSettings , tabSignalCamera , tabOptik , tabCredits ,
264+ sectionUpdate , sectionSettings , sectionSignalCamera , sectionOptik , sectionCredits , 2 );
256265 appearanceController .reapplyForActiveTab (2 );
257266 });
258- tabCredits .setOnClickListener (v -> {
259- bindSettingsTab (tabUpdate , tabSettings , tabOptik , tabCredits ,
260- sectionUpdate , sectionSettings , sectionOptik , sectionCredits , 3 );
267+ tabOptik .setOnClickListener (v -> {
268+ bindSettingsTab (tabUpdate , tabSettings , tabSignalCamera , tabOptik , tabCredits ,
269+ sectionUpdate , sectionSettings , sectionSignalCamera , sectionOptik , sectionCredits , 3 );
261270 appearanceController .reapplyForActiveTab (3 );
262271 });
272+ tabCredits .setOnClickListener (v -> {
273+ bindSettingsTab (tabUpdate , tabSettings , tabSignalCamera , tabOptik , tabCredits ,
274+ sectionUpdate , sectionSettings , sectionSignalCamera , sectionOptik , sectionCredits , 4 );
275+ appearanceController .reapplyForActiveTab (4 );
276+ });
263277
264278 TextView tvVersion = dialog .findViewById (R .id .tvDialogVersion );
265279 TextView tvBeta = dialog .findViewById (R .id .tvDialogVersionBeta );
@@ -298,18 +312,20 @@ private void showSettingsDialog() {
298312 }
299313
300314 private void bindSettingsTab (
301- TextView tabUpdate , TextView tabSettings , TextView tabOptik , TextView tabCredits ,
302- View sectionUpdate , View sectionSettings , View sectionOptik , View sectionCredits ,
315+ TextView tabUpdate , TextView tabSettings , TextView tabSignalCamera , TextView tabOptik , TextView tabCredits ,
316+ View sectionUpdate , View sectionSettings , View sectionSignalCamera , View sectionOptik , View sectionCredits ,
303317 int active
304318 ) {
305319 sectionUpdate .setVisibility (active == 0 ? View .VISIBLE : View .GONE );
306320 sectionSettings .setVisibility (active == 1 ? View .VISIBLE : View .GONE );
307- sectionOptik .setVisibility (active == 2 ? View .VISIBLE : View .GONE );
308- sectionCredits .setVisibility (active == 3 ? View .VISIBLE : View .GONE );
321+ sectionSignalCamera .setVisibility (active == 2 ? View .VISIBLE : View .GONE );
322+ sectionOptik .setVisibility (active == 3 ? View .VISIBLE : View .GONE );
323+ sectionCredits .setVisibility (active == 4 ? View .VISIBLE : View .GONE );
309324 styleSettingsTab (tabUpdate , active == 0 );
310325 styleSettingsTab (tabSettings , active == 1 );
311- styleSettingsTab (tabOptik , active == 2 );
312- styleSettingsTab (tabCredits , active == 3 );
326+ styleSettingsTab (tabSignalCamera , active == 2 );
327+ styleSettingsTab (tabOptik , active == 3 );
328+ styleSettingsTab (tabCredits , active == 4 );
313329 }
314330
315331 private void styleSettingsTab (TextView tab , boolean active ) {
0 commit comments