diff options
| author | Alan Viverette <alanv@google.com> | 2016-01-08 14:20:12 -0500 |
|---|---|---|
| committer | Alan Viverette <alanv@google.com> | 2016-01-08 14:20:12 -0500 |
| commit | b097321719e5a657ffa5f0db775a0fa03aaf42cd (patch) | |
| tree | 042cf11602236d70adc65d184e30e336a55750d3 /core/java/android/widget/CalendarView.java | |
| parent | 932f66428c8a6f292423147feb5f862cd2a8b528 (diff) | |
Clean up CalendarView docs and annotations
Change-Id: Ie086af87b4113ef83d07370eb2b25fd7530a8781
Diffstat (limited to 'core/java/android/widget/CalendarView.java')
| -rw-r--r-- | core/java/android/widget/CalendarView.java | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/core/java/android/widget/CalendarView.java b/core/java/android/widget/CalendarView.java index 2aaa356cb00a..cde7604b7e7c 100644 --- a/core/java/android/widget/CalendarView.java +++ b/core/java/android/widget/CalendarView.java @@ -16,8 +16,11 @@ package android.widget; +import android.annotation.AttrRes; import android.annotation.ColorInt; import android.annotation.DrawableRes; +import android.annotation.NonNull; +import android.annotation.Nullable; import android.annotation.StyleRes; import android.annotation.Widget; import android.content.Context; @@ -37,9 +40,13 @@ import java.util.Locale; import java.util.TimeZone; /** - * This class is a calendar widget for displaying and selecting dates. The range - * of dates supported by this calendar is configurable. A user can select a date - * by taping on it and can scroll and fling the calendar to a desired date. + * This class is a calendar widget for displaying and selecting dates. The + * range of dates supported by this calendar is configurable. + * <p> + * The exact appearance and interaction model of this widget may vary between + * OS versions and themes (e.g. Holo versus Material), but in general a user + * can select a date by tapping on it and can scroll or fling the calendar to a + * desired date. * * @attr ref android.R.styleable#CalendarView_showWeekNumber * @attr ref android.R.styleable#CalendarView_firstDayOfWeek @@ -77,22 +84,24 @@ public class CalendarView extends FrameLayout { * @param month The month that was set [0-11]. * @param dayOfMonth The day of the month that was set. */ - public void onSelectedDayChange(CalendarView view, int year, int month, int dayOfMonth); + void onSelectedDayChange(@NonNull CalendarView view, int year, int month, int dayOfMonth); } - public CalendarView(Context context) { + public CalendarView(@NonNull Context context) { this(context, null); } - public CalendarView(Context context, AttributeSet attrs) { + public CalendarView(@NonNull Context context, @Nullable AttributeSet attrs) { this(context, attrs, R.attr.calendarViewStyle); } - public CalendarView(Context context, AttributeSet attrs, int defStyleAttr) { + public CalendarView(@NonNull Context context, @Nullable AttributeSet attrs, + @AttrRes int defStyleAttr) { this(context, attrs, defStyleAttr, 0); } - public CalendarView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + public CalendarView(@NonNull Context context, @Nullable AttributeSet attrs, + @AttrRes int defStyleAttr, @StyleRes int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); final TypedArray a = context.obtainStyledAttributes( @@ -322,7 +331,7 @@ public class CalendarView extends FrameLayout { * * @attr ref android.R.styleable#CalendarView_weekDayTextAppearance */ - public void setWeekDayTextAppearance(int resourceId) { + public void setWeekDayTextAppearance(@StyleRes int resourceId) { mDelegate.setWeekDayTextAppearance(resourceId); } @@ -333,7 +342,7 @@ public class CalendarView extends FrameLayout { * * @attr ref android.R.styleable#CalendarView_weekDayTextAppearance */ - public int getWeekDayTextAppearance() { + public @StyleRes int getWeekDayTextAppearance() { return mDelegate.getWeekDayTextAppearance(); } @@ -344,7 +353,7 @@ public class CalendarView extends FrameLayout { * * @attr ref android.R.styleable#CalendarView_dateTextAppearance */ - public void setDateTextAppearance(int resourceId) { + public void setDateTextAppearance(@StyleRes int resourceId) { mDelegate.setDateTextAppearance(resourceId); } @@ -355,7 +364,7 @@ public class CalendarView extends FrameLayout { * * @attr ref android.R.styleable#CalendarView_dateTextAppearance */ - public int getDateTextAppearance() { + public @StyleRes int getDateTextAppearance() { return mDelegate.getDateTextAppearance(); } @@ -552,36 +561,29 @@ public class CalendarView extends FrameLayout { int getShownWeekCount(); void setSelectedWeekBackgroundColor(@ColorInt int color); - @ColorInt - int getSelectedWeekBackgroundColor(); + @ColorInt int getSelectedWeekBackgroundColor(); void setFocusedMonthDateColor(@ColorInt int color); - @ColorInt - int getFocusedMonthDateColor(); + @ColorInt int getFocusedMonthDateColor(); void setUnfocusedMonthDateColor(@ColorInt int color); - @ColorInt - int getUnfocusedMonthDateColor(); + @ColorInt int getUnfocusedMonthDateColor(); void setWeekNumberColor(@ColorInt int color); - @ColorInt - int getWeekNumberColor(); + @ColorInt int getWeekNumberColor(); void setWeekSeparatorLineColor(@ColorInt int color); - @ColorInt - int getWeekSeparatorLineColor(); + @ColorInt int getWeekSeparatorLineColor(); void setSelectedDateVerticalBar(@DrawableRes int resourceId); void setSelectedDateVerticalBar(Drawable drawable); Drawable getSelectedDateVerticalBar(); void setWeekDayTextAppearance(@StyleRes int resourceId); - @StyleRes - int getWeekDayTextAppearance(); + @StyleRes int getWeekDayTextAppearance(); void setDateTextAppearance(@StyleRes int resourceId); - @StyleRes - int getDateTextAppearance(); + @StyleRes int getDateTextAppearance(); void setMinDate(long minDate); long getMinDate(); |
