Commit 97832b23 authored by Liquan (Max) Gu's avatar Liquan (Max) Gu Committed by Commit Bot

//components payment template not to depend on //chrome resources

Context:
Currently, //components payment targets depends on //chrome resources
ic_edit_24dp.png, product_logo_name.png, fre_product_logo.png. It's
because the payment view templates depend on them. This CL is written
to break the dependencies.

Changes:
* this CL changes to set fre_product_logo and product_logo_name
programmatically from //chrome, from having them referenced in
//components templates.
* ic_edit_24dp.png is moved from //chrome into //components

Before:
The two //components xml templates depends on the //chrome resources
ic_edit_24dp.png, product_logo_name.png, fre_product_logo.png.

After:
No //components payment targets depends on the //chrome resources.

Bug: 1141076

Change-Id: Idea99bdb55d1dd633a540eee4d2db27e2c471634
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2490162
Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Reviewed-by: default avatarSahel Sharify <sahel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820460}
parent 3e98f32b
......@@ -71,7 +71,6 @@ chrome_java_resources = [
"java/res/drawable-hdpi/ic_download_pending.png",
"java/res/drawable-hdpi/ic_drag_handle_grey600_24dp.png",
"java/res/drawable-hdpi/ic_drive_site_white_24dp.png",
"java/res/drawable-hdpi/ic_edit_24dp.png",
"java/res/drawable-hdpi/ic_email_googblue_36dp.png",
"java/res/drawable-hdpi/ic_error_grey800_24dp_filled.png",
"java/res/drawable-hdpi/ic_error_outline_googblue_24dp.png",
......@@ -219,7 +218,6 @@ chrome_java_resources = [
"java/res/drawable-mdpi/ic_download_pending.png",
"java/res/drawable-mdpi/ic_drag_handle_grey600_24dp.png",
"java/res/drawable-mdpi/ic_drive_site_white_24dp.png",
"java/res/drawable-mdpi/ic_edit_24dp.png",
"java/res/drawable-mdpi/ic_email_googblue_36dp.png",
"java/res/drawable-mdpi/ic_error_grey800_24dp_filled.png",
"java/res/drawable-mdpi/ic_error_outline_googblue_24dp.png",
......@@ -351,7 +349,6 @@ chrome_java_resources = [
"java/res/drawable-xhdpi/ic_download_pending.png",
"java/res/drawable-xhdpi/ic_drag_handle_grey600_24dp.png",
"java/res/drawable-xhdpi/ic_drive_site_white_24dp.png",
"java/res/drawable-xhdpi/ic_edit_24dp.png",
"java/res/drawable-xhdpi/ic_email_googblue_36dp.png",
"java/res/drawable-xhdpi/ic_error_grey800_24dp_filled.png",
"java/res/drawable-xhdpi/ic_error_outline_googblue_24dp.png",
......@@ -461,7 +458,6 @@ chrome_java_resources = [
"java/res/drawable-xxhdpi/ic_download_pending.png",
"java/res/drawable-xxhdpi/ic_drag_handle_grey600_24dp.png",
"java/res/drawable-xxhdpi/ic_drive_site_white_24dp.png",
"java/res/drawable-xxhdpi/ic_edit_24dp.png",
"java/res/drawable-xxhdpi/ic_email_googblue_36dp.png",
"java/res/drawable-xxhdpi/ic_error_grey800_24dp_filled.png",
"java/res/drawable-xxhdpi/ic_error_outline_googblue_24dp.png",
......@@ -568,7 +564,6 @@ chrome_java_resources = [
"java/res/drawable-xxxhdpi/ic_dialer_not_found_red_40dp.png",
"java/res/drawable-xxxhdpi/ic_drag_handle_grey600_24dp.png",
"java/res/drawable-xxxhdpi/ic_drive_site_white_24dp.png",
"java/res/drawable-xxxhdpi/ic_edit_24dp.png",
"java/res/drawable-xxxhdpi/ic_email_googblue_36dp.png",
"java/res/drawable-xxxhdpi/ic_error_grey800_24dp_filled.png",
"java/res/drawable-xxxhdpi/ic_error_outline_googblue_24dp.png",
......
......@@ -8,13 +8,14 @@ import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import org.chromium.chrome.R;
/** This class represents a bar to display at the bottom of the payment request UI. */
public class PaymentRequestBottomBar extends ViewGroup {
private View mLogoWithName;
private View mLogo;
private ImageView mLogoWithName;
private ImageView mLogo;
private View mPrimaryButton;
private View mSecondaryButton;
private View mSpace;
......@@ -29,7 +30,13 @@ public class PaymentRequestBottomBar extends ViewGroup {
super.onFinishInflate();
mLogoWithName = findViewById(R.id.logo_name);
// Not doing it in the template because the //components payment_request_bottom_bar.xml
// cannot depend on the //chrome logo.png.
mLogoWithName.setImageResource(R.drawable.product_logo_name);
mLogo = findViewById(R.id.logo);
// Not doing it in the template because the //components template
// payment_request_bottom_bar.xml cannot depend on the //chrome fre_product_logo.png.
mLogo.setImageResource(R.drawable.fre_product_logo);
mPrimaryButton = findViewById(R.id.button_primary);
mSecondaryButton = findViewById(R.id.button_secondary);
mSpace = findViewById(R.id.space);
......@@ -132,4 +139,4 @@ public class PaymentRequestBottomBar extends ViewGroup {
child.layout(childLeft, childTop, childRight, childTop + childHeight);
}
}
}
\ No newline at end of file
}
......@@ -28,6 +28,7 @@ android_resources("java_resources") {
"java/res/color/default_icon_color_tint_list.xml",
"java/res/drawable-hdpi/btn_star_filled.png",
"java/res/drawable-hdpi/ic_delete_white_24dp.png",
"java/res/drawable-hdpi/ic_edit_24dp.png",
"java/res/drawable-hdpi/ic_folder_blue_24dp.png",
"java/res/drawable-hdpi/ic_logo_googleg_24dp.png",
"java/res/drawable-hdpi/ic_pause_white_24dp.png",
......@@ -44,6 +45,7 @@ android_resources("java_resources") {
"java/res/drawable-hdpi/top_round.9.png",
"java/res/drawable-mdpi/btn_star_filled.png",
"java/res/drawable-mdpi/ic_delete_white_24dp.png",
"java/res/drawable-mdpi/ic_edit_24dp.png",
"java/res/drawable-mdpi/ic_folder_blue_24dp.png",
"java/res/drawable-mdpi/ic_logo_googleg_24dp.png",
"java/res/drawable-mdpi/ic_pause_white_24dp.png",
......@@ -65,6 +67,7 @@ android_resources("java_resources") {
"java/res/drawable-night-xxxhdpi/top_round.9.png",
"java/res/drawable-xhdpi/btn_star_filled.png",
"java/res/drawable-xhdpi/ic_delete_white_24dp.png",
"java/res/drawable-xhdpi/ic_edit_24dp.png",
"java/res/drawable-xhdpi/ic_folder_blue_24dp.png",
"java/res/drawable-xhdpi/ic_logo_googleg_24dp.png",
"java/res/drawable-xhdpi/ic_pause_white_24dp.png",
......@@ -81,6 +84,7 @@ android_resources("java_resources") {
"java/res/drawable-xhdpi/top_round.9.png",
"java/res/drawable-xxhdpi/btn_star_filled.png",
"java/res/drawable-xxhdpi/ic_delete_white_24dp.png",
"java/res/drawable-xxhdpi/ic_edit_24dp.png",
"java/res/drawable-xxhdpi/ic_folder_blue_24dp.png",
"java/res/drawable-xxhdpi/ic_logo_googleg_24dp.png",
"java/res/drawable-xxhdpi/ic_pause_white_24dp.png",
......@@ -97,6 +101,7 @@ android_resources("java_resources") {
"java/res/drawable-xxhdpi/top_round.9.png",
"java/res/drawable-xxxhdpi/btn_star_filled.png",
"java/res/drawable-xxxhdpi/ic_delete_white_24dp.png",
"java/res/drawable-xxxhdpi/ic_edit_24dp.png",
"java/res/drawable-xxxhdpi/ic_folder_blue_24dp.png",
"java/res/drawable-xxxhdpi/ic_logo_googleg_24dp.png",
"java/res/drawable-xxxhdpi/ic_pause_white_24dp.png",
......
......@@ -21,14 +21,12 @@
android:id="@+id/logo_name"
android:layout_width="72dp"
android:layout_height="20dp"
android:src="@drawable/product_logo_name"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/logo"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/fre_product_logo"
tools:ignore="ContentDescription" />
<Space
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment