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

Commit 996434c

Browse files
author
OxrxL
authored
fix: quick quality list flyout view visibility in old-quality-layout patch (#86)
1 parent 5549b95 commit 996434c

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

app/src/main/java/app/revanced/integrations/patches/OldQualityLayoutPatch.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package app.revanced.integrations.patches;
22

3-
import android.os.Handler;
4-
import android.os.Looper;
3+
import android.graphics.Color;
4+
import android.graphics.drawable.ColorDrawable;
55
import android.util.Log;
66
import android.view.View;
77
import android.view.ViewGroup;
8+
import android.view.Window;
89
import android.widget.ListView;
910
import android.widget.RelativeLayout;
1011

@@ -14,16 +15,27 @@
1415
import app.revanced.integrations.utils.LogHelper;
1516

1617
public class OldQualityLayoutPatch {
17-
// TODO: hide listView, OnHierarchyChange will not be triggered though
18+
public static Window window;
19+
private static boolean hideWindow = true;
20+
1821
public static void showOldQualityMenu(ListView listView)
1922
{
2023
if (!SettingsEnum.OLD_STYLE_QUALITY_SETTINGS.getBoolean()) return;
2124

25+
hideWindow = true;
26+
2227
listView.setOnHierarchyChangeListener(new ViewGroup.OnHierarchyChangeListener() {
2328
@Override
2429
public void onChildViewAdded(View parent, View child) {
2530
LogHelper.debug(OldQualityLayoutPatch.class, "Added: " + child);
2631

32+
parent.setVisibility(View.GONE);
33+
if (window != null && hideWindow) {
34+
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
35+
36+
hideWindow = false;
37+
}
38+
2739
final var indexOfAdvancedQualityMenuItem = 4;
2840
if (listView.indexOfChild(child) != indexOfAdvancedQualityMenuItem) return;
2941

0 commit comments

Comments
 (0)