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

Commit

Permalink
fix(YouTube Music): The app crashes on older clients
Browse files Browse the repository at this point in the history
  • Loading branch information
anddea committed Jun 23, 2024
1 parent a8ad2aa commit 2a781c4
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public static void hideViewUnderCondition(BooleanSetting condition, View view) {
*/
public static void hideViewUnderCondition(boolean condition, View view) {
if (!condition) return;
if (view == null) return;

view.setVisibility(View.GONE);
}
Expand Down Expand Up @@ -539,6 +540,8 @@ public static NetworkType getNetworkType() {
* @param view The view to hide.
*/
public static void hideViewByLayoutParams(View view) {
if (view == null) return;

if (view instanceof LinearLayout) {
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(0, 0);
view.setLayoutParams(layoutParams);
Expand Down

0 comments on commit 2a781c4

Please sign in to comment.