summaryrefslogtreecommitdiff
path: root/core/java/android/app/Dialog.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/Dialog.java
parent44bc07d8740058398d4009615681120168673dd8 (diff)
Add @ResourceInt annotations on APIs
Change-Id: I119cc059c2f8bd98fd585fc84ac2b1b7d5892a08
Diffstat (limited to 'core/java/android/app/Dialog.java')
-rw-r--r--core/java/android/app/Dialog.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/java/android/app/Dialog.java b/core/java/android/app/Dialog.java
index a3662b2afabe..e465d577924e 100644
--- a/core/java/android/app/Dialog.java
+++ b/core/java/android/app/Dialog.java
@@ -16,6 +16,10 @@
package android.app;
+import android.annotation.DrawableRes;
+import android.annotation.IdRes;
+import android.annotation.LayoutRes;
+import android.annotation.StringRes;
import com.android.internal.app.WindowDecorActionBar;
import android.annotation.Nullable;
@@ -478,7 +482,7 @@ public class Dialog implements DialogInterface, Window.Callback,
* @return The view with the given id or null.
*/
@Nullable
- public View findViewById(int id) {
+ public View findViewById(@IdRes int id) {
return mWindow.findViewById(id);
}
@@ -488,7 +492,7 @@ public class Dialog implements DialogInterface, Window.Callback,
*
* @param layoutResID Resource ID to be inflated.
*/
- public void setContentView(int layoutResID) {
+ public void setContentView(@LayoutRes int layoutResID) {
mWindow.setContentView(layoutResID);
}
@@ -542,7 +546,7 @@ public class Dialog implements DialogInterface, Window.Callback,
*
* @param titleId the title's text resource identifier
*/
- public void setTitle(int titleId) {
+ public void setTitle(@StringRes int titleId) {
setTitle(mContext.getText(titleId));
}
@@ -1072,7 +1076,7 @@ public class Dialog implements DialogInterface, Window.Callback,
* Convenience for calling
* {@link android.view.Window#setFeatureDrawableResource}.
*/
- public final void setFeatureDrawableResource(int featureId, int resId) {
+ public final void setFeatureDrawableResource(int featureId, @DrawableRes int resId) {
getWindow().setFeatureDrawableResource(featureId, resId);
}