Skip to content

Commit

Permalink
新增月日历上下月是否可点击的属性
Browse files Browse the repository at this point in the history
  • Loading branch information
yannecer committed Oct 22, 2019
1 parent d236e32 commit 0903ee2
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 5 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
minSdkVersion 15
targetSdkVersion 27
versionCode 2
versionName "4.3.4"
versionName "4.3.8"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
4 changes: 2 additions & 2 deletions ncalendar/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ android {
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "4.3.7"
versionName "4.3.8"
}
}

Expand All @@ -23,7 +23,7 @@ publish {
repoName = 'maven'//bintray仓库
groupId = 'com.necer.ncalendar'//jcenter上的路径
artifactId = 'ncalendar'//项目名称
publishVersion = '4.3.7'//版本号
publishVersion = '4.3.8'//版本号
desc = 'NCalendar'
website = 'https://github.com/yannecer/NCalendar'
}
8 changes: 6 additions & 2 deletions ncalendar/src/main/java/com/necer/calendar/BaseCalendar.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,15 @@ public void onClickCurrectMonthOrWeekDate(LocalDate localDate) {
}

public void onClickLastMonthDate(LocalDate localDate) {
jump(localDate, true);
if (mAttrs.isLastNextMonthClickEnable) {
jump(localDate, true);
}
}

public void onClickNextMonthDate(LocalDate localDate) {
jump(localDate, true);
if (mAttrs.isLastNextMonthClickEnable) {
jump(localDate, true);
}
}

public void jump(LocalDate localDate, boolean isDraw) {
Expand Down
2 changes: 2 additions & 0 deletions ncalendar/src/main/java/com/necer/utils/Attrs.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,7 @@ public class Attrs {
public int numberBackgroundTextColor; //数字背景字体颜色
public int numberBackgroundAlphaColor;//数字背景字体透明度

public boolean isLastNextMonthClickEnable;//月日历上下月是否可点击


}
1 change: 1 addition & 0 deletions ncalendar/src/main/java/com/necer/utils/AttrsUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public static Attrs getAttrs(Context context, AttributeSet attributeSet) {
attrs.numberBackgroundTextColor = ta.getColor(R.styleable.NCalendar_numberBackgroundTextColor, context.getResources().getColor(R.color.todaySolarTextColor));
attrs.numberBackgroundAlphaColor = ta.getInt(R.styleable.NCalendar_numberBackgroundAlphaColor, 50);

attrs.isLastNextMonthClickEnable = ta.getBoolean(R.styleable.NCalendar_isLastNextMonthClickEnable, true);
ta.recycle();

return attrs;
Expand Down
1 change: 1 addition & 0 deletions ncalendar/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

<attr name="isShowHoliday" format="boolean" />
<attr name="isAllMonthSixLine" format="boolean" />
<attr name="isLastNextMonthClickEnable" format="boolean" />
<attr name="holidayColor" format="color" />
<attr name="workdayColor" format="color" />
<attr name="todaySelectContrastColor" format="color" />
Expand Down

0 comments on commit 0903ee2

Please sign in to comment.