Skip to content

Commit

Permalink
Merge pull request #5882 from brave/empty_ntp_fix_dp
Browse files Browse the repository at this point in the history
Update NewTabPageView  to fix the issue with empty tiles
  • Loading branch information
deeppandya authored Jun 17, 2020
2 parents 7321bc4 + 7eae647 commit d15e9ad
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ protected void onAttachedToWindow() {
super.onAttachedToWindow();
if (sponsoredTab == null)
initilizeSponsoredTab();
if (mNewTabPageLayout != null && mNewTabPageLayout.getPlaceholder() != null) {
mNewTabPageLayout.getPlaceholder().setVisibility(View.GONE);
}
checkAndShowNTPImage(false);
mNTPBackgroundImagesBridge.addObserver(mNTPBackgroundImageServiceObserver);
}
Expand Down Expand Up @@ -419,15 +422,14 @@ protected void onPostExecute(Void result) {
private NTPBackgroundImagesBridge.NTPBackgroundImageServiceObserver mNTPBackgroundImageServiceObserver = new NTPBackgroundImagesBridge.NTPBackgroundImageServiceObserver() {
@Override
public void onUpdated() {
checkAndShowNTPImage(true);
if (mNewTabPageLayout != null && mNewTabPageLayout.getPlaceholder() != null) {
mNewTabPageLayout.getPlaceholder().setVisibility(View.GONE);
if (NTPUtil.isReferralEnabled()) {
checkAndShowNTPImage(true);
((BraveNewTabPageLayout)mNewTabPageLayout).removeDefaultTopSites();
if (mNTPBackgroundImagesBridge.isSuperReferral()
&& NTPBackgroundImagesBridge.enableSponsoredImages()
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
mNTPBackgroundImagesBridge.getTopSites();
}
((BraveNewTabPageLayout)mNewTabPageLayout).removeDefaultTopSites();
if (mNTPBackgroundImagesBridge.isSuperReferral()
&& NTPBackgroundImagesBridge.enableSponsoredImages()
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
mNTPBackgroundImagesBridge.getTopSites();
}
};

Expand Down

0 comments on commit d15e9ad

Please sign in to comment.