OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.infobar; | 5 package org.chromium.chrome.browser.infobar; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.content.res.Resources; | 8 import android.content.res.Resources; |
9 import android.content.res.TypedArray; | 9 import android.content.res.TypedArray; |
10 import android.graphics.Bitmap; | 10 import android.graphics.Bitmap; |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
236 assert !TextUtils.isEmpty(primaryText); | 236 assert !TextUtils.isEmpty(primaryText); |
237 Button primaryButton = DualControlLayout.createButtonForLayout( | 237 Button primaryButton = DualControlLayout.createButtonForLayout( |
238 getContext(), true, primaryText, this); | 238 getContext(), true, primaryText, this); |
239 | 239 |
240 assert mButtonRowLayout == null; | 240 assert mButtonRowLayout == null; |
241 mButtonRowLayout = new DualControlLayout(getContext(), null); | 241 mButtonRowLayout = new DualControlLayout(getContext(), null); |
242 mButtonRowLayout.setAlignment(alignment); | 242 mButtonRowLayout.setAlignment(alignment); |
243 mButtonRowLayout.setStackedMargin(getResources().getDimensionPixelSize( | 243 mButtonRowLayout.setStackedMargin(getResources().getDimensionPixelSize( |
244 R.dimen.infobar_margin_between_stacked_buttons)); | 244 R.dimen.infobar_margin_between_stacked_buttons)); |
245 | 245 |
246 mButtonRowLayout.addView(primaryButton); | |
mdjones
2017/07/20 21:49:06
Is this view added somewhere else? If not, removin
jaebaek
2017/07/21 10:03:05
Ah .. it's my mistake.
| |
247 if (secondaryView != null) mButtonRowLayout.addView(secondaryView); | 246 if (secondaryView != null) mButtonRowLayout.addView(secondaryView); |
248 } | 247 } |
249 | 248 |
250 /** | 249 /** |
251 * Adjusts styling to account for the big icon layout. | 250 * Adjusts styling to account for the big icon layout. |
252 */ | 251 */ |
253 public void setIsUsingBigIcon() { | 252 public void setIsUsingBigIcon() { |
254 if (mIconView == null) return; | 253 if (mIconView == null) return; |
255 | 254 |
256 LayoutParams lp = (LayoutParams) mIconView.getLayoutParams(); | 255 LayoutParams lp = (LayoutParams) mIconView.getLayoutParams(); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
546 ImageButton closeButton = new ImageButton(context); | 545 ImageButton closeButton = new ImageButton(context); |
547 closeButton.setId(R.id.infobar_close_button); | 546 closeButton.setId(R.id.infobar_close_button); |
548 closeButton.setImageResource(R.drawable.btn_close); | 547 closeButton.setImageResource(R.drawable.btn_close); |
549 closeButton.setBackground(closeButtonBackground); | 548 closeButton.setBackground(closeButtonBackground); |
550 closeButton.setContentDescription(context.getString(R.string.infobar_clo se)); | 549 closeButton.setContentDescription(context.getString(R.string.infobar_clo se)); |
551 closeButton.setScaleType(ImageView.ScaleType.CENTER_INSIDE); | 550 closeButton.setScaleType(ImageView.ScaleType.CENTER_INSIDE); |
552 | 551 |
553 return closeButton; | 552 return closeButton; |
554 } | 553 } |
555 } | 554 } |
OLD | NEW |