whatsnew block hide

This commit is contained in:
gdlbo
2022-07-21 12:24:09 +03:00
parent 22795bab81
commit 2aa7862fe1
3 changed files with 23 additions and 0 deletions
@@ -13,13 +13,20 @@ import static ru.vtosters.lite.utils.Newsfeed.isMusicBlock;
import static ru.vtosters.lite.utils.Newsfeed.isNewsBlock;
import static ru.vtosters.lite.utils.Newsfeed.isPostRecommendations;
import static ru.vtosters.lite.utils.Newsfeed.isRecomsGroup;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import static ru.vtosters.lite.utils.Preferences.vkme;
import android.view.View;
import android.view.ViewGroup;
import com.vk.core.preference.Preference;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class NewsfeedHook{
public static boolean injectFilters(JSONObject obj) throws JSONException{
var optString = obj.optString("type", "");
@@ -59,4 +66,11 @@ public class NewsfeedHook{
return Preference.b().getLong(refresh_timeout ? "refresh_timeout_top" : "refresh_timeout_recent", 600000L);
}
}
public static List hideElement(ArrayList list){
if (!getBoolValue("whatsnew", true)) {
list.clear();
}
return list;
}
}