mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-12-25 12:15:49 +01:00
feat(youtube/swipe-controls): add option to save and restore brightness
This commit is contained in:
parent
4c77e7f3f7
commit
b5a71a843e
@ -168,6 +168,8 @@ public enum SettingsEnum {
|
|||||||
parents(SWIPE_BRIGHTNESS, SWIPE_VOLUME)),
|
parents(SWIPE_BRIGHTNESS, SWIPE_VOLUME)),
|
||||||
SWIPE_OVERLAY_TIMEOUT("revanced_swipe_overlay_timeout", LONG, 500L, true,
|
SWIPE_OVERLAY_TIMEOUT("revanced_swipe_overlay_timeout", LONG, 500L, true,
|
||||||
parents(SWIPE_BRIGHTNESS, SWIPE_VOLUME)),
|
parents(SWIPE_BRIGHTNESS, SWIPE_VOLUME)),
|
||||||
|
SWIPE_SAVE_AND_RESTORE_BRIGHTNESS("revanced_swipe_save_and_restore_brightness", BOOLEAN, TRUE, true,
|
||||||
|
parents(SWIPE_BRIGHTNESS, SWIPE_VOLUME)),
|
||||||
|
|
||||||
// Debugging
|
// Debugging
|
||||||
DEBUG("revanced_debug", BOOLEAN, FALSE),
|
DEBUG("revanced_debug", BOOLEAN, FALSE),
|
||||||
|
@ -45,7 +45,7 @@ class SwipeControlsConfigurationProvider(
|
|||||||
*/
|
*/
|
||||||
val overwriteVolumeKeyControls: Boolean
|
val overwriteVolumeKeyControls: Boolean
|
||||||
get() = isFullscreenVideo && enableVolumeControls
|
get() = isFullscreenVideo && enableVolumeControls
|
||||||
//endregioin
|
//endregion
|
||||||
|
|
||||||
//region gesture adjustments
|
//region gesture adjustments
|
||||||
/**
|
/**
|
||||||
@ -94,5 +94,15 @@ class SwipeControlsConfigurationProvider(
|
|||||||
val overlayForegroundColor: Int
|
val overlayForegroundColor: Int
|
||||||
get() = Color.WHITE
|
get() = Color.WHITE
|
||||||
|
|
||||||
|
//endregion
|
||||||
|
|
||||||
|
//region behaviour
|
||||||
|
|
||||||
|
/**
|
||||||
|
* should the brightness be saved and restored when exiting or entering fullscreen
|
||||||
|
*/
|
||||||
|
val shouldSaveAndRestoreBrightness: Boolean
|
||||||
|
get() = SettingsEnum.SWIPE_SAVE_AND_RESTORE_BRIGHTNESS.boolean
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
}
|
}
|
@ -168,6 +168,7 @@ class SwipeControlsHostActivity : Activity() {
|
|||||||
* @param type the new player type
|
* @param type the new player type
|
||||||
*/
|
*/
|
||||||
private fun onPlayerTypeChanged(type: PlayerType) {
|
private fun onPlayerTypeChanged(type: PlayerType) {
|
||||||
|
if (config.shouldSaveAndRestoreBrightness)
|
||||||
when (type) {
|
when (type) {
|
||||||
PlayerType.WATCH_WHILE_FULLSCREEN -> screen?.restore()
|
PlayerType.WATCH_WHILE_FULLSCREEN -> screen?.restore()
|
||||||
else -> {
|
else -> {
|
||||||
|
Loading…
Reference in New Issue
Block a user