Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0973217 authored by Alan Viverette's avatar Alan Viverette
Browse files

Clean up CalendarView docs and annotations

Change-Id: Ie086af87b4113ef83d07370eb2b25fd7530a8781
parent 932f6642
Loading
Loading
Loading
Loading
+28 −26
Original line number Diff line number Diff line
@@ -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();