Skip to content

Commit

Permalink
fix: revert semantically incorrect simplification of ˋAdRemoverAPI.Hi…
Browse files Browse the repository at this point in the history
…deViewWithLayout1dpˋ (#244)
  • Loading branch information
oSumAtrIX committed Dec 21, 2022
1 parent 5839f6c commit 71e81a6
Showing 1 changed file with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Toolbar;

import app.revanced.integrations.utils.LogHelper;

public class AdRemoverAPI {
Expand All @@ -14,12 +19,24 @@ public class AdRemoverAPI {
*/
//ToDo: refactor this
public static void HideViewWithLayout1dp(View view) {
if (view instanceof ViewGroup) {
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(1, 1);
if (view instanceof LinearLayout) {
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(1, 1);
view.setLayoutParams(layoutParams);
return;
} else if (view instanceof FrameLayout) {
FrameLayout.LayoutParams layoutParams2 = new FrameLayout.LayoutParams(1, 1);
view.setLayoutParams(layoutParams2);
} else if (view instanceof RelativeLayout) {
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(1, 1);
view.setLayoutParams(layoutParams3);
} else if (view instanceof Toolbar) {
Toolbar.LayoutParams layoutParams4 = new Toolbar.LayoutParams(1, 1);
view.setLayoutParams(layoutParams4);
} else if (view instanceof ViewGroup) {
ViewGroup.LayoutParams layoutParams5 = new ViewGroup.LayoutParams(1, 1);
view.setLayoutParams(layoutParams5);
} else {
LogHelper.printDebug(() -> "HideViewWithLayout1dp - Id: " + view.getId() + " Type: " + view.getClass().getName());
}
LogHelper.printDebug(
() -> "HideViewWithLayout1dp - Id: " + view.getId() + " Type: " + view.getClass().getName());
}

}

0 comments on commit 71e81a6

Please sign in to comment.