mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-11-17 17:39:36 +01:00
Merge pull request #7 from j4k0xb/main
feat: `hide-shorts-button` patch
This commit is contained in:
commit
7a988ba1f3
@ -178,6 +178,19 @@ public class XAdRemover {
|
||||
}
|
||||
}
|
||||
|
||||
public static void hideShortsButton(View view) {
|
||||
if (XGlobals.lastPivotTab != null && XGlobals.lastPivotTab.name() == "TAB_SHORTS") {
|
||||
if (BooleanPreferences.isShortsButtonHidden()) {
|
||||
if (XGlobals.debug) {
|
||||
Log.d("XAdRemover", "Shorts button: shown");
|
||||
}
|
||||
view.setVisibility(View.GONE);
|
||||
} else if (XGlobals.debug) {
|
||||
Log.d("XAdRemover", "Shorts button: hidden");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void inspectComponentHost(Object item) {
|
||||
StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
|
||||
if (stackTraceElements.length <= 3) {
|
||||
|
@ -152,6 +152,7 @@ public class XGlobals {
|
||||
public static Integer maxBuffer = 120000;
|
||||
public static Integer playbackMS = 2500;
|
||||
public static Integer reBuffer = 5000;
|
||||
public static Enum lastPivotTab;
|
||||
|
||||
public static void ReadSettings() {
|
||||
Context context;
|
||||
|
@ -19,4 +19,8 @@ public class BooleanPreferences {
|
||||
public static boolean isCreateButtonHidden() {
|
||||
return SharedPrefs.getBoolean(Objects.requireNonNull(YouTubeTikTokRoot_Application.getAppContext()), "xfile_create_button_hidden", true);
|
||||
}
|
||||
|
||||
public static boolean isShortsButtonHidden() {
|
||||
return SharedPrefs.getBoolean(Objects.requireNonNull(YouTubeTikTokRoot_Application.getAppContext()), "xfile_shorts_button_hidden", true);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user