Skip to content
This repository was archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
fix(YouTube - Toolbar components): Premium header not applied when `H…
Browse files Browse the repository at this point in the history
…ide YouTube Doodles` is turned on
  • Loading branch information
anddea committed Nov 10, 2024
1 parent 15dff30 commit e8e9923
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@ public static void setDrawerNavigationHeader(View lithoView) {
return;
if (!(viewGroup.getChildAt(0) instanceof ImageView imageView))
return;
final Activity mAcrivity = Utils.getActivity();
if (mAcrivity == null)
final Activity mActivity = Utils.getActivity();
if (mActivity == null)
return;
imageView.setImageDrawable(getHeaderDrawable(mAcrivity, headerAttributeId));
imageView.setImageDrawable(getHeaderDrawable(mActivity, headerAttributeId));
});
}

Expand Down Expand Up @@ -481,10 +481,18 @@ public static void hideVoiceSearchButton(View view, int visibility) {
}
}

/**
* In ReVanced, image files are replaced to change the header,
* Whereas in RVX, the header is changed programmatically.
* There is an issue where the header is not changed in RVX when YouTube Doodles are hidden.
* As a workaround, manually set the header when YouTube Doodles are hidden.
*/
public static void hideYouTubeDoodles(ImageView imageView, Drawable drawable) {
if (!Settings.HIDE_YOUTUBE_DOODLES.get()) {
imageView.setImageDrawable(drawable);
final Activity mActivity = Utils.getActivity();
if (Settings.HIDE_YOUTUBE_DOODLES.get() && mActivity != null) {
drawable = getHeaderDrawable(mActivity, getHeaderAttributeId());
}
imageView.setImageDrawable(drawable);
}

private static final int settingsDrawableId =
Expand Down

0 comments on commit e8e9923

Please sign in to comment.