This repository has been archived by the owner on Oct 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
40 additions
and
11 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
app/src/main/java/app/revanced/integrations/patches/OldQualityLayoutPatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package app.revanced.integrations.patches; | ||
|
||
import android.os.Handler; | ||
import android.os.Looper; | ||
import android.util.Log; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.ListView; | ||
import android.widget.RelativeLayout; | ||
|
||
import java.util.Arrays; | ||
|
||
import app.revanced.integrations.settings.SettingsEnum; | ||
import app.revanced.integrations.utils.LogHelper; | ||
|
||
public class OldQualityLayoutPatch { | ||
// TODO: hide listView, OnHierarchyChange will not be triggered though | ||
public static void showOldQualityMenu(ListView listView) | ||
{ | ||
if (!SettingsEnum.OLD_STYLE_QUALITY_SETTINGS.getBoolean()) return; | ||
|
||
listView.setOnHierarchyChangeListener(new ViewGroup.OnHierarchyChangeListener() { | ||
@Override | ||
public void onChildViewAdded(View parent, View child) { | ||
LogHelper.debug(OldQualityLayoutPatch.class, "Added: " + child); | ||
|
||
final var indexOfAdvancedQualityMenuItem = 4; | ||
if (listView.indexOfChild(child) != indexOfAdvancedQualityMenuItem) return; | ||
|
||
LogHelper.debug(OldQualityLayoutPatch.class, "Found advanced menu: " + child); | ||
|
||
final var qualityItemMenuPosition = 4; | ||
listView.performItemClick(null, qualityItemMenuPosition, 0); | ||
} | ||
|
||
@Override | ||
public void onChildViewRemoved(View parent, View child) {} | ||
}); | ||
} | ||
} |
11 changes: 0 additions & 11 deletions
11
app/src/main/java/app/revanced/integrations/patches/OldStyleQualityPatch.java
This file was deleted.
Oops, something went wrong.