Skip to content

Commit

Permalink
Uplift of #16890 (squashed) to beta
Browse files Browse the repository at this point in the history
  • Loading branch information
brave-builds committed Jan 29, 2023
1 parent 9f855b0 commit 2aaaa5f
Showing 1 changed file with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,19 +397,22 @@ private void setNtpRecyclerView(LinearLayoutManager linearLayoutManager) {
mIsBraveStatsEnabled = shouldDisplayBraveStats();

if (mNtpAdapter == null) {
mNtpAdapter = new BraveNtpAdapter(mActivity, this, Glide.with(mActivity),
mNewsItemsFeedCard, mBraveNewsController, mMvTilesContainerLayout,
mNtpImageGlobal, mSponsoredTab, mWallpaper, mSponsoredLogo,
mNTPBackgroundImagesBridge, false, mRecyclerView.getHeight(),
mIsTopSitesEnabled, mIsBraveStatsEnabled, mIsDisplayNews, mIsDisplayNewsOptin);

mRecyclerView.setAdapter(mNtpAdapter);

if (mRecyclerView.getItemAnimator() != null) {
RecyclerView.ItemAnimator itemAnimator = mRecyclerView.getItemAnimator();
if (itemAnimator instanceof SimpleItemAnimator) {
SimpleItemAnimator simpleItemAnimator = (SimpleItemAnimator) itemAnimator;
simpleItemAnimator.setSupportsChangeAnimations(false);
if (mActivity != null && !mActivity.isDestroyed() && !mActivity.isFinishing()) {
mNtpAdapter = new BraveNtpAdapter(mActivity, this, Glide.with(mActivity),
mNewsItemsFeedCard, mBraveNewsController, mMvTilesContainerLayout,
mNtpImageGlobal, mSponsoredTab, mWallpaper, mSponsoredLogo,
mNTPBackgroundImagesBridge, false, mRecyclerView.getHeight(),
mIsTopSitesEnabled, mIsBraveStatsEnabled, mIsDisplayNews,
mIsDisplayNewsOptin);

mRecyclerView.setAdapter(mNtpAdapter);

if (mRecyclerView.getItemAnimator() != null) {
RecyclerView.ItemAnimator itemAnimator = mRecyclerView.getItemAnimator();
if (itemAnimator instanceof SimpleItemAnimator) {
SimpleItemAnimator simpleItemAnimator = (SimpleItemAnimator) itemAnimator;
simpleItemAnimator.setSupportsChangeAnimations(false);
}
}
}
} else {
Expand Down

0 comments on commit 2aaaa5f

Please sign in to comment.