Skip to content

Commit

Permalink
support like NestedScrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
huanghaibin-dev committed Apr 12, 2019
1 parent c765d77 commit af0650a
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ You can't think of the calendar can be so elegant!

### Gradle
```
compile 'com.haibin:calendarview:3.6.0'
compile 'com.haibin:calendarview:3.6.1'
```

```
<dependency>
<groupId>com.haibin</groupId>
<artifactId>calendarview</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
<type>pom</type>
</dependency>
```
Expand Down
4 changes: 2 additions & 2 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ Android上一个优雅、高度自定义、性能高效的日历控件,完美

### Gradle
```
compile 'com.haibin:calendarview:3.6.0'
compile 'com.haibin:calendarview:3.6.1'
```
```
<dependency>
<groupId>com.haibin</groupId>
<artifactId>calendarview</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
<type>pom</type>
</dependency>
```
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ dependencies {
//noinspection GradleDependency
compile 'com.github.bumptech.glide:glide:3.7.0'
testCompile 'junit:junit:4.12'
compile 'com.haibin:calendarview:3.6.0'
//compile project(':calendarview')
//compile 'com.haibin:calendarview:3.5.9'
compile project(':calendarview')
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ public void onClick(DialogInterface dialog, int which) {
mCalendarLayout.shrink();
break;
case 2:
mCalendarView.scrollToPre(true);
mCalendarView.scrollToPre(false);
break;
case 3:
mCalendarView.scrollToNext(true);
mCalendarView.scrollToNext(false);
break;
case 4:
//mCalendarView.scrollToCurrent(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class MultiActivity extends BaseActivity implements
CalendarView.OnCalendarMultiSelectListener,
CalendarView.OnCalendarInterceptListener,
CalendarView.OnYearChangeListener,
CalendarView.OnMonthChangeListener,
CalendarView.OnCalendarSelectListener,
View.OnClickListener {

Expand Down Expand Up @@ -98,6 +99,7 @@ public void onClick(View v) {
mCalendarView.setOnCalendarSelectListener(this);
//设置日期拦截事件,当前有效
mCalendarView.setOnCalendarInterceptListener(this);
mCalendarView.setOnMonthChangeListener(this);
mTextYear.setText(String.valueOf(mCalendarView.getCurYear()));
mYear = mCalendarView.getCurYear();
mTextMonthDay.setText(mCalendarView.getCurMonth() + "月" + mCalendarView.getCurDay() + "日");
Expand Down Expand Up @@ -198,6 +200,11 @@ public void onYearChange(int year) {
}


@Override
public void onMonthChange(int year, int month) {
Log.e("onMonthChange", " -- " + year + " -- " + month);
}

/**
* 屏蔽某些不可点击的日期,可根据自己的业务自行修改
* 如 calendar > 2018年1月1日 && calendar <= 2020年12月31日
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
public class RangeActivity extends BaseActivity implements
CalendarView.OnCalendarInterceptListener,
CalendarView.OnCalendarRangeSelectListener,
CalendarView.OnMonthChangeListener,
View.OnClickListener {

TextView mTextLeftDate;
Expand Down Expand Up @@ -59,7 +60,7 @@ protected void initView() {

mCalendarView = (CalendarView) findViewById(R.id.calendarView);
mCalendarView.setOnCalendarRangeSelectListener(this);

mCalendarView.setOnMonthChangeListener(this);
//设置日期拦截事件,当前有效
mCalendarView.setOnCalendarInterceptListener(this);

Expand Down Expand Up @@ -197,6 +198,10 @@ public void onCalendarInterceptClick(Calendar calendar, boolean isClick) {
Toast.LENGTH_SHORT).show();
}

@Override
public void onMonthChange(int year, int month) {
Log.e("onMonthChange", " -- " + year + " -- " + month);
}

@Override
public void onCalendarSelectOutOfRange(Calendar calendar) {
Expand Down
4 changes: 2 additions & 2 deletions calendarview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
minSdkVersion 14
//noinspection OldTargetApi
targetSdkVersion 23
versionCode 360
versionName "3.0.0"
versionCode 361
versionName "3.6.1"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,6 @@ public boolean shrink(int duration) {
requestLayout();
}
if (isAnimating || mContentView == null) {
mWeekPager.setVisibility(VISIBLE);
mMonthView.setVisibility(GONE);
return false;
}
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mContentView,
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ org.gradle.jvmargs=-Xmx1536m
POM_BINTRAY_NAME=com.haibin:calendarview
POM_DESCRIPTION=A very good CalendarView for Android.
POM_ARTIFACT_ID=calendarview
VERSION_NAME=3.6.0
VERSION_CODE=3.6.0
VERSION_NAME=3.6.1
VERSION_CODE=3.6.1
POM_BINTRAY_PRPO=maven
POM_PACKAGING=aar
POM_NAME=calendarview
Expand Down

0 comments on commit af0650a

Please sign in to comment.