Removing all compatibility code below Lollipop
Bug: 32745285
Change-Id: I62971908e3e4402941fab627bbdfd47be64473a3
diff --git a/src/com/android/launcher3/ButtonDropTarget.java b/src/com/android/launcher3/ButtonDropTarget.java
index e613b3b..85b08d1 100644
--- a/src/com/android/launcher3/ButtonDropTarget.java
+++ b/src/com/android/launcher3/ButtonDropTarget.java
@@ -21,7 +21,6 @@
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
-import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
@@ -30,7 +29,6 @@
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
-import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
@@ -100,17 +98,11 @@
mOriginalTextColor = getTextColors();
}
- @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
protected void setDrawable(int resId) {
// We do not set the drawable in the xml as that inflates two drawables corresponding to
// drawableLeft and drawableStart.
mDrawable = getResources().getDrawable(resId);
-
- if (Utilities.ATLEAST_JB_MR1) {
- setCompoundDrawablesRelativeWithIntrinsicBounds(mDrawable, null, null, null);
- } else {
- setCompoundDrawablesWithIntrinsicBounds(mDrawable, null, null, null);
- }
+ setCompoundDrawablesRelativeWithIntrinsicBounds(mDrawable, null, null, null);
}
public void setDropTargetBar(DropTargetBar dropTargetBar) {
@@ -120,16 +112,7 @@
@Override
public final void onDragEnter(DragObject d) {
d.dragView.setColor(mHoverColor);
- if (Utilities.ATLEAST_LOLLIPOP) {
- animateTextColor(mHoverColor);
- } else {
- if (mCurrentFilter == null) {
- mCurrentFilter = new ColorMatrix();
- }
- DragView.setColorScale(mHoverColor, mCurrentFilter);
- mDrawable.setColorFilter(new ColorMatrixColorFilter(mCurrentFilter));
- setTextColor(mHoverColor);
- }
+ animateTextColor(mHoverColor);
if (d.stateAnnouncer != null) {
d.stateAnnouncer.cancel();
}
@@ -142,15 +125,9 @@
}
protected void resetHoverColor() {
- if (Utilities.ATLEAST_LOLLIPOP) {
- animateTextColor(mOriginalTextColor.getDefaultColor());
- } else {
- mDrawable.setColorFilter(null);
- setTextColor(mOriginalTextColor);
- }
+ animateTextColor(mOriginalTextColor.getDefaultColor());
}
- @TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void animateTextColor(int targetColor) {
if (mCurrentColorAnim != null) {
mCurrentColorAnim.cancel();