Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yannecer authored Sep 18, 2017
1 parent 3e674b8 commit a43809b
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,38 @@ http://fir.im/7lv4

#### Gradle
```
compile 'com.necer.ncalendar:ncalendar:2.0.1'
compile 'com.necer.ncalendar:ncalendar:2.1.0'
```
##### 注意:ncalendar:1.0.x 的日历不能升级到 2.0.x,ncalendar:2.0.x是全新的日历
##### 注意:ncalendar:1.0.x 的日历不能升级到 2.x.x,ncalendar:2.x.x是全新的日历

#### 布局文件

```
<RelativeLayout
<com.necer.ncalendar.calendar.NCalendar
android:id="@+id/ncalendar"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
app:defaultCalendar="Month"
app:firstDayOfWeek="Sunday"
app:selectCircleColor="#3388ff">
<com.necer.ncalendar.calendar.NCalendar
android:id="@+id/ncalendar"
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultCalendar="Month"
app:firstDayOfWeek="Sunday"
app:selectCircleColor="#3388ff">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.necer.ncalendar.calendar.NCalendar>
</RelativeLayout>
android:layout_height="match_parent" />
</com.necer.ncalendar.calendar.NCalendar>
```


```ncalendar:2.0.0```包含一个月日历```NMonthCalendar```,一个周日历```NWeekCalendar```和一个滑动切换不同视图的```NCalendar```
```ncalendar:2.1.0```包含一个月日历```NMonthCalendar```,一个周日历```NWeekCalendar```和一个滑动切换不同视图的```NCalendar```
单一日历请使用```NMonthCalendar```或者```NWeekCalendar```

```NCalendar```日历包含了周日历和月日历,通过滑动切换不同的视图,交互效果仿miui日历,尽可能的实现miui的交互逻辑。

```NCalendar```在布局文件中需要一个```RelativeLayout```作为父布局,
内部需要一个实现了```NestedScrollingChild```的子类,```RecyclerView``````NestedScrollView```都可以。
```NCalendar```内部需要一个实现了```NestedScrollingChild```的子类,```RecyclerView``````NestedScrollView```都可以。



Expand All @@ -69,18 +65,23 @@ ncalendar.setOnCalendarChangeListener(new OnCalendarChangeListener() {
}
});
```

##### 2、跳转日期
```
ncalendar.setDate(int year, int month, int day);
```
##### 3、回到今天
```
ncalendar.toToday();
```

##### 3、月-->周  周-->月
##### 4、月-->周  周-->月
```
ncalendar.toWeek();
ncalendar.toMonth();
```

##### 4、支持自定义属性,设置NCalendar默认视图、一周的第一天是周日还是周一等
##### 5、支持自定义属性,设置NCalendar默认视图、一周的第一天是周日还是周一等
```
NCalendar默认视图,Month 或者 Week,默认是 Month
Expand All @@ -94,6 +95,7 @@ app:firstDayOfWeek="Sunday"
app:firstDayOfWeek="Monday"
```

### 支持的属性:


Expand Down

0 comments on commit a43809b

Please sign in to comment.