Back to project page android-collapse-calendar-view.
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.
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; } }