Skip to content

Commit

Permalink
fix(YouTube Music): App crashes when including `Hide action bar compo…
Browse files Browse the repository at this point in the history
…nents` patch
  • Loading branch information
anddea committed Dec 23, 2024
1 parent 20beb64 commit e7646e2
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import androidx.annotation.NonNull;

import app.revanced.extension.music.settings.Settings;
import app.revanced.extension.music.utils.VideoUtils;

@SuppressWarnings("unused")
public class ActionBarPatch {
Expand Down Expand Up @@ -39,6 +40,15 @@ public static void hideLikeDislikeButton(View view) {
);
}

public static void inAppDownloadButtonOnClick(View view) {
if (!Settings.EXTERNAL_DOWNLOADER_ACTION_BUTTON.get()) {
return;
}

if (buttonType.equals(ActionButton.DOWNLOAD.name))
view.setOnClickListener(imageView -> VideoUtils.launchExternalDownloader());
}

public static void setButtonType(@NonNull Object obj) {
final String buttonType = obj.toString();

Expand Down

0 comments on commit e7646e2

Please sign in to comment.