Android Open Source - android-collapse-calendar-view Day






From Project

Back to project page android-collapse-calendar-view.

License

The source code is released under:

MIT License

If you think the Android project android-collapse-calendar-view listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.wefika.calendar.manager;
/* www.  j  ava  2  s .c  om*/
import org.jetbrains.annotations.NotNull;
import org.joda.time.LocalDate;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

/**
 * Created by Blaz Solar on 24/02/14.
 */
public class Day {

    private static final DateTimeFormatter mFormatter = DateTimeFormat.forPattern("d");

    @NotNull private final LocalDate mDate;
    private boolean mToday;
    private boolean mSelected;
    private boolean mEnabled;
    private boolean mCurrent;

    public Day(@NotNull LocalDate date, boolean today) {
        mDate = date;
        mToday = today;
        mEnabled = true;
        mCurrent = true;
    }

    @NotNull
    public LocalDate getDate() {
        return mDate;
    }

    public boolean isEnabled() {
        return mEnabled;
    }

    public void setEnabled(boolean enabled) {
        mEnabled = enabled;
    }

    public boolean isSelected() {
        return mSelected;
    }

    public void setSelected(boolean selected) {
        mSelected = selected;
    }

    public boolean isCurrent() {
        return mCurrent;
    }

    public void setCurrent(boolean current) {
        mCurrent = current;
    }

    public boolean isToday() {
        return mToday;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Day day = (Day) o;

        if (mEnabled != day.mEnabled) return false;
        if (mSelected != day.mSelected) return false;
        if (mToday != day.mToday) return false;
        if (!mDate.isEqual(day.mDate)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = mDate.hashCode();
        result = 31 * result + (mToday ? 1 : 0);
        result = 31 * result + (mSelected ? 1 : 0);
        result = 31 * result + (mEnabled ? 1 : 0);
        return result;
    }

    @NotNull
    public String getText() {
        return mDate.toString(mFormatter);
    }
}




Java Source Code List

com.wefika.calendar.CollapseCalendarView.java
com.wefika.calendar.example.MainActivity.java
com.wefika.calendar.manager.CalendarManager.java
com.wefika.calendar.manager.CalendarUnit.java
com.wefika.calendar.manager.Day.java
com.wefika.calendar.manager.Month.java
com.wefika.calendar.manager.ProgressManagerImpl.java
com.wefika.calendar.manager.ProgressManager.java
com.wefika.calendar.manager.RangeUnit.java
com.wefika.calendar.manager.ResizeManager.java
com.wefika.calendar.manager.Week.java
com.wefika.calendar.models.AbstractViewHolder.java
com.wefika.calendar.models.SizeViewHolder.java
com.wefika.calendar.models.StubViewHolder.java
com.wefika.calendar.widget.DayView.java
com.wefika.calendar.widget.WeekView.java