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






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.widget;
//w w w .j  a v a 2  s . co m
import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;

import com.wefika.calendar.R;

/**
 * Created by Blaz Solar on 24/05/14.
 */
public class DayView extends TextView {

    private static final int[] STATE_CURRENT = { R.attr.state_current };

    private boolean mCurrent;

    public DayView(Context context) {
        super(context);
    }

    public DayView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public DayView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

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

    @Override
    protected int[] onCreateDrawableState(int extraSpace) {
        final int[] state = super.onCreateDrawableState(extraSpace + 1);

        if (mCurrent) {
            mergeDrawableStates(state, STATE_CURRENT);
        }

        return state;
    }
}




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