summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorScott Kennedy <skennedy@google.com>2015-03-05 19:15:11 -0800
committerScott Kennedy <skennedy@google.com>2015-03-05 19:15:11 -0800
commit3a1fa10e13f72396eb0d218ee4d7aad2a77134e3 (patch)
treed90f394ede3cbd3d18e2a7f4327a42dc151708cf /core/java
parent3062e57072145ba5e71ba8b2cf565d3453db04a7 (diff)
downloadframeworks_base-3a1fa10e13f72396eb0d218ee4d7aad2a77134e3.zip
frameworks_base-3a1fa10e13f72396eb0d218ee4d7aad2a77134e3.tar.gz
frameworks_base-3a1fa10e13f72396eb0d218ee4d7aad2a77134e3.tar.bz2
Allow attrs to be @Nullable in TextView and LinearLayout
Change-Id: I46ac6cddf010e7ce59de6272c30e824104e28acb
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/widget/LinearLayout.java5
-rw-r--r--core/java/android/widget/TextView.java9
2 files changed, 8 insertions, 6 deletions
diff --git a/core/java/android/widget/LinearLayout.java b/core/java/android/widget/LinearLayout.java
index c0f63d2..d96e957 100644
--- a/core/java/android/widget/LinearLayout.java
+++ b/core/java/android/widget/LinearLayout.java
@@ -19,6 +19,7 @@ package android.widget;
import com.android.internal.R;
import android.annotation.IntDef;
+import android.annotation.Nullable;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
@@ -188,11 +189,11 @@ public class LinearLayout extends ViewGroup {
this(context, null);
}
- public LinearLayout(Context context, AttributeSet attrs) {
+ public LinearLayout(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
- public LinearLayout(Context context, AttributeSet attrs, int defStyleAttr) {
+ public LinearLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, 0);
}
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 632f5c7..4360326 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -637,16 +637,17 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
this(context, null);
}
- public TextView(Context context, AttributeSet attrs) {
+ public TextView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, com.android.internal.R.attr.textViewStyle);
}
- public TextView(Context context, AttributeSet attrs, int defStyleAttr) {
+ public TextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, 0);
}
@SuppressWarnings("deprecation")
- public TextView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+ public TextView(
+ Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
mText = "";
@@ -9726,4 +9727,4 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
TextView.this.spanChange(buf, what, s, -1, e, -1);
}
}
-} \ No newline at end of file
+}