学习 square 日历框架 android-times-square
来源:互联网 发布:mac 印象笔记插件下载 编辑:程序博客网 时间:2024/05/23 05:09
查看github注意到android-times-square
将项目开发中的心得写出来与大家分享。
一 实现CellView 选择器
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_selected="true"> <shape android:shape="oval" > <solid android:color="#f4d05d" /> <stroke android:width="10dp" android:color="@android:color/white" /> <size android:width="30dp" android:height="30dp" /> </shape> </item> <item android:state_pressed="true"> <shape android:shape="oval" android:useLevel="false"> <solid android:color="#f4d05d" /> <stroke android:width="10dp" android:color="@android:color/white" /> <size android:width="30dp" android:height="30dp" /> </shape> </item> <item> <color android:color="@color/white" /> </item></selector>
二 实现日程红点提醒
class SampleDecorator implements CalendarCellDecorator { List<String> times; public SampleDecorator(List<String> times) { this.times = times; } @Override public void decorate(CalendarCellView cellView, Date date) {// if(!cellView.isCurrentMonth())// return; //设置文字 String temp = simpleDateFormat.format(date); if (times.contains(temp)) { String time = Integer.toString(date.getDate()); SpannableString string = new SpannableString(time + " "); Drawable drawable = getResources().getDrawable(R.mipmap.red_dian); drawable.setBounds(0, 0, 10, 10); ImageSpan imageSpan = new ImageSpan(drawable); string.setSpan(imageSpan, time.length(), string.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE); cellView.getDayOfMonthTextView().setText(string); } } }
项目完整代码
阅读全文
0 0
- 学习 square 日历框架 android-times-square
- 开源框架android-times-square实现日历选择日期
- Android android-times-square一款好用的日历控件
- android-times-square的使用
- Android-times-square自定义样式
- android-times-square日历开源库的导入,以及导入后出现的问题
- android-times-square日期控件使用
- Square
- Square
- Square
- Square
- Square
- Square
- Square
- Square
- Square
- Square 开源 Android
- Android图片加载框架Picasso(Square公司)
- 从键盘传入多个字符串到程序中,并将它们按逆序输出在屏幕上
- Fork/Join框架
- 图片相关操作
- 【笔记】《WebGL编程指南》学习-第6章着色器语言(1-基础)
- ACM输入外挂
- 学习 square 日历框架 android-times-square
- 加一 -LintCode
- C++字符串分割
- 测试之道--网络爬虫系列1
- android开发遭遇jni问题
- Spring MVC 4.2 增加 CORS 支持
- http://www.ityouknow.com/springcloud/2016/12/30/springcloud-collect.html
- 22、C#:窗体应用程序开发基本流程
- 练习项目 一款新闻app的开发 (一) : 欢迎界面开发(属性动画的运用)