Use ContextCompat.getColor to support API levels below 23.

Found while debugging on Lollipop.

Change-Id: Ibe97fd30c4ee8cd0c1735a41802b859345f9e931
This commit is contained in:
Jon Miranda
2016-09-15 15:05:12 -07:00
parent 9784572c47
commit 488d8adeb8
2 changed files with 4 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.support.v4.graphics.ColorUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
@@ -69,7 +70,7 @@ public class Hotseat extends FrameLayout
mLauncher = (Launcher) context;
mHasVerticalHotseat = mLauncher.getDeviceProfile().isVerticalBarLayout();
mBackgroundColor = ColorUtils.setAlphaComponent(
context.getColor(R.color.all_apps_container_color), 0);
ContextCompat.getColor(context, R.color.all_apps_container_color), 0);
mBackground = new ColorDrawable(mBackgroundColor);
setBackground(mBackground);
}

View File

@@ -6,6 +6,7 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.animation.FastOutSlowInInterpolator;
import android.util.Log;
import android.view.MotionEvent;
@@ -101,7 +102,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
R.dimen.all_apps_bezel_swipe_height);
mEvaluator = new ArgbEvaluator();
mAllAppsBackgroundColor = l.getColor(R.color.all_apps_container_color);
mAllAppsBackgroundColor = ContextCompat.getColor(l, R.color.all_apps_container_color);
}
@Override