Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4812)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerView.java

Issue 231273003: App install alert button fixes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing comment. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/res/values/dimens.xml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerView.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerView.java b/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerView.java
index e5f7fde9a514f6d2d473b35956b69ba082e1c327..fe830b045435e2d727e15fd2bdf13ba11257c2eb 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerView.java
@@ -296,7 +296,7 @@ public class AppBannerView extends SwipableOverlayView
PackageManager packageManager = getContext().getPackageManager();
Intent appIntent = packageManager.getLaunchIntentForPackage(packageName);
try {
- getContext().startActivity(appIntent);
+ if (appIntent != null) getContext().startActivity(appIntent);
} catch (ActivityNotFoundException e) {
Log.e(TAG, "Failed to find app package: " + packageName);
}
@@ -634,9 +634,14 @@ public class AppBannerView extends SwipableOverlayView
final int contentWidth =
maxControlWidth - getWidthWithMargins(mIconView) - mPaddingControls;
final int contentHeight = biggestStackHeight - mPaddingControls;
- measureChildForSpace(mInstallButtonView, contentWidth, contentHeight);
measureChildForSpace(mLogoView, contentWidth, contentHeight);
+ // Restrict the button size to prevent overrunning the Google Play logo.
+ int remainingButtonWidth =
+ maxControlWidth - getWidthWithMargins(mLogoView) - getWidthWithMargins(mIconView);
+ mInstallButtonView.setMaxWidth(remainingButtonWidth);
+ measureChildForSpace(mInstallButtonView, contentWidth, contentHeight);
+
// Measure the star rating, which sits below the title and above the logo.
final int ratingWidth = contentWidth;
final int ratingHeight = contentHeight - getHeightWithMargins(mLogoView);
« no previous file with comments | « chrome/android/java/res/values/dimens.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698