Skip to content

Commit

Permalink
Fix hotDealContent
Browse files Browse the repository at this point in the history
  • Loading branch information
Chipppppppppp committed Mar 7, 2024
1 parent 9591169 commit 12c8c2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/src/main/java/io/github/chipppppppppp/lime/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
int recommendationResId = context.getResources().getIdentifier("home_tab_contents_recommendation_placement", "id", context.getPackageName());
int staticNotificationResId = context.getResources().getIdentifier("notification_hub_row_static_view_group", "id", context.getPackageName());
int rollingNotificationResId = context.getResources().getIdentifier("notification_hub_row_rolling_view_group", "id", context.getPackageName());
int hotDealContentRecyclerviewResId = context.getResources().getIdentifier("hot_deal_content_recycler_view", "id", context.getPackageName());
int hotDealContentResId = context.getResources().getIdentifier("hot_deal_content_recycler_view", "id", context.getPackageName());

ViewGroup recyclerView = view.findViewById(recyclerViewResId);
recyclerView.getViewTreeObserver().addOnScrollChangedListener(new ViewTreeObserver.OnScrollChangedListener() {
Expand All @@ -412,16 +412,16 @@ public void onScrollChanged() {
for (int i = 0; i < recyclerView.getChildCount(); ++i) {
View child = recyclerView.getChildAt(i);
if (limeOptions.deleteRecommendation.checked && child.getId() == recommendationResId) {
child.setVisibility(View.GONE);
Utils.hideView(child);
ViewGroup.LayoutParams layoutParams = child.getLayoutParams();
layoutParams.height = 0;
child.setLayoutParams(layoutParams);
} else if (limeOptions.deleteAds.checked && child instanceof ViewGroup) {
ViewGroup childGroup = (ViewGroup) child;
for (int j = 0; j < childGroup.getChildCount(); ++j) {
int id = childGroup.getChildAt(j).getId();
if (id == staticNotificationResId || id == rollingNotificationResId || id == hotDealContentRecyclerviewResId) {
child.setVisibility(View.GONE);
if (id == staticNotificationResId || id == rollingNotificationResId || id == hotDealContentResId) {
Utils.hideView(child);
ViewGroup.LayoutParams layoutParams = child.getLayoutParams();
layoutParams.height = 0;
child.setLayoutParams(layoutParams);
Expand Down

0 comments on commit 12c8c2c

Please sign in to comment.