Skip to content

Commit

Permalink
Uplift of #17012 (squashed) to release
Browse files Browse the repository at this point in the history
  • Loading branch information
brave-builds committed Feb 3, 2023
1 parent 9ed2f94 commit c87f7fd
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ public int getItemCount() {
int statsCount = getStatsCount();
int topSitesCount = getTopSitesCount();
int newsLoadingCount = shouldDisplayNewsLoading() ? 1 : 0;

if (mIsDisplayNewsOptin) {
return statsCount + topSitesCount + TWO_ITEMS_SPACE + newsLoadingCount;
} else if (mIsDisplayNews) {
Expand Down Expand Up @@ -468,6 +467,11 @@ public int getTopMarginImageCredit() {

public void setNewsLoading(boolean isNewsLoading) {
mIsNewsLoading = isNewsLoading;
if (isNewsLoading) {
notifyItemInserted(getStatsCount() + getTopSitesCount() + ONE_ITEM_SPACE);
} else {
notifyItemRemoved(getStatsCount() + getTopSitesCount() + ONE_ITEM_SPACE);
}
notifyItemRangeChanged(getStatsCount() + getTopSitesCount(), TWO_ITEMS_SPACE);
}

Expand Down

0 comments on commit c87f7fd

Please sign in to comment.