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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/widget/ButtonCompat.java

Issue 965933002: Address NewApi and other Android lint warnings in src/chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/preferences/website/AddExceptionPreference.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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.widget; 5 package org.chromium.chrome.browser.widget;
6 6
7 import android.animation.AnimatorInflater; 7 import android.animation.AnimatorInflater;
8 import android.annotation.TargetApi; 8 import android.annotation.TargetApi;
9 import android.content.Context; 9 import android.content.Context;
10 import android.content.res.ColorStateList; 10 import android.content.res.ColorStateList;
(...skipping 20 matching lines...) Expand all
31 * 31 *
32 * <org.chromium.chrome.browser.widget.ButtonCompat 32 * <org.chromium.chrome.browser.widget.ButtonCompat
33 * android:layout_width="wrap_content" 33 * android:layout_width="wrap_content"
34 * android:layout_height="wrap_content" 34 * android:layout_height="wrap_content"
35 * android:text="Click me" 35 * android:text="Click me"
36 * chrome:buttonColor="#f00" /> 36 * chrome:buttonColor="#f00" />
37 * 37 *
38 * Note: To ensure the button's shadow is fully visible, you may need to set 38 * Note: To ensure the button's shadow is fully visible, you may need to set
39 * android:clipToPadding="false" on the button's parent view. 39 * android:clipToPadding="false" on the button's parent view.
40 */ 40 */
41 @TargetApi(Build.VERSION_CODES.LOLLIPOP)
41 public class ButtonCompat extends Button { 42 public class ButtonCompat extends Button {
42 43
43 private static final float PRE_L_PRESSED_BRIGHTNESS = 0.85f; 44 private static final float PRE_L_PRESSED_BRIGHTNESS = 0.85f;
44 private static final int DISABLED_COLOR = 0x1F000000; 45 private static final int DISABLED_COLOR = 0x1F000000;
45 46
46 private int mColor; 47 private int mColor;
47 48
48 /** 49 /**
49 * Returns a new borderless material-style button. 50 * Returns a new borderless material-style button.
50 */ 51 */
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 return DISABLED_COLOR; 144 return DISABLED_COLOR;
144 } 145 }
145 146
146 private static int getColorFromAttributeSet(Context context, AttributeSet at trs) { 147 private static int getColorFromAttributeSet(Context context, AttributeSet at trs) {
147 TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ButtonC ompat, 0, 0); 148 TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ButtonC ompat, 0, 0);
148 int color = a.getColor(R.styleable.ButtonCompat_buttonColor, Color.WHITE ); 149 int color = a.getColor(R.styleable.ButtonCompat_buttonColor, Color.WHITE );
149 a.recycle(); 150 a.recycle();
150 return color; 151 return color;
151 } 152 }
152 } 153 }
OLDNEW
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/preferences/website/AddExceptionPreference.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698