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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/widget/PromoDialogLayout.java

Issue 2857893003: Replace search_sogou.png with a vector drawable (Closed)
Patch Set: Fix tests Created 3 years, 7 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
Index: chrome/android/java/src/org/chromium/chrome/browser/widget/PromoDialogLayout.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/PromoDialogLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/PromoDialogLayout.java
index 511566f0e4f17f70e2b1981c8daf88afc150e4d9..fca6a7e2380fe3b4eb74b215de4de434d47d3a09 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/widget/PromoDialogLayout.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/PromoDialogLayout.java
@@ -5,6 +5,7 @@
package org.chromium.chrome.browser.widget;
import android.content.Context;
+import android.support.graphics.drawable.VectorDrawableCompat;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
@@ -79,7 +80,7 @@ public final class PromoDialogLayout extends BoundedLinearLayout {
assert params.primaryButtonStringResource != 0;
mParams = params;
- if (mParams.drawableResource == 0) {
+ if (mParams.drawableResource == 0 && mParams.vectorDrawableResource == 0) {
// Dialogs with no illustration make the header stay visible at all times instead of
// scrolling off on small screens.
((ViewGroup) mIllustrationView.getParent()).removeView(mIllustrationView);
@@ -94,6 +95,9 @@ public final class PromoDialogLayout extends BoundedLinearLayout {
(MarginLayoutParams) mHeaderView.getLayoutParams(), marginSize);
ApiCompatibilityUtils.setMarginEnd(
(MarginLayoutParams) mHeaderView.getLayoutParams(), marginSize);
+ } else if (mParams.vectorDrawableResource != 0) {
+ mIllustrationView.setImageDrawable(VectorDrawableCompat.create(
+ getResources(), mParams.vectorDrawableResource, getContext().getTheme()));
} else {
mIllustrationView.setImageResource(mParams.drawableResource);
}

Powered by Google App Engine
This is Rietveld 408576698