diff --git a/core/java/android/widget/Spinner.java b/core/java/android/widget/Spinner.java index 6abd1293edd55..f3cf61c7a1eba 100644 --- a/core/java/android/widget/Spinner.java +++ b/core/java/android/widget/Spinner.java @@ -85,8 +85,10 @@ public class Spinner extends AbsSpinner implements OnClickListener { */ private static final int MODE_THEME = -1; + private final Rect mTempRect = new Rect(); + /** Context used to inflate the popup window or dialog. */ - private Context mPopupContext; + private final Context mPopupContext; /** Forwarding listener used to implement drag-to-open. */ private ForwardingListener mForwardingListener; @@ -100,26 +102,25 @@ public class Spinner extends AbsSpinner implements OnClickListener { private int mGravity; private boolean mDisableChildrenWhenDisabled; - private Rect mTempRect = new Rect(); - /** - * Construct a new spinner with the given context's theme. + * Constructs a new spinner with the given context's theme. * * @param context The Context the view is running in, through which it can - * access the current theme, resources, etc. + * access the current theme, resources, etc. */ public Spinner(Context context) { this(context, null); } /** - * Construct a new spinner with the given context's theme and the supplied + * Constructs a new spinner with the given context's theme and the supplied * mode of displaying choices. mode may be one of * {@link #MODE_DIALOG} or {@link #MODE_DROPDOWN}. * * @param context The Context the view is running in, through which it can - * access the current theme, resources, etc. - * @param mode Constant describing how the user will select choices from the spinner. + * access the current theme, resources, etc. + * @param mode Constant describing how the user will select choices from + * the spinner. * * @see #MODE_DIALOG * @see #MODE_DROPDOWN @@ -129,10 +130,11 @@ public class Spinner extends AbsSpinner implements OnClickListener { } /** - * Construct a new spinner with the given context's theme and the supplied attribute set. + * Constructs a new spinner with the given context's theme and the supplied + * attribute set. * * @param context The Context the view is running in, through which it can - * access the current theme, resources, etc. + * access the current theme, resources, etc. * @param attrs The attributes of the XML tag that is inflating the view. */ public Spinner(Context context, AttributeSet attrs) { @@ -140,32 +142,35 @@ public class Spinner extends AbsSpinner implements OnClickListener { } /** - * Construct a new spinner with the given context's theme, the supplied attribute set, - * and default style attribute. + * Constructs a new spinner with the given context's theme, the supplied + * attribute set, and default style attribute. * * @param context The Context the view is running in, through which it can - * access the current theme, resources, etc. + * access the current theme, resources, etc. * @param attrs The attributes of the XML tag that is inflating the view. * @param defStyleAttr An attribute in the current theme that contains a - * reference to a style resource that supplies default values for - * the view. Can be 0 to not look for defaults. + * reference to a style resource that supplies default + * values for the view. Can be 0 to not look for + * defaults. */ public Spinner(Context context, AttributeSet attrs, int defStyleAttr) { this(context, attrs, defStyleAttr, 0, MODE_THEME); } /** - * Construct a new spinner with the given context's theme, the supplied attribute set, - * and default style. mode may be one of {@link #MODE_DIALOG} or - * {@link #MODE_DROPDOWN} and determines how the user will select choices from the spinner. + * Constructs a new spinner with the given context's theme, the supplied + * attribute set, and default style attribute. mode may be one + * of {@link #MODE_DIALOG} or {@link #MODE_DROPDOWN} and determines how the + * user will select choices from the spinner. * * @param context The Context the view is running in, through which it can - * access the current theme, resources, etc. + * access the current theme, resources, etc. * @param attrs The attributes of the XML tag that is inflating the view. * @param defStyleAttr An attribute in the current theme that contains a - * reference to a style resource that supplies default values for - * the view. Can be 0 to not look for defaults. - * @param mode Constant describing how the user will select choices from the spinner. + * reference to a style resource that supplies default + * values for the view. Can be 0 to not look for defaults. + * @param mode Constant describing how the user will select choices from the + * spinner. * * @see #MODE_DIALOG * @see #MODE_DROPDOWN @@ -175,21 +180,24 @@ public class Spinner extends AbsSpinner implements OnClickListener { } /** - * Construct a new spinner with the given context's theme, the supplied attribute set, - * and default style. mode may be one of {@link #MODE_DIALOG} or - * {@link #MODE_DROPDOWN} and determines how the user will select choices from the spinner. + * Constructs a new spinner with the given context's theme, the supplied + * attribute set, and default styles. mode may be one of + * {@link #MODE_DIALOG} or {@link #MODE_DROPDOWN} and determines how the + * user will select choices from the spinner. * * @param context The Context the view is running in, through which it can - * access the current theme, resources, etc. + * access the current theme, resources, etc. * @param attrs The attributes of the XML tag that is inflating the view. * @param defStyleAttr An attribute in the current theme that contains a - * reference to a style resource that supplies default values for - * the view. Can be 0 to not look for defaults. + * reference to a style resource that supplies default + * values for the view. Can be 0 to not look for + * defaults. * @param defStyleRes A resource identifier of a style resource that - * supplies default values for the view, used only if - * defStyleAttr is 0 or can not be found in the theme. Can be 0 - * to not look for defaults. - * @param mode Constant describing how the user will select choices from the spinner. + * supplies default values for the view, used only if + * defStyleAttr is 0 or can not be found in the theme. + * Can be 0 to not look for defaults. + * @param mode Constant describing how the user will select choices from + * the spinner. * * @see #MODE_DIALOG * @see #MODE_DROPDOWN @@ -200,10 +208,10 @@ public class Spinner extends AbsSpinner implements OnClickListener { } /** - * Constructs a new spinner with the given context's theme, the supplied - * attribute set, default styles, popup mode (one of {@link #MODE_DIALOG} - * or {@link #MODE_DROPDOWN}), and the context against which the popup - * should be inflated. + * Constructs a new spinner with the given context, the supplied attribute + * set, default styles, popup mode (one of {@link #MODE_DIALOG} or + * {@link #MODE_DROPDOWN}), and the theme against which the popup should be + * inflated. * * @param context The context against which the view is inflated, which * provides access to the current theme, resources, etc.