Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the error on SI for japan region #5908

Merged
merged 1 commit into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -362,27 +362,6 @@ private void initilizeSponsoredTab() {
mNTPBackgroundImagesBridge.getTopSites();
}

private TabObserver mTabObserver = new EmptyTabObserver() {
@Override
public void onInteractabilityChanged(Tab tab, boolean interactable) {
// Force a layout update if the tab is now in the foreground.
if (interactable) {
if (sponsoredTab == null)
initilizeSponsoredTab();
if (!sponsoredTab.isMoreTabs()) {
checkAndShowNTPImage(false);
}
} else {
if (!isFromBottomSheet) {
mNewTabPageLayout.setBackgroundResource(0);
if (imageDrawable != null && imageDrawable.getBitmap() != null && !imageDrawable.getBitmap().isRecycled()) {
imageDrawable.getBitmap().recycle();
}
}
}
}
};

private NewTabPageListener newTabPageListener = new NewTabPageListener() {
@Override
public void updateInteractableFlag(boolean isBottomSheet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ public static Bitmap getCalculatedBitmap(Bitmap imageBitmap, float centerPointX,
}

imageBitmap = Bitmap.createScaledBitmap(imageBitmap, newImageWidth, newImageHeight, true);

Bitmap newBitmap = Bitmap.createBitmap(imageBitmap, startX, startY, layoutWidth, (int) layoutHeight);
Bitmap newBitmap = Bitmap.createBitmap(imageBitmap, (startX + layoutWidth) <= imageBitmap.getWidth() ? startX : 0, (startY + (int) layoutHeight) <= imageBitmap.getHeight() ? startY : 0, layoutWidth, (int) layoutHeight);
Bitmap bitmapWithGradient = ImageUtils.addGradient(newBitmap);

imageBitmap.recycle();
Expand Down