Skip to content

Commit 81f1adf

Browse files
remove toast string that can never be reached
1 parent efccd0b commit 81f1adf

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

extensions/youtube/src/main/java/app/revanced/extension/youtube/swipecontrols/SwipeControlsConfigurationProvider.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,12 @@ class SwipeControlsConfigurationProvider {
124124
val color = Color.parseColor(setting.get())
125125
return (0xBF000000.toInt() or (color and 0xFFFFFF))
126126
} catch (ex: IllegalArgumentException) {
127-
Logger.printDebug({ "Could not parse brightness color" }, ex)
128-
Utils.showToastLong(str("revanced_swipe_overlay_progress_color_invalid_toast"))
127+
// This code should never be reached.
128+
// Color picker rejects and will not save bad colors to a setting.
129+
// If a user imports bad data, the color picker preference resets the
130+
// bad color before this method can be called.
131+
Logger.printDebug({ "Could not parse color: $setting" }, ex)
132+
Utils.showToastLong(str("revanced_settings_color_invalid"))
129133
setting.resetToDefault()
130134
return getSettingColor(setting) // Recursively return.
131135
}
@@ -162,6 +166,7 @@ class SwipeControlsConfigurationProvider {
162166
* @property isCircular Indicates whether the style uses a circular progress bar.
163167
* @property isVertical Indicates whether the style uses a vertical progress bar.
164168
*/
169+
@Suppress("unused")
165170
enum class SwipeOverlayStyle(
166171
val isMinimal: Boolean = false,
167172
val isHorizontalMinimalCenter: Boolean = false,

patches/src/main/resources/addresources/values/strings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,6 @@ Adjust volume by swiping vertically on the right side of the screen"</string>
543543
<string name="revanced_swipe_overlay_progress_brightness_color_summary">The color of the progress bar for brightness controls</string>
544544
<string name="revanced_swipe_overlay_progress_volume_color_title">Swipe overlay volume color</string>
545545
<string name="revanced_swipe_overlay_progress_volume_color_summary">The color of the progress bar for volume controls</string>
546-
<string name="revanced_swipe_overlay_progress_color_invalid_toast">Invalid progress bar color</string>
547546
<string name="revanced_swipe_text_overlay_size_title">Swipe overlay text size</string>
548547
<string name="revanced_swipe_text_overlay_size_summary">The text size for swipe overlay between 1-30</string>
549548
<string name="revanced_swipe_text_overlay_size_invalid_toast">The text size must be between 1-30</string>

0 commit comments

Comments
 (0)