mirror of
https://github.com/revanced/revanced-integrations.git
synced 2025-01-07 10:35:49 +01:00
refactor : simplify AdRemoverAPI.HideViewWithLayout1dp
(#240)
This commit is contained in:
parent
04a89af1c9
commit
a550d16c3f
@ -3,11 +3,6 @@ package app.revanced.integrations.adremover;
|
|||||||
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
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;
|
import app.revanced.integrations.utils.LogHelper;
|
||||||
|
|
||||||
public class AdRemoverAPI {
|
public class AdRemoverAPI {
|
||||||
@ -19,24 +14,12 @@ public class AdRemoverAPI {
|
|||||||
*/
|
*/
|
||||||
//ToDo: refactor this
|
//ToDo: refactor this
|
||||||
public static void HideViewWithLayout1dp(View view) {
|
public static void HideViewWithLayout1dp(View view) {
|
||||||
if (view instanceof LinearLayout) {
|
if (view instanceof ViewGroup) {
|
||||||
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(1, 1);
|
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(1, 1);
|
||||||
view.setLayoutParams(layoutParams);
|
view.setLayoutParams(layoutParams);
|
||||||
} else if (view instanceof FrameLayout) {
|
return;
|
||||||
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user