Bug 1189944 - Annotate DrawableUtil method. r=sebastian
authorMichael Comella <michael.l.comella@gmail.com>
Fri, 31 Jul 2015 14:34:44 -0700
changeset 287582 0ab5f96fa1046fd3ae518dea4871f46f187ac7f7
parent 287581 fbf2c7f465ca87955cd8bb5296b362f418e0d925
child 287583 d191709cd9331027bd000b77c7db93f85a12392c
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1189944
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1189944 - Annotate DrawableUtil method. r=sebastian This *just works* with Gradle. :)
mobile/android/base/util/DrawableUtil.java
--- a/mobile/android/base/util/DrawableUtil.java
+++ b/mobile/android/base/util/DrawableUtil.java
@@ -2,20 +2,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.util;
 
 import android.content.Context;
 import android.graphics.drawable.Drawable;
+import android.support.annotation.ColorRes;
+import android.support.annotation.DrawableRes;
+import android.support.annotation.NonNull;
 import android.support.v4.content.ContextCompat;
 import android.support.v4.graphics.drawable.DrawableCompat;
 
 public class DrawableUtil {
 
-    public static Drawable tintDrawable(final Context context, final int drawableID, final int colorID) {
+    public static Drawable tintDrawable(@NonNull final Context context, @DrawableRes final int drawableID,
+                @ColorRes final int colorID) {
         final Drawable icon = DrawableCompat.wrap(
                 ContextCompat.getDrawable(context, drawableID).mutate());
         DrawableCompat.setTint(icon, context.getResources().getColor(colorID));
         return icon;
     }
 }