资源简介
Android记账源代码
代码片段和文件信息
// Copyright 2013 Square Inc.
package com.squareup.timessquare;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;
import com.squareup.timessquare.MonthCellDescriptor.RangeState;
public class CalendarCellView extends TextView {
private static final int[] STATE_SELECTABLE = {
R.attr.state_selectable
};
private static final int[] STATE_CURRENT_MONTH = {
R.attr.state_current_month
};
private static final int[] STATE_TODAY = {
R.attr.state_today
};
private static final int[] STATE_HIGHLIGHTED = {
R.attr.state_highlighted
};
private static final int[] STATE_RANGE_FIRST = {
R.attr.state_range_first
};
private static final int[] STATE_RANGE_MIDDLE = {
R.attr.state_range_middle
};
private static final int[] STATE_RANGE_LAST = {
R.attr.state_range_last
};
private boolean isSelectable = false;
private boolean isCurrentMonth = false;
private boolean isToday = false;
private boolean isHighlighted = false;
private RangeState rangeState = RangeState.NONE;
@SuppressWarnings(“UnusedDeclaration“)
public CalendarCellView(Context context AttributeSet attrs) {
super(context attrs);
}
public void setSelectable(boolean isSelectable) {
this.isSelectable = isSelectable;
refreshDrawableState();
}
public void setCurrentMonth(boolean isCurrentMonth) {
this.isCurrentMonth = isCurrentMonth;
refreshDrawableState();
}
public void setToday(boolean isToday) {
this.isToday = isToday;
refreshDrawableState();
}
public void setRangeState(MonthCellDescriptor.RangeState rangeState) {
this.rangeState = rangeState;
refreshDrawableState();
}
public void setHighlighted(boolean highlighted) {
isHighlighted = highlighted;
}
@Override protected int[] onCreateDrawableState(int extraSpace) {
final int[] drawableState = super.onCreateDrawableState(extraSpace + 5);
if (isSelectable) {
mergeDrawableStates(drawableState STATE_SELECTABLE);
}
if (isCurrentMonth) {
mergeDrawableStates(drawableState STATE_CURRENT_MONTH);
}
if (isToday) {
mergeDrawableStates(drawableState STATE_TODAY);
}
if (isHighlighted) {
mergeDrawableStates(drawableState STATE_HIGHLIGHTED);
}
if (rangeState == MonthCellDescriptor.RangeState.FIRST) {
mergeDrawableStates(drawableState STATE_RANGE_FIRST);
} else if (rangeState == MonthCellDescriptor.RangeState.MIDDLE) {
mergeDrawableStates(drawableState STATE_RANGE_MIDDLE);
} else if (rangeState == RangeState.LAST) {
mergeDrawableStates(drawableState STATE_RANGE_LAST);
}
return drawableState;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 142 2014-01-28 22:42 20140301086\android-times-square-master\.gitignore
....... 388 2014-01-28 22:42 20140301086\android-times-square-master\.travis.yml
....... 1010 2014-01-28 22:42 20140301086\android-times-square-master\CHANGELOG.md
....... 5074 2014-01-28 22:42 20140301086\android-times-square-master\checkst
....... 737 2014-01-28 22:42 20140301086\android-times-square-master\CONTRIBUTING.md
....... 292 2014-01-28 22:42 20140301086\android-times-square-master\library\AndroidManifest.xm
....... 2591 2014-01-28 22:42 20140301086\android-times-square-master\library\pom.xm
....... 382 2014-01-28 22:42 20140301086\android-times-square-master\library\project.properties
....... 699 2014-01-28 22:42 20140301086\android-times-square-master\library\res\color\calendar_text_selector.xm
....... 951 2014-01-28 22:42 20140301086\android-times-square-master\library\res\drawable\calendar_bg_selector.xm
....... 2555 2014-01-28 22:42 20140301086\android-times-square-master\library\res\layout\month.xm
....... 1577 2014-01-28 22:42 20140301086\android-times-square-master\library\res\layout\week.xm
....... 510 2014-01-28 22:42 20140301086\android-times-square-master\library\res\values\attrs.xm
....... 689 2014-01-28 22:42 20140301086\android-times-square-master\library\res\values\colors.xm
....... 340 2014-01-28 22:42 20140301086\android-times-square-master\library\res\values\dimens.xm
....... 277 2014-01-28 22:42 20140301086\android-times-square-master\library\res\values\strings.xm
....... 1083 2014-01-28 22:42 20140301086\android-times-square-master\library\res\values\st
....... 156 2014-01-28 22:42 20140301086\android-times-square-master\library\res\values-v9\strings.xm
....... 2723 2014-01-28 22:42 20140301086\android-times-square-master\library\src\com\squareup\timessquare\CalendarCellView.java
....... 4326 2014-01-28 22:42 20140301086\android-times-square-master\library\src\com\squareup\timessquare\CalendarGridView.java
....... 28675 2014-01-28 22:42 20140301086\android-times-square-master\library\src\com\squareup\timessquare\CalendarPickerView.java
....... 2761 2014-01-28 22:42 20140301086\android-times-square-master\library\src\com\squareup\timessquare\CalendarRowView.java
....... 406 2014-01-28 22:42 20140301086\android-times-square-master\library\src\com\squareup\timessquare\Logr.java
....... 2102 2014-01-28 22:42 20140301086\android-times-square-master\library\src\com\squareup\timessquare\MonthCellDesc
....... 859 2014-01-28 22:42 20140301086\android-times-square-master\library\src\com\squareup\timessquare\MonthDesc
....... 3112 2014-01-28 22:42 20140301086\android-times-square-master\library\src\com\squareup\timessquare\MonthView.java
....... 23653 2014-01-28 22:42 20140301086\android-times-square-master\library\test\com\squareup\timessquare\CalendarPickerViewTest.java
....... 11358 2014-01-28 22:42 20140301086\android-times-square-master\LICENSE.txt
....... 4686 2014-01-28 22:42 20140301086\android-times-square-master\pom.xm
....... 2566 2014-01-28 22:42 20140301086\android-times-square-master\README.md
............此处省略55个文件信息
相关资源
- android中MVP模式一
- Android理财软件--天天记账的设计--论文
- IMToken核心源码-Android
- pdf在线预览,适用于pc android ios
- xamarin android使用zxing扫描二维码
- android图库 gallery apk
- Android 获取Gps信息的程序源码
- Android tab 栏居中滚动
- android使用Sqlite在一个库中建多张表
- Android端不通过登录SDK实现QQ登录验证
- 安卓 识别来电是否为被转移来电
- 血糖记录软件-android源代码
- 基于android手机通讯录的设计与实现的
- gson.jar包
- android上传文件.rar
- Android文本阅读器源代码.rar
- Android模拟器之间相互发短信代码
- com.android.volley:volley volley.jar
- Eclipse版android-gif-drawable-1.2.2
- 解析AndroidManifest源码
- open_sdk_r6008_lite.jar
- Android数据存储和访问实验报告
- AndroidStudio2.3.3
- Android底层开发技术实战详解
- android cookie获取和设置,webView的cook
- 高频RFID读写器二次开发SDK Android版
- android实现双屏异显异触
- 支持输入筛选的类spinner实现AndroidSt
- Android Studio代码高亮插件
- 全志 a33 Android快速移植
评论
共有 条评论