Merge pull request #7 from j4k0xb/main

feat: `hide-shorts-button` patch
This commit is contained in:
oSumAtrIX 2022-04-19 18:25:57 +02:00 committed by GitHub
commit 7a988ba1f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);
}
}