Skip to content

Commit

Permalink
feat(YouTube/Video playback): add an option to disable toasts when ch…
Browse files Browse the repository at this point in the history
…anging the default values (#56)

* feat(YouTube/Default Quality & Speed): add an option to disable toasts when changing the default values

* feat: apply code review suggestions

---------

Co-authored-by: inotia00 <[email protected]>
  • Loading branch information
Francesco146 and inotia00 committed Aug 28, 2024
1 parent a8f6a9b commit fd20a60
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public static void userSelectedPlaybackSpeed(float playbackSpeed) {
return;

Settings.DEFAULT_PLAYBACK_SPEED.save(playbackSpeed);

if (!Settings.REMEMBER_PLAYBACK_SPEED_LAST_SELECTED_TOAST.get())
return;

showToastShort(str("revanced_remember_playback_speed_toast", playbackSpeed + "x"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ private static void userSelectedVideoQuality(final int defaultQuality) {
default -> wifiQualitySetting.save(defaultQuality);
}

if (!Settings.REMEMBER_VIDEO_QUALITY_LAST_SELECTED_TOAST.get())
return;

Utils.showToastShort(str("revanced_remember_video_quality_" + networkType.getName(), defaultQuality + "p"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,9 @@ public class Settings extends BaseSettings {
public static final BooleanSetting CUSTOM_PLAYBACK_SPEED_MENU_TYPE = new BooleanSetting("revanced_custom_playback_speed_menu_type", FALSE, parent(ENABLE_CUSTOM_PLAYBACK_SPEED));
public static final StringSetting CUSTOM_PLAYBACK_SPEEDS = new StringSetting("revanced_custom_playback_speeds", "0.25\n0.5\n0.75\n1.0\n1.25\n1.5\n1.75\n2.0\n2.25\n2.5", true, parent(ENABLE_CUSTOM_PLAYBACK_SPEED));
public static final BooleanSetting REMEMBER_PLAYBACK_SPEED_LAST_SELECTED = new BooleanSetting("revanced_remember_playback_speed_last_selected", TRUE);
public static final BooleanSetting REMEMBER_PLAYBACK_SPEED_LAST_SELECTED_TOAST = new BooleanSetting("revanced_remember_playback_speed_last_selected_toast", TRUE, parent(REMEMBER_PLAYBACK_SPEED_LAST_SELECTED));
public static final BooleanSetting REMEMBER_VIDEO_QUALITY_LAST_SELECTED = new BooleanSetting("revanced_remember_video_quality_last_selected", TRUE);
public static final BooleanSetting REMEMBER_VIDEO_QUALITY_LAST_SELECTED_TOAST = new BooleanSetting("revanced_remember_video_quality_last_selected_toast", TRUE, parent(REMEMBER_VIDEO_QUALITY_LAST_SELECTED));
public static final BooleanSetting RESTORE_OLD_VIDEO_QUALITY_MENU = new BooleanSetting("revanced_restore_old_video_quality_menu", TRUE, true);
// Experimental Flags
public static final BooleanSetting ENABLE_DEFAULT_PLAYBACK_SPEED_SHORTS = new BooleanSetting("revanced_enable_default_playback_speed_shorts", FALSE);
Expand Down

0 comments on commit fd20a60

Please sign in to comment.