• Stars
    star
    129
  • Rank 279,262 (Top 6 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

周日历

WeekCalendar

周日历,Weekly Calendar。

效果图

使用方法(usage)

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

	allprojects {
		repositories {
			...
			maven { url "https://jitpack.io" }
		}
	}

Step 2. Add the dependency

	dependencies {
	    compile 'com.github.loonggg:WeekCalendar:v1.4'
	}

Step 3. There are a few xml attributes to customise the calendar

  • daysTextSize 设置日期中“天day”的文字大小
  • todayTextColor 设置日期中当天文字的颜色
  • daysTextColor 设置日期中“天day”的文字颜色
  • daysSelectedTextColor 设置选中的日期的文字颜色
  • daysSelectedBackground 设置选中的日期的背景
  • weekTextSize 设置星期栏的字体大小
  • weekTextColor 设置星期一栏中的字体颜色
  • weekBackgroundColor 设置星期一栏背景
  • hideTodayName 是否显示当天日期时的日期为“今”字,否则显示日期数字
  • isCornerMark 是否显示选中的日期中的右上角的角标
  • cornerMarkBg 设置角标图片
  • monthBackgroundColor 设置年月栏的背景色
  • monthTextColor 设置年月字体颜色
  • nextArrowBg 设置年月栏下一个月的按钮背景
  • preArrowBg 设置上一个月的按钮背景
  • isShowMonth 是否显示年月一栏

Example

 <com.loonggg.weekcalendar.view.WeekCalendar
        android:id="@+id/week_calendar"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="#ffffff"
        android:paddingBottom="10dp"
        app:cornerMarkBg="@mipmap/order_book_icon"
        app:daysSelectedBackground="@drawable/green_oval_bg"
        app:isCornerMark="true"
        app:monthBackgroundColor="#8F83F1"
        app:nextArrowBg="@mipmap/white_right_arrow"
        app:preArrowBg="@mipmap/white_left_arrow" />

Step 4. Impelement Listener

weekCalendar = (WeekCalendar) findViewById(R.id.week_calendar);
List<String> list = new ArrayList<>();
list.add("2016-09-13");
list.add("2016-10-13");
list.add("2016-10-11");
list.add("2016-10-10");
list.add("2016-10-16");
//传入已经预约或者曾经要展示选中的时间列表
weekCalendar.setSelectDates(list);
//设置日历点击事件
weekCalendar.setOnDateClickListener(new WeekCalendar.OnDateClickListener() {
     @Override
     public void onDateClick(String time) {
         Toast.makeText(MainActivity.this, time, Toast.LENGTH_SHORT).show();
     }
});
//设置年月时间的回调
weekCalendar.setOnCurrentMonthDateListener(new WeekCalendar.OnCurrentMonthDateListener() {
     @Override
     public void onCallbackMonthDate(String year, String month) {
         Toast.makeText(MainActivity.this, year + "-" + month, Toast.LENGTH_SHORT).show();
     }
});

公众号

欢迎大家关注我的微信公众号:非著名程序员(smart_android),更多好的原创文章均首发于微信订阅号:非著名程序员

License

Copyright 2016 loonggg

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

More Repositories

1

DevMoneySharing

独立开发者赚钱经验分享
2,516
star
2

Android-AlarmManagerClock

设置闹钟的一个封装的比较全面的demo
Java
661
star
3

CoordinatorLayoutDemo

使用CoordinatorLayout仿稀土掘金个人界面
Java
531
star
4

MaterialDesignDemo

MaterialDesign系列控件讲解
Java
294
star
5

RecyclerViewBanner

使用RecyclerView做的轮播图
Java
251
star
6

DragerViewLayout

拖动,拖拽视图,拖动排序
Java
86
star
7

SnapHelperDemo

使用 RecyclerView 实现 Gallery 画廊效果,并控制 Item 停留位置
Java
45
star
8

TextViewSpanLink

在TextView展示超链接,可以点击,可以使固定的文字变色,可点击等
Java
39
star
9

BottomSheetPopupDialog

底部弹出框
Java
24
star
10

TextWrapView

图文混排
Java
22
star
11

CircleProgressBar

圆环进度动态显示
Java
15
star
12

WeChatPublicArticles

『非著名程序员』公众号文章推送列表
14
star
13

GifViewDemo

一个简单的gif图片加载的viewdemo
Java
12
star
14

CarouselView

banner轮播效果
Java
8
star
15

TextViewClock

时间控件,显示时分,中间”:”跳动
Java
7
star
16

WeChat-FuelDemo

微信小程序之油耗计算器项目源码
JavaScript
5
star
17

MVPFrame

Dagger2+MVP+RxJava+Retrofit 的项目框架
Java
4
star
18

SwipeRefreshLoadMoreLayout

一个 Material Design 风格的下拉刷新,上拉自动加载更多的库
Java
3
star
19

loonggg.github.io

HTML
2
star
20

LunarCalendar

日历转农历
Java
1
star
21

FileRepository

文件资源库
1
star
22

QuickIndexListView

ListView带有侧边索引的快速查找(跟带字母索引查找的通讯录差不多)
Java
1
star