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

Commit

Permalink
chore: lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
inotia00 committed Oct 18, 2024
1 parent 7df0903 commit cfb803b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static int hideCategoryBarInFeed(final int height) {

public static void hideCategoryBarInRelatedVideos(final View chipView) {
Utils.hideViewBy0dpUnderCondition(
Settings.HIDE_CATEGORY_BAR_IN_RELATED_VIDEOS.get(),
Settings.HIDE_CATEGORY_BAR_IN_RELATED_VIDEOS.get() || Settings.HIDE_RELATED_VIDEOS.get(),
chipView
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,9 @@ public static void confirmDialogAgeVerified(final AlertDialog dialog) {
// region [Spoof app version] patch

public static String getVersionOverride(String appVersion) {
if (!Settings.SPOOF_APP_VERSION.get())
return appVersion;

return Settings.SPOOF_APP_VERSION_TARGET.get();
return Settings.SPOOF_APP_VERSION.get()
? Settings.SPOOF_APP_VERSION_TARGET.get()
: appVersion;
}

// endregion
Expand Down Expand Up @@ -488,10 +487,12 @@ public static void hideYouTubeDoodles(ImageView imageView, Drawable drawable) {
}
}

private static final int settingsDrawableId = ResourceUtils.getDrawableIdentifier("yt_outline_gear_black_24");
private static final int settingsDrawableId =
ResourceUtils.getDrawableIdentifier("yt_outline_gear_black_24");

public static int getCreateButtonDrawableId(int original) {
return Settings.REPLACE_TOOLBAR_CREATE_BUTTON.get()
return Settings.REPLACE_TOOLBAR_CREATE_BUTTON.get() &&
settingsDrawableId != 0
? settingsDrawableId
: original;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ public class ToolBarPatch {

public static void hookToolBar(Enum<?> buttonEnum, ImageView imageView) {
final String enumString = buttonEnum.name();
if (enumString.isEmpty() || !(imageView.getParent() instanceof View view))
if (enumString.isEmpty() ||
imageView == null ||
!(imageView.getParent() instanceof View view)) {
return;
}

Logger.printDebug(() -> "enumString: " + enumString);

Expand Down

0 comments on commit cfb803b

Please sign in to comment.