summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/ActionBar.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2013-05-30 16:48:33 -0700
committerTor Norbye <tnorbye@google.com>2015-02-18 07:49:03 -0800
commit7b9c912f536925ac6ec43935d6e97506851b33d6 (patch)
tree8dd71557e2555fde0d506ef77c46dc29184e91c4 /core/java/android/app/ActionBar.java
parent44bc07d8740058398d4009615681120168673dd8 (diff)
downloadframeworks_base-7b9c912f536925ac6ec43935d6e97506851b33d6.zip
frameworks_base-7b9c912f536925ac6ec43935d6e97506851b33d6.tar.gz
frameworks_base-7b9c912f536925ac6ec43935d6e97506851b33d6.tar.bz2
Add @ResourceInt annotations on APIs
Change-Id: I119cc059c2f8bd98fd585fc84ac2b1b7d5892a08
Diffstat (limited to 'core/java/android/app/ActionBar.java')
-rw-r--r--core/java/android/app/ActionBar.java25
1 files changed, 14 insertions, 11 deletions
diff --git a/core/java/android/app/ActionBar.java b/core/java/android/app/ActionBar.java
index 014a7af..4cdd397 100644
--- a/core/java/android/app/ActionBar.java
+++ b/core/java/android/app/ActionBar.java
@@ -16,9 +16,12 @@
package android.app;
+import android.annotation.DrawableRes;
import android.annotation.IntDef;
+import android.annotation.LayoutRes;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.StringRes;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.TypedArray;
@@ -256,7 +259,7 @@ public abstract class ActionBar {
*
* @see #setDisplayOptions(int, int)
*/
- public abstract void setCustomView(int resId);
+ public abstract void setCustomView(@LayoutRes int resId);
/**
* Set the icon to display in the 'home' section of the action bar.
@@ -271,7 +274,7 @@ public abstract class ActionBar {
* @see #setDisplayUseLogoEnabled(boolean)
* @see #setDisplayShowHomeEnabled(boolean)
*/
- public abstract void setIcon(int resId);
+ public abstract void setIcon(@DrawableRes int resId);
/**
* Set the icon to display in the 'home' section of the action bar.
@@ -301,7 +304,7 @@ public abstract class ActionBar {
* @see #setDisplayUseLogoEnabled(boolean)
* @see #setDisplayShowHomeEnabled(boolean)
*/
- public abstract void setLogo(int resId);
+ public abstract void setLogo(@DrawableRes int resId);
/**
* Set the logo to display in the 'home' section of the action bar.
@@ -397,7 +400,7 @@ public abstract class ActionBar {
* @see #setTitle(CharSequence)
* @see #setDisplayOptions(int, int)
*/
- public abstract void setTitle(int resId);
+ public abstract void setTitle(@StringRes int resId);
/**
* Set the action bar's subtitle. This will only be displayed if
@@ -420,7 +423,7 @@ public abstract class ActionBar {
* @see #setSubtitle(CharSequence)
* @see #setDisplayOptions(int, int)
*/
- public abstract void setSubtitle(int resId);
+ public abstract void setSubtitle(@StringRes int resId);
/**
* Set display options. This changes all display option bits at once. To change
@@ -892,7 +895,7 @@ public abstract class ActionBar {
* @see #setDisplayHomeAsUpEnabled(boolean)
* @see #setHomeActionContentDescription(int)
*/
- public void setHomeAsUpIndicator(int resId) { }
+ public void setHomeAsUpIndicator(@DrawableRes int resId) { }
/**
* Set an alternate description for the Home/Up action, when enabled.
@@ -931,7 +934,7 @@ public abstract class ActionBar {
* @see #setHomeAsUpIndicator(int)
* @see #setHomeAsUpIndicator(android.graphics.drawable.Drawable)
*/
- public void setHomeActionContentDescription(int resId) { }
+ public void setHomeActionContentDescription(@StringRes int resId) { }
/**
* Enable hiding the action bar on content scroll.
@@ -1154,7 +1157,7 @@ public abstract class ActionBar {
* @param resId Resource ID referring to the drawable to use as an icon
* @return The current instance for call chaining
*/
- public abstract Tab setIcon(int resId);
+ public abstract Tab setIcon(@DrawableRes int resId);
/**
* Set the text displayed on this tab. Text may be truncated if there is not
@@ -1172,7 +1175,7 @@ public abstract class ActionBar {
* @param resId A resource ID referring to the text that should be displayed
* @return The current instance for call chaining
*/
- public abstract Tab setText(int resId);
+ public abstract Tab setText(@StringRes int resId);
/**
* Set a custom view to be used for this tab. This overrides values set by
@@ -1190,7 +1193,7 @@ public abstract class ActionBar {
* @param layoutResId A layout resource to inflate and use as a custom tab view
* @return The current instance for call chaining
*/
- public abstract Tab setCustomView(int layoutResId);
+ public abstract Tab setCustomView(@LayoutRes int layoutResId);
/**
* Retrieve a previously set custom view for this tab.
@@ -1235,7 +1238,7 @@ public abstract class ActionBar {
* @see #setContentDescription(CharSequence)
* @see #getContentDescription()
*/
- public abstract Tab setContentDescription(int resId);
+ public abstract Tab setContentDescription(@StringRes int resId);
/**
* Set a description of this tab's content for use in accessibility support.