Skip to content

Commit 1098e57

Browse files
committed
screen dimming: suppress screensaver fix
1 parent b6241d7 commit 1098e57

File tree

2 files changed

+32
-78
lines changed

2 files changed

+32
-78
lines changed

common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/settings/GeneralSettingsPresenter.java

Lines changed: 29 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -544,17 +544,9 @@ private void appendHistoryCategory(AppDialogPresenter settingsPresenter) {
544544
private void appendMiscCategory(AppDialogPresenter settingsPresenter) {
545545
List<OptionItem> options = new ArrayList<>();
546546

547-
options.add(UiOptionItem.from( getContext().getString(R.string.player_exit_shortcut) + ": " + getContext().getString(R.string.app_double_back_exit),
548-
option -> mGeneralData.setPlayerExitShortcut(option.isSelected() ? GeneralData.EXIT_DOUBLE_BACK : GeneralData.EXIT_SINGLE_BACK),
549-
mGeneralData.getPlayerExitShortcut() == GeneralData.EXIT_DOUBLE_BACK));
550-
551-
options.add(UiOptionItem.from(getContext().getString(R.string.search_exit_shortcut) + ": " + getContext().getString(R.string.app_double_back_exit),
552-
option -> mGeneralData.setSearchExitShortcut(option.isSelected() ? GeneralData.EXIT_DOUBLE_BACK : GeneralData.EXIT_SINGLE_BACK),
553-
mGeneralData.getSearchExitShortcut() == GeneralData.EXIT_DOUBLE_BACK));
554-
555-
options.add(UiOptionItem.from(getContext().getString(R.string.return_to_launcher),
556-
option -> mGeneralData.setReturnToLauncherEnabled(option.isSelected()),
557-
mGeneralData.isReturnToLauncherEnabled()));
547+
options.add(UiOptionItem.from(getContext().getString(R.string.disable_screensaver),
548+
option -> mGeneralData.setScreensaverDisabled(option.isSelected()),
549+
mGeneralData.isScreensaverDisabled()));
558550

559551
options.add(UiOptionItem.from(getContext().getString(R.string.multi_profiles),
560552
option -> {
@@ -563,21 +555,6 @@ private void appendMiscCategory(AppDialogPresenter settingsPresenter) {
563555
},
564556
AppPrefs.instance(getContext()).isMultiProfilesEnabled()));
565557

566-
options.add(UiOptionItem.from(getContext().getString(R.string.child_mode),
567-
getContext().getString(R.string.child_mode_desc),
568-
option -> {
569-
if (option.isSelected()) {
570-
AppDialogUtil.showConfirmationDialog(getContext(), getContext().getString(R.string.lost_setting_warning),
571-
() -> showPasswordDialog(settingsPresenter, () -> enableChildMode(option.isSelected())),
572-
settingsPresenter::closeDialog);
573-
} else {
574-
mGeneralData.setSettingsPassword(null);
575-
enableChildMode(option.isSelected());
576-
settingsPresenter.closeDialog();
577-
}
578-
},
579-
mGeneralData.isChildModeEnabled()));
580-
581558
options.add(UiOptionItem.from(getContext().getString(R.string.protect_settings_with_password),
582559
option -> {
583560
if (option.isSelected()) {
@@ -598,41 +575,32 @@ private void appendMiscCategory(AppDialogPresenter settingsPresenter) {
598575
},
599576
mGeneralData.getMasterPassword() != null));
600577

601-
//options.add(UiOptionItem.from(getContext().getString(R.string.app_corner_clock),
602-
// option -> {
603-
// mGeneralData.enableGlobalClock(option.isSelected());
604-
// mRestartApp = true;
605-
// },
606-
// mGeneralData.isGlobalClockEnabled()));
607-
//
608-
//options.add(UiOptionItem.from(getContext().getString(R.string.player_corner_clock),
609-
// option -> mPlayerData.enableGlobalClock(option.isSelected()),
610-
// mPlayerData.isGlobalClockEnabled()));
611-
//
612-
//options.add(UiOptionItem.from(getContext().getString(R.string.player_corner_ending_time),
613-
// option -> mPlayerData.enableGlobalEndingTime(option.isSelected()),
614-
// mPlayerData.isGlobalEndingTimeEnabled()));
615-
//
616-
//options.add(UiOptionItem.from(getContext().getString(R.string.old_home_look),
617-
// option -> {
618-
// mGeneralData.enableOldHomeLook(option.isSelected());
619-
// mRestartApp = true;
620-
// },
621-
// mGeneralData.isOldHomeLookEnabled()));
622-
//
623-
//options.add(UiOptionItem.from(getContext().getString(R.string.old_channel_look),
624-
// option -> {
625-
// mGeneralData.enableOldChannelLook(option.isSelected());
626-
// mMainUIData.enableChannelSearchBar(!option.isSelected());
627-
// },
628-
// mGeneralData.isOldChannelLookEnabled()));
629-
//
630-
//options.add(UiOptionItem.from(getContext().getString(R.string.fullscreen_mode),
631-
// option -> {
632-
// mGeneralData.enableFullscreenMode(option.isSelected());
633-
// mRestartApp = true;
634-
// },
635-
// mGeneralData.isFullscreenModeEnabled()));
578+
options.add(UiOptionItem.from(getContext().getString(R.string.child_mode),
579+
getContext().getString(R.string.child_mode_desc),
580+
option -> {
581+
if (option.isSelected()) {
582+
AppDialogUtil.showConfirmationDialog(getContext(), getContext().getString(R.string.lost_setting_warning),
583+
() -> showPasswordDialog(settingsPresenter, () -> enableChildMode(option.isSelected())),
584+
settingsPresenter::closeDialog);
585+
} else {
586+
mGeneralData.setSettingsPassword(null);
587+
enableChildMode(option.isSelected());
588+
settingsPresenter.closeDialog();
589+
}
590+
},
591+
mGeneralData.isChildModeEnabled()));
592+
593+
options.add(UiOptionItem.from( getContext().getString(R.string.player_exit_shortcut) + ": " + getContext().getString(R.string.app_double_back_exit),
594+
option -> mGeneralData.setPlayerExitShortcut(option.isSelected() ? GeneralData.EXIT_DOUBLE_BACK : GeneralData.EXIT_SINGLE_BACK),
595+
mGeneralData.getPlayerExitShortcut() == GeneralData.EXIT_DOUBLE_BACK));
596+
597+
options.add(UiOptionItem.from(getContext().getString(R.string.search_exit_shortcut) + ": " + getContext().getString(R.string.app_double_back_exit),
598+
option -> mGeneralData.setSearchExitShortcut(option.isSelected() ? GeneralData.EXIT_DOUBLE_BACK : GeneralData.EXIT_SINGLE_BACK),
599+
mGeneralData.getSearchExitShortcut() == GeneralData.EXIT_DOUBLE_BACK));
600+
601+
options.add(UiOptionItem.from(getContext().getString(R.string.return_to_launcher),
602+
option -> mGeneralData.setReturnToLauncherEnabled(option.isSelected()),
603+
mGeneralData.isReturnToLauncherEnabled()));
636604

637605
options.add(UiOptionItem.from(getContext().getString(R.string.remember_position_subscriptions),
638606
option -> mGeneralData.setRememberSubscriptionsPositionEnabled(option.isSelected()),
@@ -642,26 +610,10 @@ private void appendMiscCategory(AppDialogPresenter settingsPresenter) {
642610
option -> mGeneralData.setRememberPinnedPositionEnabled(option.isSelected()),
643611
mGeneralData.isRememberPinnedPositionEnabled()));
644612

645-
options.add(UiOptionItem.from(getContext().getString(R.string.disable_screensaver),
646-
option -> mGeneralData.setScreensaverDisabled(option.isSelected()),
647-
mGeneralData.isScreensaverDisabled()));
648-
649613
options.add(UiOptionItem.from(getContext().getString(R.string.select_channel_section),
650614
option -> mGeneralData.setSelectChannelSectionEnabled(option.isSelected()),
651615
mGeneralData.isSelectChannelSectionEnabled()));
652616

653-
//options.add(UiOptionItem.from(getContext().getString(R.string.player_show_tooltips) + ": " + getContext().getString(R.string.long_press_for_options),
654-
// option -> {
655-
// mGeneralData.enableFirstUseTooltip(option.isSelected());
656-
// mRestartApp = true;
657-
// },
658-
// mGeneralData.isFirstUseTooltipEnabled()));
659-
660-
//// Disable long press on buggy controllers.
661-
//options.add(UiOptionItem.from(getContext().getString(R.string.disable_ok_long_press),
662-
// option -> mGeneralData.disableOkButtonLongPress(option.isSelected()),
663-
// mGeneralData.isOkButtonLongPressDisabled()));
664-
665617
settingsPresenter.appendCheckedCategory(getContext().getString(R.string.player_other), options);
666618
}
667619

common/src/main/java/com/liskovsoft/smartyoutubetv2/common/misc/ScreensaverManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ public void doScreenOff() {
137137
// return;
138138
//}
139139

140-
disable();
140+
// NOTE: disable will create infinite loop
141+
//disable();
141142
mMode = MODE_SCREEN_OFF;
143+
Utils.removeCallbacks(mUndimScreen);
142144
Utils.postDelayed(mDimScreen, 0);
143145
}
144146

0 commit comments

Comments
 (0)