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

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

Issue 1019593002: Remove work around for AppCompat switch thumb issues (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/res/drawable/switch_thumb.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/widget/ChromeSwitchCompat.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/ChromeSwitchCompat.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/ChromeSwitchCompat.java
index 7466ff988c03784bf3e9c4ea3dd8242ebded4d4d..fe6526b7b71aa5014a6ef3043398018f04b4a295 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/widget/ChromeSwitchCompat.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/ChromeSwitchCompat.java
@@ -5,17 +5,12 @@
package org.chromium.chrome.browser.widget;
import android.content.Context;
-import android.content.res.ColorStateList;
-import android.graphics.PorterDuff;
-import android.graphics.drawable.Drawable;
import android.support.v7.widget.SwitchCompat;
import android.util.AttributeSet;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.Switch;
-import org.chromium.chrome.R;
-
/**
* This class fixes the accessibility of SwitchCompat so it's read as "on switch" instead of
* "checkbox checked". http://crbug.com/441702
@@ -24,24 +19,15 @@ import org.chromium.chrome.R;
* "Checkbox". This works around the bug by marking accessibility events from SwitchCompat with the
* Switch class name, which TalkBack recognizes.
*
- * It also fixes the thumb drawable being too small and disappearing on certain devices
- * and the disabled tint color being incorrect. http://crbug.com/455327
- *
* TODO(newt): Delete this class once the support library is fixed. http://b/19110477
*/
public class ChromeSwitchCompat extends SwitchCompat {
- private Drawable mThumbDrawable;
- private ColorStateList mTint;
/**
* Constructor for inflating from XML.
*/
public ChromeSwitchCompat(Context context, AttributeSet attrs) {
super(context, attrs);
- setThumbResource(R.drawable.switch_thumb);
- mThumbDrawable = getThumbDrawable();
- mThumbDrawable.mutate();
- mTint = getResources().getColorStateList(R.color.switch_thumb_tint);
}
@Override
@@ -55,17 +41,4 @@ public class ChromeSwitchCompat extends SwitchCompat {
super.onInitializeAccessibilityNodeInfo(info);
info.setClassName(Switch.class.getName());
}
-
- @Override
- protected void drawableStateChanged() {
- super.drawableStateChanged();
- updateThumbTintColor();
- }
-
- private boolean updateThumbTintColor() {
- if (mTint == null) return false;
- mThumbDrawable.setColorFilter(mTint.getColorForState(mThumbDrawable.getState(), 0),
- PorterDuff.Mode.SRC_IN);
- return true;
- }
}
« no previous file with comments | « chrome/android/java/res/drawable/switch_thumb.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698