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

Commit

Permalink
fix(YouTube/Description components): crash occurs when the title of t…
Browse files Browse the repository at this point in the history
…he engagement panel is null inotia00/ReVanced_Extended#2008
  • Loading branch information
inotia00 authored and anddea committed May 16, 2024
1 parent a25d7d7 commit e4ba2d0
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import androidx.coordinatorlayout.widget.CoordinatorLayout;

import java.lang.ref.WeakReference;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -76,12 +77,16 @@ public static boolean disableRollingNumberAnimations() {
* view id R.id.content
*/
private static final int contentId = ResourceUtils.getIdIdentifier("content");
private static final boolean expandDescriptionEnabled = Settings.EXPAND_VIDEO_DESCRIPTION.get();
private static final String descriptionString = Settings.EXPAND_VIDEO_DESCRIPTION_STRINGS.get();

private static boolean isDescriptionPanel = false;

public static void setContentDescription(String contentDescription) {
isDescriptionPanel = contentDescription.equals(descriptionString);
if (!expandDescriptionEnabled) {
return;
}
isDescriptionPanel = contentDescription != null && Objects.equals(descriptionString, contentDescription);
}

/**
Expand All @@ -91,7 +96,7 @@ public static void setContentDescription(String contentDescription) {


public static void onVideoDescriptionCreate(RecyclerView recyclerView) {
if (!Settings.EXPAND_VIDEO_DESCRIPTION.get())
if (!expandDescriptionEnabled)
return;

recyclerView.getViewTreeObserver().addOnDrawListener(() -> {
Expand Down

0 comments on commit e4ba2d0

Please sign in to comment.