feat: hide-shorts-button patch

This commit is contained in:
j4k0xb 2022-04-19 17:53:38 +02:00
parent f80db4f7c8
commit 145b3c063a
3 changed files with 18 additions and 0 deletions

View File

@ -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) {

View File

@ -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;

View File

@ -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);
}
}