generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(YouTube - Force original audio): If stream spoofing to Android th…
…en show a summary text why force audio is not available (#4220)
- Loading branch information
1 parent
56ce9db
commit 029aee8
Showing
6 changed files
with
65 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...youtube/src/main/java/app/revanced/extension/youtube/patches/ForceOriginalAudioPatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...pp/revanced/extension/youtube/settings/preference/ForceOriginalAudioSwitchPreference.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package app.revanced.extension.youtube.settings.preference; | ||
|
||
import static app.revanced.extension.shared.StringRef.str; | ||
|
||
import android.content.Context; | ||
import android.preference.SwitchPreference; | ||
import android.util.AttributeSet; | ||
|
||
import app.revanced.extension.youtube.patches.ForceOriginalAudioPatch; | ||
|
||
@SuppressWarnings({"deprecation", "unused"}) | ||
public class ForceOriginalAudioSwitchPreference extends SwitchPreference { | ||
|
||
{ | ||
if (!ForceOriginalAudioPatch.PATCH_AVAILABLE) { | ||
// Show why force audio is not available. | ||
String summary = str("revanced_force_original_audio_not_available"); | ||
setSummary(summary); | ||
setSummaryOn(summary); | ||
setSummaryOff(summary); | ||
} | ||
} | ||
|
||
public ForceOriginalAudioSwitchPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { | ||
super(context, attrs, defStyleAttr, defStyleRes); | ||
} | ||
public ForceOriginalAudioSwitchPreference(Context context, AttributeSet attrs, int defStyleAttr) { | ||
super(context, attrs, defStyleAttr); | ||
} | ||
public ForceOriginalAudioSwitchPreference(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
} | ||
public ForceOriginalAudioSwitchPreference(Context context) { | ||
super(context); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters